Online course recommendation method based on attention mechanism and heterogeneous hypergraph

By constructing a heterogeneous high-order structure between students, courses, and teachers, and combining graph convolution with attention mechanisms, we solve the problem of insufficient accuracy in modeling multimodal high-order relationships in existing technologies and achieve more accurate online course recommendations.

CN120744239APending Publication Date: 2025-10-03HUAZHONG NORMAL UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510920011.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-04
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

Existing online course recommendation methods find it difficult to effectively model high-order complex relationships between users, courses, and teachers, lack the ability to model multimodal heterogeneous data, and have insufficient recommendation accuracy and personalization levels.

Method used

An online course recommendation method based on attention mechanism and heterogeneous hypergraph is adopted to construct a heterogeneous high-order structure between students, courses and teachers. Feature fusion is performed through heterogeneous hypergraph convolution operator, and attention mechanism is introduced to dynamically adjust weights. Graph structure and sequence modeling are combined to optimize recommendation accuracy.

Benefits of technology

It improves the personalization and accuracy of recommendations, can more comprehensively capture user preferences and contextual information, and is suitable for a variety of online learning scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120744239A_ABST
    Figure CN120744239A_ABST
Patent Text Reader

Abstract

The invention discloses an online course recommendation method based on an attention mechanism and a heterogeneous hypergraph. The online course recommendation method comprises the steps of collecting online education platform data and constructing a graph structure, obtaining historical online learning data of a user, constructing a heterogeneous hypergraph structure and obtaining five types of heterogeneous hypergraphs; carrying out embedding learning on vertexes in the five types of heterogeneous hypergraphs by adopting a heterogeneous hypergraph convolution operator, and carrying out feature fusion through information transmission between hyperedges and the vertexes to obtain heterogeneous hypergraph embedding features; an attention mechanism is introduced, importance weight coefficients between vertexes and hyperedges and attention scores between the hyperedges are calculated respectively, and weight distribution in the node information aggregation process is dynamically adjusted; fusing the obtained heterogeneous hypergraph embedded features with the user course interaction sequence embedded features; and predicting the preference degree of the user on the target course, and finally outputting a personalized course recommendation result. According to the method, the recommendation personalization and accuracy are improved, and the problem of insufficient accuracy during modeling of the multi-modal high-order relationship in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a data processing method, specifically an online course recommendation method based on an attention mechanism and a heterogeneous hypergraph, belonging to the technical field of course recommendation. Background Art

[0002] With the rapid development of online education platforms and mobile, open, and online courses (MOOCs), learning resources have increased dramatically, and the pressure on learners to choose the right information has also increased. Traditional recommendation methods, such as collaborative filtering, matrix factorization, and sequence modeling, struggle to accurately represent the complex relationships between users and courses. Furthermore, while graph neural networks (GNNs) offer certain advantages in relational modeling, traditional graph structures can only represent pairwise relationships and struggle to capture the higher-order connections between users, courses, and instructors.

[0003] Most current mainstream course recommendation methods build models based on user click history or rating data. These methods rely on sparse user behavior data, significantly reducing their effectiveness when dealing with cold-start users or courses. Furthermore, they generally lack the ability to model rich information such as prerequisite dependencies between courses, relevance of course content, and instructor teaching styles.

[0004] In recent years, graph neural networks have garnered widespread attention in recommender systems. Compared to traditional architectures, graphs can model complex, non-Euclidean relationships between entities, giving recommender systems greater structural awareness. However, existing GNN models are mostly based on homogeneous graphs and are unable to effectively represent multiple types of nodes, such as students, courses, and teachers, and their complex many-to-many relationships.

[0005] Furthermore, most existing graph models only support binary connections and cannot express shared relationships between multiple nodes. Hypergraphs, on the other hand, can connect multiple vertices via a single hyperedge, effectively expressing higher-order semantic relationships between learners and multiple courses or teachers. Hypergraphs offer stronger modeling capabilities and are particularly well-suited for recommendation modeling of multimodal, heterogeneous data.

[0006] On the other hand, the attention mechanism, as an important breakthrough in the field of deep learning in recent years, has shown significant performance improvements in natural language processing and computer vision. Introducing the attention mechanism in the recommendation system can adaptively adjust the weights according to the structural or semantic correlation between nodes, thereby more accurately capturing user preferences and contextual information. However, the current research on jointly modeling the attention mechanism with the hypergraph structure is still relatively limited. The existing technology still has the following problems: ① There is a lack of a unified modeling method for high-order complex relationships between heterogeneous entities such as students, courses, and teachers; ② Existing graph models cannot effectively handle non-paired and many-to-many relationships; ③ There is a lack of strategies to introduce attention mechanisms into graph structures to enhance the modeling of important relationships; ④ The recommendation accuracy and personalization level still need to be improved.

[0007] To this end, there is an urgent need for an online course recommendation method that integrates heterogeneous hypergraphs and attention mechanisms to achieve more comprehensive, accurate and personalized recommendation services.

[0008] Related patent document: CN118379117A discloses an online course recommendation method and system based on big data. The method includes: data acquisition, tensor processing, construction of an 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. This 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 potential embedding matrix, and designs an overall loss function based on reconstruction loss and prediction loss, thereby improving the efficiency of the model and the accuracy of recommendation; dynamically selects search strategies through priority updates, uses different search strategies at different stages, and designs three strategies: spiral search, neighborhood search and adaptive walking search, which respectively target the needs of global search, local search and balancing global and local search, thereby increasing the flexibility and randomness of the search.

[0009] The above techniques do not solve the problem of insufficient accuracy of existing techniques in modeling multimodal high-order relationships. Summary of the Invention

[0010] The purpose of this invention is to overcome the shortcomings of the existing technology and provide an online course recommendation method based on the attention mechanism and heterogeneous hypergraph, which can improve the personalization and accuracy of recommendations and is applicable to a variety of online learning scenarios to solve the problem of insufficient accuracy of the existing technology in modeling multimodal high-order relationships.

[0011] In order to solve the above technical problems, the technical solutions adopted by the present invention are as follows:

[0012] An online course recommendation method based on an attention mechanism and a heterogeneous hypergraph includes the following steps:

[0013] S1: Collect online education platform data and build a graph structure. Obtain users' historical online learning data, including the interaction between students, courses, and teachers. Build a heterogeneous hypergraph structure with students, courses, and teachers as nodes, and define five types of high-order heterogeneous relationships to obtain five types of heterogeneous hypergraphs.

[0014] S2: Use heterogeneous hypergraph convolution operators to learn the embedding of vertices in five types of heterogeneous hypergraphs. By transferring information between hyperedges and vertices, feature fusion is performed to extract high-order nonlinear relationship representations and obtain heterogeneous hypergraph embedding features.

[0015] S3: Introducing the attention mechanism to calculate the importance weight coefficients between vertices and hyperedges and the attention scores between hyperedges, and dynamically adjust the weight distribution during the node information aggregation process;

[0016] S4: The heterogeneous hypergraph embedding features obtained in step S2 are fused with the embedding features of the user-course interaction sequence to form a comprehensive representation vector, namely preference scoring and fusion modeling. The system fuses the structural interest sequence behavior modeling representation to predict the user's preference score for the course. This stage dynamically combines the long-term interest representation in the graph structure with the short-term interest in sequence modeling (graph structure interest modeling uses the structure-enhanced embedding output in the previous stage to represent the user's long-term accumulated preference features in the graph structure, such as course selection history, teacher preferences, and course combination relationships), improving the completeness of user interest modeling and achieving quantitative estimation of user preference through the scoring function.

[0017] S5: Use the scoring function to predict the user's preference for the target course, build a model of the user's behavior sequence, and train the model using the ranking optimization objective function to ultimately output personalized course recommendations. This stage aims to optimize the model's ranking accuracy for positive and negative course samples through triple training in the ranking task, achieving end-to-end recommendation accuracy.

[0018] Among the above technical solutions, a preferred technical solution may be that, in step S1, the specific construction of the five types of heterogeneous hypergraphs includes:

[0019] S1.1: A hypergraph constructed with students as hyperedges and courses as vertices is used to represent the set of courses selected by each student and to explore the similarity of learning paths between students; S1.2: A hypergraph constructed with courses as hyperedges and students as vertices, used to characterize the student groups attracted by the course and reflect the learning behavior patterns of the course;

[0020] S1.3: A hypergraph constructed with teachers as hyperedges and students as vertices is used to represent the set of students associated with the teacher and model students' preference behavior towards teachers; S1.4: A hypergraph constructed with teachers as hyperedges and courses as vertices, used to represent the set of courses taught by a teacher and reflect the relationship between teachers and courses; S1.5: A hypergraph constructed with "the set of students who have taken similar courses" as a hyperedge is used to build high-order connections between students with similar learning interests or paths;

[0021] Each hypergraph is represented by an incidence matrix Indicates that:

[0022] (1), in, For nodes, For the super edge, is the number of vertices, is the number of hyperedges.

[0023] This step specifically involves acquiring user learning behavior data from online education platforms and constructing five heterogeneous hypergraph structures: the student-course hypergraph, the course-student hypergraph, the teacher-student hypergraph, the teacher-course hypergraph, and the similar-course-student hypergraph. Each entity type in the hypergraph is connected to other entities via hyperedges, enabling many-to-many, high-order connection modeling. For example, the student-course hypergraph is used to represent the multiple courses a student has taken, the course-student hypergraph reflects the student groups a course attracts, the teacher-course hypergraph models the structure of teacher teaching content, and the similar-course-student hypergraph captures potential clustering relationships of learning interests based on collaborative course selection information. This embodiment, based on the interactive information between students, courses, and teachers on actual online education platforms (such as MOOCCube), extracts student learning history, course metadata (difficulty, labels, instructors), and teacher teaching records to construct five types of heterogeneous hypergraph structures. Each type of hypergraph has different entities as vertices, and hyperedges connect multiple nodes to reflect complex many-to-many relationships. The five types of graphs include: student-course (reflecting students' course selection preferences), course-student (reflecting course attractiveness), teacher-course (reflecting teachers' teaching style), teacher-student (reflecting teaching influence), and similar course-student graph (calculating the similarity between courses based on collaborative filtering and connecting students who have chosen the same course).

[0024] In the above technical solution, a preferred technical solution may also be that in step S2, the heterogeneous hypergraph convolution operator is defined as:

[0025] S2.11: Aggregate the features of the vertices connected by each hyperedge to generate a hyperedge embedding representation; S2.12: Propagate the hyperedge embedding back to the associated vertex through the connection matrix to enhance vertex features; S2.13: The entire convolution process includes normalization operations on the trainable weight matrix, vertex degree matrix, and hyperedge degree matrix, and further nonlinear mapping is achieved through activation functions;

[0026] S2.14: Finally complete heterogeneous feature fusion across node types and high-order structures.

[0027] In step S2, the method of using the heterogeneous hypergraph convolution operator to embed the vertices in the five types of heterogeneous hypergraphs and perform feature fusion through information transmission between hyperedges and vertices is to apply the hypergraph convolution operator on each of the heterogeneous hypergraphs to realize the learning and aggregation of node embedding features. The convolution propagation formula is as follows: (2), in, Representative Vertex features of layer input, Representative The vertex features of the layer input, P represents the Hedi The trainable weight matrix of the layer, W represents the hyperedge mapping matrix, Represents an activation function, N represents the matrix of the degrees of the vertices in the hypergraph, S represents the matrix of the degrees of the hyperedges in the hypergraph, and H is an incidence matrix with the vertices of the hypergraph as rows and the hyperedges as columns. Conversely, if the message passing path from the vertex to the hyperedge is specified, the vertices should be regarded as columns and the hyperedges as rows.

[0028] The above process gradually extracts semantic representations from first-order neighbors to high-order structures through multi-layer stacking, and adjusts the perception field of view by controlling the depth, thereby taking into account both local and global information.

[0029] In step S2, the specific steps of using the heterogeneous hypergraph convolution operator to embed the vertices in the five types of heterogeneous hypergraphs and perform feature fusion through information transfer between hyperedges and vertices are as follows:

[0030] S2.21: Hypergraph convolution operation, constructing adjacency representation and initial features: For each type of heterogeneous hypergraph, extract its vertex-hyperedge connection relationship and generate a hypergraph association matrix , and calculate the node With super edge , and construct the node initial input features , is the pre-trained semantic vector;

[0031] S2.22: Perform multi-layer hypergraph convolutional embedding propagation: Iterate the convolution operation according to the following formula: (2).

[0032] In the above technical solution, a preferred technical solution may also be that in step S3, the attention mechanism includes:

[0033] S3.1: Based on the attention mechanism of feature similarity between vertices and hyperedges, the aggregation weight of vertices in each hyperedge is dynamically assigned to distinguish the importance of nodes to different hyperedges. The calculation formula is:

[0034] (3), in, For nodes The eigenvector of For super edge The eigenvector of , W1 and W2 are both linear transformation matrices acting on node features, It is an activation function that increases the small gradient in the negative half area to avoid information dead zones.

[0035] S3.2: Based on the similarity attention mechanism between hyperedges, cosine similarity is used to measure the structural or content relevance between hyperedges, guiding the model to focus on key course combinations. The calculation formula is:

[0036] (4), Where h represents the embedding vector of the corresponding hyperedge.

[0037] S3.3: The attention coefficient is calculated based on the transformed embedding representation, and softmax normalization is performed after linear projection to ensure stable training.

[0038] In the above technical solution, a preferred technical solution may also be that step S4 specifically includes:

[0039] S4.1: Extract student behavior sequences (such as access, course selection, and grading) and model them using a bidirectional long short-term memory (Bi-LSTM) network to output a temporal preference representation that reflects the dynamic evolution of user interests.

[0040] S4.2: Concatenate the attention and sequence and input them into the multi-layer perceptron (MLP) for nonlinear mapping to obtain the final user embedding , use the following scoring function to calculate the candidate course Preference score: (5), This score is used to generate the Top-K recommendation list.

[0041] In the above technical solution, a preferred technical solution may also be that in step S5, the method of predicting the user's preference for the target course using the scoring function includes the following steps:

[0042] S5.11: Use the dot product between the student embedding vector and the course embedding vector as the scoring function, or use a multilayer perceptron (MLP) with hidden layers for nonlinear modeling.

[0043] S5.12: The model optimization uses the Bayesian Personalized Ranking (BPR) ranking loss function to determine the maximum difference between the observed course preferences and the unobserved course ratings. The calculation formula is:

[0044] (6), in, is the sigmoid function, represents the positive sample course, represents the negative sample class, are model parameters, is the regularization coefficient;

[0045] S5.13: L2 regularization is introduced during training to prevent overfitting, and the optimizer uses Adam for gradient updates.

[0046] In step S5, the model for constructing the user behavior sequence uses a long short-term memory neural network (LSTM) or a gated recurrent unit (GRU) that extracts the learner's dynamic preferences, including the following steps:

[0047] S5.21: Encode students’ course visit sequences in chronological order and embed them into a unified space; S5.22: Modeling sequential information using recurrent neural network architectures to learn time-dependent interest shifts and evolution patterns. S5.23: After the sequence embedding is output, it is jointly represented with the heterogeneous hypergraph embedding to improve the recommendation expression ability. The calculation formula is as follows: (7), in, For the moment Course input, Output hidden state for LSTM, is the Hadamard product, is the sigmoid function, 、 、 、 are the trainable weight matrices of four different gating units, b are the four corresponding bias items, Output of the forget gate, controlling the retention of old memories , Output of the input gate, controlling the acceptance of new information , Output gate output, controlling the current hidden state Output.

[0048] In the above technical solution, a preferred technical solution may also be that, in step S5, the final output personalized course recommendation result includes the top K course results, and the following indicators are used to evaluate the recommendation performance:

[0049] S5.31: Normalized Discounted Cumulative Gain (NDCG) measures the rationality of the ranking of high-accuracy courses in the recommendation list. Its calculation formula is: (8), in, Represents the relevance score of the i-th item in the recommendation list.

[0050] S5.32: Recall, which reflects the coverage ratio of relevant courses detected by the system to real relevant courses; S5.33: F1-Score, which comprehensively reflects the balance between recommendation precision and recall; S5.34: The above indicators are calculated based on the Top-K recommendation list, and the K value is set to common values ​​such as 5, 10, and 15.

[0051] This paper uses the BPR ranking loss function to optimize the objective. This function maximizes the probability that users will rate positive sample courses higher than negative sample courses. The training platform uses the TensorFlow framework and the Adam optimizer, supporting dynamic learning rate adjustment and batch training mechanisms to ensure a stable and efficient training process.

[0052] In terms of experimental performance, this invention has been systematically evaluated on large-scale online education datasets such as MOOCCube. The results show that it outperforms comparison algorithms such as BERT4Rec, TP-GNN, LightGCN, and KSCR in multiple indicators such as NDCG@10, Recall@10, and F1-score@10, verifying its modeling advantages and recommendation effects under complex heterogeneous data.

[0053] This invention is applicable to a variety of online learning scenarios, including university course recommendation systems, vocational skills training platforms, adaptive intelligent tutoring systems, etc. It can provide personalized course path suggestions for learners of different backgrounds and stages, facilitating industrial transformation.

[0054] In summary, the present invention proposes an online course recommendation method based on attention mechanism and heterogeneous hypergraph. By constructing a heterogeneous high-order structure between students, courses and teachers, and combining graph convolution with dual attention mechanism, it can fully mine multimodal high-order structural information and improve the personalization and accuracy of the recommendation effect. The present invention takes heterogeneous hypergraph as the core of structural modeling, introduces attention mechanism and sorting optimization goal, and integrates sequence interest modeling and structural relationship perception to construct an efficient, scalable and strongly generalized online course personalized recommendation method, which is suitable for a variety of online learning scenarios and solves the problem of insufficient accuracy of existing technologies in modeling multimodal high-order relationships. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 1 is an overall flow chart of the method of the present invention.

[0056] Figure 2 Schematic diagram of the present invention based on heterogeneous hypergraph and attention mechanism.

[0057] Figure 3 Schematic diagram of the hypergraph convolution computing framework based on heterogeneous hypergraph of the present invention.

[0058] Figure 4 This is a schematic diagram of the course hypergraph association matrix of the present invention.

[0059] Figure 5 Schematic diagram of the vertex-hyperedge and hyperedge-hyperedge attention mechanism of the present invention.

[0060] Figure 6 Schematic diagram of the graph structure embedding and sequence embedding fusion module of the present invention.

[0061] Figure 7 Schematic diagram of the BPR sorting optimization and dynamic triplet sampling mechanism during the training process of the model of the present invention. DETAILED DESCRIPTION

[0062] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. All other embodiments derived by persons of ordinary skill in the art based on these embodiments without inventive effort are considered to fall within the scope of the present invention.

[0063] Example 1: Figure 1 、 Figure 2 、 Figure 3 、 Figure 4 、 Figure 5 、 Figure 6 、 Figure 7 As shown, the online course recommendation method based on attention mechanism and heterogeneous hypergraph of the present invention includes the following steps:

[0064] S1: Collect data from online education platforms (such as MOOCCube) and construct a graph structure. Obtain historical online learning data of users (students), including the interaction between students and courses and teachers. Build a heterogeneous hypergraph structure with students, courses, and teachers as nodes, and define five types of high-order heterogeneous relationships to obtain five types of heterogeneous hypergraphs. In step S1, the specific construction of the five types of heterogeneous hypergraphs includes:

[0065] S1.1: A hypergraph constructed with students as hyperedges and courses as vertices is used to represent the set of courses selected by each student and to explore the similarity of learning paths between students; S1.2: A hypergraph constructed with courses as hyperedges and students as vertices, used to characterize the student groups attracted by the course and reflect the learning behavior patterns of the course;

[0066] S1.3: A hypergraph constructed with teachers as hyperedges and students as vertices is used to represent the set of students associated with the teacher and model students' preference behavior towards teachers; S1.4: A hypergraph constructed with teachers as hyperedges and courses as vertices, used to represent the set of courses taught by a teacher and reflect the relationship between teachers and courses; S1.5: A hypergraph constructed with "the set of students who have taken similar courses" as a hyperedge is used to build high-order connections between students with similar learning interests or paths;

[0067] Each hypergraph is represented by an incidence matrix Indicates that: (1), in, For nodes, For the super edge, is the number of vertices, is the number of hyperedges.

[0068] This step specifically involves acquiring user learning behavior data from online education platforms and constructing five heterogeneous hypergraph structures: the student-course hypergraph, the course-student hypergraph, the teacher-student hypergraph, the teacher-course hypergraph, and the similar-course-student hypergraph. Each entity type in the hypergraph is connected to other entities via hyperedges, enabling many-to-many, high-order connection modeling. For example, the student-course hypergraph is used to represent the multiple courses a student has taken, the course-student hypergraph reflects the student groups a course attracts, the teacher-course hypergraph models the structure of teacher teaching content, and the similar-course-student hypergraph captures potential clustering relationships of learning interests based on collaborative course selection information. This embodiment, based on the interactive information between students, courses, and teachers on actual online education platforms (such as MOOCCube), extracts student learning history, course metadata (difficulty, labels, instructors), and teacher teaching records to construct five types of heterogeneous hypergraph structures. Each type of hypergraph has different entities as vertices, and hyperedges connect multiple nodes to reflect complex many-to-many relationships. The five types of graphs include: student-course (reflecting students' course selection preferences), course-student (reflecting course attractiveness), teacher-course (reflecting teachers' teaching style), teacher-student (reflecting teaching influence), and similar course-student graph (calculating the similarity between courses based on collaborative filtering and connecting students who have chosen the same course).

[0069] S2: Use the heterogeneous hypergraph convolution operator to embed the vertices in the five types of heterogeneous hypergraphs, perform feature fusion through information transfer between hyperedges and vertices, extract high-order nonlinear relationship representations, and obtain heterogeneous hypergraph embedding features. In step S2, the heterogeneous hypergraph convolution operator is defined as:

[0070] S2.11: Aggregate the features of the vertices connected by each hyperedge to generate a hyperedge embedding representation; S2.12: Propagate the hyperedge embedding back to the associated vertex through the connection matrix to enhance vertex features; S2.13: The entire convolution process includes normalization operations on the trainable weight matrix, vertex degree matrix, and hyperedge degree matrix, and further nonlinear mapping is achieved through activation functions;

[0071] S2.14: Finally complete heterogeneous feature fusion across node types and high-order structures.

[0072] In step S2, the method of using the heterogeneous hypergraph convolution operator to embed the vertices in the five types of heterogeneous hypergraphs and perform feature fusion through information transmission between hyperedges and vertices is to apply the hypergraph convolution operator on each of the heterogeneous hypergraphs to realize the learning and aggregation of node embedding features. The convolution propagation formula is as follows: (2), in, Representative Vertex features of layer input, Representative The vertex features of the layer input, P represents the Hedi The trainable weight matrix of the layer, W represents the hyperedge mapping matrix, Represents an activation function, N represents the matrix of the degrees of the vertices in the hypergraph, S represents the matrix of the degrees of the hyperedges in the hypergraph, and H is an incidence matrix with the vertices of the hypergraph as rows and the hyperedges as columns. Conversely, if the message passing path from the vertex to the hyperedge is specified, the vertices should be regarded as columns and the hyperedges as rows.

[0073] The above process gradually extracts semantic representations from first-order neighbors to high-order structures through multi-layer stacking, and adjusts the perception field of view by controlling the depth, thereby taking into account both local and global information.

[0074] In step S2, the specific steps of using the heterogeneous hypergraph convolution operator to embed the vertices in the five types of heterogeneous hypergraphs and perform feature fusion through information transfer between hyperedges and vertices are as follows:

[0075] S2.21: Hypergraph convolution operation, constructing adjacency representation and initial features: For each type of heterogeneous hypergraph, extract its vertex-hyperedge connection relationship and generate a hypergraph association matrix , and calculate the node With super edge , and construct the node initial input features , is the pre-trained semantic vector;

[0076] S2.22: Perform multi-layer hypergraph convolutional embedding propagation: Iterate the convolution operation according to the following formula: (2).

[0077] S3: Introduce the attention mechanism to calculate the importance weight coefficients between vertices and hyperedges and the attention scores between hyperedges, and dynamically adjust the weight distribution during the node information aggregation process. In step S3, the attention mechanism includes:

[0078] S3.1: Based on the attention mechanism of feature similarity between vertices and hyperedges, the aggregation weight of vertices in each hyperedge is dynamically assigned to distinguish the importance of nodes to different hyperedges. The calculation formula is: (3), in, For nodes The eigenvector of For super edge The eigenvector of , W1 and W2 are both linear transformation matrices acting on node features, It is an activation function that increases the small gradient in the negative half area to avoid information dead zones.

[0079] S3.2: Based on the similarity attention mechanism between hyperedges, cosine similarity is used to measure the structural or content relevance between hyperedges, guiding the model to focus on key course combinations. The calculation formula is: (4), Where h represents the embedding vector of the corresponding hyperedge.

[0080] S3.3: The attention coefficient is calculated based on the transformed embedding representation, and softmax normalization is performed after linear projection to ensure stable training.

[0081] S4: The heterogeneous hypergraph embedding features obtained in step S2 are fused with the user-course interaction sequence embedding features to form a comprehensive representation vector, namely the preference score and fusion modeling. The system fuses the structure-interest sequence behavior modeling representation to predict the user's preference score for the course. Step S4 specifically includes:

[0082] S4.1: Extract student behavior sequences (such as access, course selection, and grading) and model them using a bidirectional long short-term memory (Bi-LSTM) network to output a temporal preference representation that reflects the dynamic evolution of user interests.

[0083] S4.2: Concatenate the attention and sequence and input them into the multi-layer perceptron (MLP) for nonlinear mapping to obtain the final user embedding , use the following scoring function to calculate the candidate course Preference score: (5), This score is used to generate the Top-K recommendation list.

[0084] S5: Use the scoring function to predict the user's preference for the target course, build a model of the user behavior sequence, combine the sorting optimization objective function to train the model, and finally output personalized course recommendation results.

[0085] In step S5, the method for predicting the user's preference for the target course using the scoring function includes the following steps:

[0086] S5.11: Use the dot product between the student embedding vector and the course embedding vector as the scoring function, or use a multilayer perceptron (MLP) with hidden layers for nonlinear modeling.

[0087] S5.12: The model optimization uses the Bayesian Personalized Ranking (BPR) ranking loss function to determine the maximum difference between the observed course preferences and the unobserved course ratings. The calculation formula is: (6), in, is the sigmoid function, represents the positive sample course, represents the negative sample class, are model parameters, is the regularization coefficient;

[0088] S5.13: L2 regularization is introduced during training to prevent overfitting, and the optimizer uses Adam for gradient updates.

[0089] In step S5, the model for constructing the user behavior sequence uses a long short-term memory neural network (LSTM) or a gated recurrent unit (GRU) that extracts the learner's dynamic preferences, including the following steps:

[0090] S5.21: Encode students’ course visit sequences in chronological order and embed them into a unified space; S5.22: Modeling sequential information using recurrent neural network architectures to learn time-dependent interest shifts and evolution patterns. S5.23: After the sequence embedding is output, it is jointly represented with the heterogeneous hypergraph embedding to improve the recommendation expression ability. The calculation formula is as follows: (7), in, For the moment Course input, Output hidden state for LSTM, is the Hadamard product, is the sigmoid function. 、 、 、 are the trainable weight matrices of four different gating units, b are the four corresponding bias items, Output of the forget gate, controlling the retention of old memories , Output of the input gate, controlling the acceptance of new information , Output gate output, controlling the current hidden state Output.

[0091] In step S5, the final output personalized course recommendation results include the top K course results, and the following indicators are used to evaluate the recommendation performance:

[0092] S5.31: Normalized Discounted Cumulative Gain (NDCG) measures the rationality of the ranking of high-accuracy courses in the recommendation list. Its calculation formula is: (8), in, Represents the relevance score of the i-th item in the recommendation list.

[0093] S5.32: Recall, which reflects the coverage ratio of relevant courses detected by the system to real relevant courses; S5.33: F1-Score, which comprehensively reflects the balance between recommendation precision and recall; S5.34: The above indicators are calculated based on the Top-K recommendation list, and the K value is set to common values ​​such as 5, 10, and 15.

[0094] In this invention, training optimization and platform deployment use BPR ranking loss function for model training: training data is constructed using user triples Positive samples are history courses, and negative samples are unclicked courses. The optimizer uses Adam, and the training platform is based on an NVIDIA RTX 3090 GPU. The system can be deployed on mainstream online education platforms, integrates with student behavior logs in real time, and supports online model updates.

[0095] In summary, the above embodiments of the present invention propose an online course recommendation method based on attention mechanism and heterogeneous hypergraph. By constructing a heterogeneous high-order structure between students, courses and teachers, and combining graph convolution with dual attention mechanism, it can fully mine multimodal high-order structural information and improve the personalization and accuracy of the recommendation effect. The present invention takes heterogeneous hypergraph as the core of structural modeling, introduces attention mechanism and sorting optimization goals, and integrates sequence interest modeling and structural relationship perception to construct an efficient, scalable and strongly generalized online course personalized recommendation method, which is suitable for a variety of online learning scenarios and solves the problem of insufficient accuracy of existing technologies in modeling multimodal high-order relationships.

Claims

1. An online course recommendation method based on attention mechanism and heterogeneous hypergraph, characterized by: It includes the following steps: S1: Collect online education platform data and build a graph structure. Obtain users' historical online learning data, including the interaction between students, courses, and teachers. Build a heterogeneous hypergraph structure with students, courses, and teachers as nodes, and define five types of high-order heterogeneous relationships to obtain five types of heterogeneous hypergraphs. S2: Use heterogeneous hypergraph convolution operators to learn the embedding of vertices in five types of heterogeneous hypergraphs. By transferring information between hyperedges and vertices, feature fusion is performed to extract high-order nonlinear relationship representations and obtain heterogeneous hypergraph embedding features. S3: Introducing the attention mechanism to calculate the importance weight coefficients between vertices and hyperedges and the attention scores between hyperedges, and dynamically adjust the weight distribution during the node information aggregation process; S4: The heterogeneous hypergraph embedding features obtained in step S2 are fused with the user-course interaction sequence embedding features to form a comprehensive representation vector, namely, preference scoring and fusion modeling. The system fuses the structure-interest sequence behavior modeling representation to predict the user's preference score for the course; S5: Use the scoring function to predict the user's preference for the target course, build a model of the user behavior sequence, combine the sorting optimization objective function to train the model, and finally output personalized course recommendation results.

2. The online course recommendation method based on attention mechanism and heterogeneous hypergraph according to claim 1 is characterized in that: In step S1, the construction of the five types of heterogeneous hypergraphs includes: S1.1: A hypergraph constructed with students as hyperedges and courses as vertices, representing the set of courses selected by each student, and mining the similarity of learning paths between students; S1.2: A hypergraph constructed with courses as hyperedges and students as vertices, depicting the student groups attracted by the course and reflecting the learning behavior patterns of the course; S1.3: A hypergraph constructed with teachers as hyperedges and students as vertices, representing the set of students associated with the teacher, and modeling students' preference behavior towards teachers; S1.4: A hypergraph constructed with teachers as hyperedges and courses as vertices, representing the set of courses taught by a teacher and reflecting the relationship between teachers and courses; S1.5: A hypergraph constructed with "the set of students who have taken similar courses" as a hyperedge, building high-order connections between students with similar learning interests or paths; Each hypergraph is represented by an incidence matrix Indicates that: (1), in, For nodes, For the super edge, is the number of vertices, is the number of hyperedges.

3. The online course recommendation method based on attention mechanism and heterogeneous hypergraph according to claim 1 is characterized in that: In step S2, the heterogeneous hypergraph convolution operator is defined as: S2.11: Aggregate the features of the vertices connected by each hyperedge to generate a hyperedge embedding representation; S2.12: Propagate the hyperedge embedding back to the associated vertex through the connection matrix to enhance vertex features; S2.13: The entire convolution process includes normalization operations on the trainable weight matrix, vertex degree matrix, and hyperedge degree matrix, and further nonlinear mapping is achieved through activation functions; S2.14: Finally complete heterogeneous feature fusion across node types and high-order structures.

4. The online course recommendation method based on attention mechanism and heterogeneous hypergraph according to claim 1 is characterized in that: In step S2, the method of using the heterogeneous hypergraph convolution operator to embed the vertices in the five types of heterogeneous hypergraphs and perform feature fusion through information transmission between hyperedges and vertices is to apply the hypergraph convolution operator on each of the heterogeneous hypergraphs to realize the learning and aggregation of node embedding features. The convolution propagation formula is as follows: (2), in, Representative Vertex features of layer input, Representative The vertex features of the layer input, P represents the Hedi The trainable weight matrix of the layer, W represents the hyperedge mapping matrix, Represents an activation function, N represents the matrix of the degrees of the vertices in the hypergraph, S represents the matrix of the degrees of the hyperedges in the hypergraph, and H is an incidence matrix with the vertices of the hypergraph as rows and the hyperedges as columns. Conversely, if the message passing path from the vertex to the hyperedge is specified, the vertices should be regarded as columns and the hyperedges as rows.

5. The online course recommendation method based on attention mechanism and heterogeneous hypergraph according to claim 4 is characterized in that: In step S2, the steps of using the heterogeneous hypergraph convolution operator to embed the vertices in the five types of heterogeneous hypergraphs and perform feature fusion through information transfer between hyperedges and vertices are as follows: S2.21: Hypergraph convolution operation, constructing adjacency representation and initial features: For each type of heterogeneous hypergraph, extract its vertex-hyperedge connection relationship and generate a hypergraph association matrix , and calculate the node With super edge , and construct the node initial input features , is the pre-trained semantic vector; S2.22 Perform multi-layer hypergraph convolutional embedding propagation: Iterate the convolution operation according to the following formula: (2)。 6. The online course recommendation method based on attention mechanism and heterogeneous hypergraph according to claim 1 is characterized in that: In step S3, the attention mechanism includes: S3.1: Based on the attention mechanism of feature similarity between vertices and hyperedges, the aggregation weight of vertices in each hyperedge is dynamically assigned to distinguish the importance of nodes to different hyperedges. The calculation formula is: (3), in, For nodes The eigenvector of For super edge The eigenvector of , W1 and W2 are both linear transformation matrices acting on node features, It is an activation function that increases the small gradient in the negative half area; S3.2: Based on the similarity attention mechanism between hyperedges, cosine similarity is used to measure the structural or content relevance between hyperedges, guiding the model to focus on key course combinations. The calculation formula is: (4), Where h represents the embedding vector of the corresponding hyperedge; S3.3: The attention coefficient is calculated based on the transformed embedding representation, and softmax normalization is performed after linear projection to ensure stable training.

7. The online course recommendation method based on attention mechanism and heterogeneous hypergraph according to claim 1 is characterized in that: Step S4 includes: S4.1: Extract student behavior sequences, model them using a bidirectional long short-term memory network (Bi-LSTM), and output temporal preference representations to reflect the dynamic evolution of users’ interests. S4.2: Concatenate the attention and sequence and input them into the multi-layer perceptron (MLP) for nonlinear mapping to obtain the final user embedding , use the following scoring function to calculate the candidate course Preference score: (5), This score is used to generate the Top-K recommendation list.

8. The online course recommendation method based on attention mechanism and heterogeneous hypergraph according to claim 1 is characterized in that: In step S5, the method for predicting the user's preference for the target course using the scoring function includes the following steps: S5.11: Use the dot product between the student embedding vector and the course embedding vector as the scoring function, or use a multilayer perceptron (MLP) with hidden layers for nonlinear modeling. S5.12: The model optimization uses the Bayesian Personalized Ranking (BPR) ranking loss function to determine the maximum difference between the observed course preferences and the unobserved course ratings. The calculation formula is: (6), in, is the sigmoid function, represents the positive sample course, represents the negative sample class, are model parameters, is the regularization coefficient; S5.13: L2 regularization is introduced during training to prevent overfitting, and the optimizer uses Adam for gradient updates.

9. The online course recommendation method based on attention mechanism and heterogeneous hypergraph according to claim 1 is characterized in that: In step S5, the model for constructing the user behavior sequence uses a long short-term memory neural network (LSTM) or a gated recurrent unit (GRU) that extracts the learner's dynamic preferences, including the following steps: S5.21: Encode students’ course visit sequences in chronological order and embed them into a unified space; S5.22: Modeling sequential information using recurrent neural network architectures to learn time-dependent interest shifts and evolution patterns. S5.23: The sequence embedding output is jointly represented with the heterogeneous hypergraph embedding. The calculation formula is as follows: (7), in, For the moment Course input, Output hidden state for LSTM, is the Hadamard product, is the sigmoid function, 、 、 、 are the trainable weight matrices of four different gating units, b are the four corresponding bias items, Output of the forget gate, controlling the retention of old memories , Output of the input gate, controlling the acceptance of new information , Output gate output, controlling the current hidden state Output.

10. The online course recommendation method based on attention mechanism and heterogeneous hypergraph according to claim 1, characterized in that: In step S5, the final output personalized course recommendation results include the top K course results, and the following indicators are used to evaluate the recommendation performance: S5.31: Normalized Discounted Cumulative Gain (NDCG) measures the rationality of the ranking of high-accuracy courses in the recommendation list. Its calculation formula is: (8), in, represents the relevance score of the i-th item in the recommendation list; S5.32: Recall rate, which reflects the coverage ratio of relevant courses detected by the system to real relevant courses; S5.33: F1-Score, which comprehensively reflects the balance between recommendation precision and recall; S5.34: The above indicators are calculated based on the Top-K recommendation list, with K values ​​set to 5, 10, and 15.

Citation Information

Patent Citations

  • Knowledge concept recommendation method based on heterogeneous hypergraph

    CN117972217A

  • Course session recommendation method and device, equipment, storage medium and program product

    CN120013648A

  • Tag-aware recommendation method based on attention mechanism and hypergraph convolution

    WO2023098098A1