A course recommendation method based on fine-grained interaction and knowledge graph
By constructing a knowledge graph to collect user interaction behavior with courses and obtain user interaction information with videos, a personalized course recommendation list is generated. This solves the problem of reduced recommendation performance caused by ignoring user interaction with videos in existing technologies, and achieves more accurate course recommendations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2026-03-20
AI Technical Summary
Existing course recommendation systems ignore user interaction information with videos, making it difficult to distinguish user interaction preferences with courses and affecting recommendation performance.
By constructing a knowledge graph, we can collect user interaction behavior with courses, obtain user interaction information with videos, and use fine-grained interaction and semantic information from the knowledge graph to generate a personalized course recommendation list, distinguishing between users and videos.
The performance of course recommendations has been improved, enabling them to more accurately reflect users' detailed preferences for courses and enhance the effectiveness of the recommendation system.
Smart Images

Figure CN119941464B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of course recommendation, and particularly relates to a course recommendation method based on fine-grained interaction and a knowledge graph. BACKGROUND
[0002] In recent years, with the rapid development of information technology, the education field has also changed, and online education has developed. With the development of online education and the accumulation of course data, the problem of information overload is inevitable. The recommendation system can effectively alleviate the problem of information overload, so the course recommendation system emerges as the times require. The knowledge graph contains rich semantic information and can provide rich additional information for the recommendation system, thereby improving the performance of the recommendation system, and is widely used in various recommendation systems.
[0003] The previous course recommendation system mostly only considers the interaction between the user and the course, ignoring the interaction between the user and the video belonging to the course, thereby limiting the performance of the course recommendation system. The existing course recommendation system based on the knowledge graph mostly only considers the interaction between the user and the course to recommend courses to the user, ignoring the interaction between the user and the video. For example, different users interact with different videos of the same course, which represents the different detailed contents of the user's attention to the course. If the interaction between the user and the video is ignored, the preferences of these users who interact with the same course will be considered similar at the level of the user and the course, but in fact they are different, thereby causing performance damage. SUMMARY
[0004] The present application aims to provide a course recommendation method based on fine-grained interaction and a knowledge graph. Based on fine-grained interaction and a knowledge graph, the recommendation algorithm is provided with additional information by means of the rich semantic information of the knowledge graph. The interaction information between the user and the video is supplemented into the interaction information between the user and the course by using the collaborative course set to supplement the collaborative information for the course, thereby improving the recommendation performance.
[0005] The specific technical solution is as follows: a course recommendation method based on fine-grained interaction and a knowledge graph, comprising the following steps:
[0006] Step 1: collect the interaction behavior of the user on the education platform to obtain the learning record of the user;
[0007] Preferably, the learning record of the user is the registration record of the user for the course and the video watching record of the user for the registered course; the courses on the education platform are counted to obtain a course set C={c1, c2, …, c i ,……,c M}, a total of M courses; the videos on the education platform are counted to obtain a video set V={v1, v2, …, v P}, and there are P videos in total; count the users on the education platform to obtain a user set U = {u1, u2, …, u i , …, u N}, and there are N users in total;
[0008] For a user u, u e U, the course registration set of the user u is That is, the user u has registered L u courses in total, and for a registered course c u,i , the video set watched by the user u is , which is expressed as: That is, the user u has watched videos belonging to the course c u,i in total; obtain the interaction matrix Y of the user and the course The elements of the interaction matrix Y are 0 or 1, and the element in the matrix is 1, which means that the user u has interacted with the course c i , and vice versa, if it is 0, it means that there is no interaction.
[0009] Step 2: Collect course data on the education platform to build a knowledge graph G containing schools, teachers, course names, course videos, and course knowledge points;
[0010] Preferably, the knowledge graph G is expressed as:
[0011] G = {(h, r, t) | h e E, r e R, t e E}
[0012] Wherein, h represents the head entity, r represents the relationship between the head entity and the tail entity, t represents the tail entity, E represents the entity set in the knowledge graph, R represents the relationship set in the knowledge graph, and (h, r, t) represents a triple; wherein the head entity and the tail entity both include schools, teachers, course names, course videos, and course knowledge points.
[0013] Step 3: Use the knowledge graph G to obtain the knowledge unit network of the course, analyze the learning records of the user, and obtain the collaborative knowledge unit network set of the user and the course, respectively;
[0014] Preferably, the method of obtaining the collaborative knowledge unit network set of the user and the course, respectively, further comprises the following steps:
[0015] Step 3-1: Align the courses in the course set with the course name entities in the knowledge graph, and align the videos in the video set with the course video entities in the knowledge graph;
[0016] Step 3-2: Obtain the knowledge unit network of the course in the knowledge graph;
[0017] Step 3-3: Obtain Course C i A collection of collaborative courses;
[0018] Steps 3-4: Obtain course c i A collection of collaborative knowledge unit networks;
[0019] Steps 3-5: Obtain the user's collaborative knowledge unit network set.
[0020] Step 4: Extract users' general and detailed preferences for courses, and generate a personalized course recommendation list based on these two preferences.
[0021] Preferably, the method for generating a personalized course recommendation list based on two preferences specifically includes the following steps:
[0022] Step 4-1: Obtain the overall core course content for both users and courses;
[0023] Step 4-2: Obtain the user's overall core video content;
[0024] Step 4-3: Obtain the final representations of users and courses respectively;
[0025] Step 4-4: Based on the final representation of user u u and candidate courses c i The final representation of o ci Calculate scores and recommend the top N courses to users in descending order of scores.
[0026] Compared with the prior art, the beneficial effects achieved by the present invention are as follows: The course recommendation method of the present invention is based on fine-grained interaction and knowledge graph. With the help of the rich semantic information of the knowledge graph, additional information is provided to the recommendation algorithm. Collaborative course sets are used to supplement the collaborative information of courses. The interaction information between users and videos is added to the interaction information between users and courses, so as to distinguish the differences between users who have interacted with different videos of the same course, thereby improving the recommendation performance. Attached Figure Description
[0027] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0028] In the attached diagram:
[0029] Fig. 1 The flowchart illustrates the steps of the course recommendation method based on fine-grained interaction and knowledge graph provided in this embodiment of the invention.
[0030] Fig. 2 A schematic diagram of the constructed knowledge graph provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0031] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0032] In combination with Figs. 1-2 , the present application provides a technical solution: a course recommendation method based on fine-grained interaction and a knowledge graph, specifically comprising:
[0033] Step 1: Obtain the learning record of a user by collecting the interaction behavior of the user on an education platform;
[0034] In this embodiment, the learning record of the user is the registration record of the user for a course and the video watching record of the user for the registered course; the courses on the education platform are counted to obtain a course set C={c1, c2, …, c i , …, c M}, a total of M courses; the videos on the education platform are counted to obtain a video set V={v1, v2, …, v P}, a total of P videos; the users on the education platform are counted to obtain a user set U={u1, u2, …, u i , …, u N}, a total of N users; for a user u, u∈U, the course registration set of the user u is that is, the user u has registered a total of L u courses, and for the registered course c u,i , the video set watched by the user is , which is expressed as: that is, the user u has watched a total of videos belonging to the course c u,i ; the interaction matrix of the user and the course can be obtained The element of the interaction matrix Y is valued as 0 or 1, and the element y uci in the matrix is valued as 1, which means that the user u has interacted with the course c i , and vice versa, if it is 0, it means that there is no interaction;
[0035] Step 2: Collect the course data on the education platform to construct a knowledge graph G containing a school, a teacher, a course name, a course video, and a course knowledge point;
[0036] In this embodiment, in combination with Fig. 2, the knowledge graph G is represented as:
[0037] G = {(h, r, t) | h E, r E, t E}
[0038] wherein, h represents a head entity, r represents a relationship between the head entity and a tail entity, t represents a tail entity, E represents a set of entities in the knowledge graph, R represents a set of relationships in the knowledge graph, and (h, r, t) represents a triple; wherein the head entity and the tail entity both include a school, a teacher, a course name, a course video, and a course knowledge point; in combination with Fig. 2 as shown, for example, (course name 1, contains, course video 1), wherein the course name 1 can be linear algebra, the relationship is contains, and the course video 1 can be introduction to determinant, and the meaning represented is that linear algebra (course name) contains (relationship) introduction to determinant (course video);
[0039] Exemplarily, in actual operation, the opposite relationship is represented separately, that is, the contained (relationship) in (course video 1, contained, course name 1) represents a different relationship from the above-mentioned contains (relationship), and a directed edge is used to distinguish in the constructed knowledge graph.
[0040] Step 3: obtaining a course knowledge unit network according to the knowledge graph, and analyzing the learning records of the user to obtain a user and course collaborative knowledge unit network set, respectively;
[0041] In this embodiment, the method of obtaining a user and course collaborative knowledge unit network set further comprises:
[0042] Step 3-1: aligning the courses {c1, c2, …, c i , …, c M} in the course set with the course name entities in the knowledge graph to obtain wherein, represents a course name entity; aligning the videos {v1, v2, …, v P} in the video set with the course video entities in the knowledge graph to obtain wherein, represents a course video entity;
[0043] Step 3-2: obtaining a knowledge unit network of the course in the knowledge graph;
[0044] Exemplarily, in the knowledge graph, all course name entities are initial entities; for the course c i , the entity thereof in the knowledge graph is obtaining the initial entity set of is represented as:
[0045]
[0046] And the entity directly connected to is a first-order entity, and the first-order entity set is obtained is expressed as:
[0047]
[0048] Further, the course name entity is defined as:
[0049]
[0050] Finally, the L-order entity set and the L-order triple set are respectively expressed as:
[0051]
[0052] Preferably, the L-order triple set of the course is referred to as the knowledge unit network of the course; the knowledge unit network of the course c i is As shown in Fig. 2 , taking the expansion to the 2-order triple set as an example, the course name 1 is the aligned entity of the course 1, and the first-order triple set T 课程名称1,1 of the course name 1 is {(course name 1, is taught by, teacher 1), (course name 1, is taught by, teacher 2), (course name 1, contains, course video 1), (course name 1, contains, course video 2)}; the second-order triple set T 课程名称1,2 of the course name 1 is {(teacher 1, is employed by, school 1), (teacher 2, is employed by, school 1), (course video 1, covers, course knowledge point 1), (course video 1, covers, course knowledge point 2), (course video 2, covers, course knowledge point 2)}; the knowledge unit network KUN 课程1 of the course 1 is {T 课程名称1,1 , T 课程名称1,2}.
[0053] Step 3-3: Obtain the collaborative course set of the course;
[0054] Exemplarily, for the course c i , the collaborative course set thereof is composed of courses interacted by users who have interacted with the course c i , and the collaborative course set of the course c is defined as:
[0055]
[0056] Where 'c' represents the course. It is the set of course registrations for user "u", where "u" is the number of courses that user "c" has interacted with. i The user set contains users, where u' is the user who has interacted with course c. i users, It is user u' and course c i The interaction record is set to 1 if an interaction has occurred, and 0 if no interaction has occurred.
[0057] Steps 3-4: Obtain the set of collaborative knowledge unit networks for the course;
[0058] For example, for course c i Its collaborative knowledge unit network set is defined as follows:
[0059]
[0060] Among them, KUN c This represents the knowledge unit network of course c.
[0061] Steps 3-5: Obtain the user's collaborative knowledge unit network set;
[0062] For example, for user u, through their set of course registrations Obtain its collaborative knowledge unit network set CS u,KUN CS u,KUN Further expressed as:
[0063]
[0064] in, This represents the knowledge unit network formed by user u based on their course registration set.
[0065] Step 4: Extract users' general and detailed preferences for courses, and generate a personalized course recommendation list based on these two preferences;
[0066] In this embodiment, generating a personalized course recommendation list based on two preferences further includes:
[0067] Step 4-1: Obtain the overall core course content for both users and courses;
[0068] For example, for user u, the core content of the courses they are interested in is obtained through the videos they have watched; the core content of the courses consists of two parts: the course content itself and video interactions; for the videos that user u has watched, belonging to course c... u,i video collection The courses that user u is interested in u,i Core content of the course The definition is as follows:
[0069]
[0070] where the course video entity is the video v j , the aligned entity in the knowledge graph, represents the embedding representation of the course video entity e vj , d is the dimension of the embedding, represents the trainable parameter, represents the video interaction part of the course core content extracted from the videos watched by the user u belonging to the course c u,i , the course name entity represents the course c u,i , the aligned entity in the knowledge graph, represents the embedding representation of the course name entity , is the course ontology part of the course core content, represents the trainable parameter, represents the matrix multiplication, represents the course core content of the course c u,i that the user u is interested in;
[0071] Specifically, for the user u, its overall course core content CCC u is defined as follows:
[0072]
[0073] where, σ is the sigmoid activation function, is the number of elements contained in the set ; the overall course core content CCC u of the user u can be regarded as its general preference;
[0074] Further, for the course c i , its overall course core content is defined as follows:
[0075]
[0076] where, the course name entity and are the aligned entities in the knowledge graph of the courses c i and c j , respectively, represent the course name entity c i and c j , respectively,, σ is sigmoid activation function, representing course c i representing the set of collaborative courses of course c representing the number of elements in the set of collaborative courses of course c representing trainable parameters, representing matrix multiplication; course c i representing the overall course core of course c can supplement the collaborative information of course c i .
[0077] Step 4-2: Obtain the overall video core of the user;
[0078] In this embodiment, for user u, its overall video core VCC u is defined as follows:
[0079]
[0080] wherein, the overall video core VCC u of user u can be regarded as its detailed preference under the general preference.
[0081] Step 4-3: Obtain the final representation of the user and the course respectively;
[0082] Exemplarily, for user u, the knowledge unit network of course c u,i that it has interacted with is the set of l-order triplets of course c u,i is the l-order response of course c u,i is defined as follows:
[0083]
[0084]
[0085] wherein, representing the number of elements in the set of triplets , and and are scalar weights, “·” represents the dot product operation of vectors, “· T ” represents the transpose operation, σ represents the sigmoid activation function, “·||·” represents the concatenation operation of vectors, represents the unit vector of the vector, represents matrix multiplication, is a trainable parameter, and “||·||2” represents the 2-norm of the vector;
[0086] Specifically, the course cu,i initial entity embedding of as its 0th-order response
[0087] i.e., aggregated course c u,i each-order response of is represented as:
[0088]
[0089] wherein,
[0090] Further, the collaborative knowledge unit network set CS u,KUN of the aggregated user u is obtained, and the final representation o u of the user u is obtained, and is represented as:
[0091]
[0092] wherein, |CS u,KUN | represents the number of elements in the knowledge unit network set CS u,KUN ;
[0093] Preferably, for the course c i , the process of obtaining the final representation of the course c i is roughly similar to that of obtaining the final representation of the user; the knowledge unit network of the course c i is The l-order triple set of the course c i is The l-order response of the course c i is defined as follows:
[0094]
[0095] wherein, the course name entity is the entity aligned in the knowledge graph of the course c i , represents the elements in the triple set , is a scalar weight, “·” represents the dot product operation of the vector, “· T ” represents the transpose operation, σ represents the sigmoid activation function, “·||·” represents the concatenation operation of the vector, represents the unit vector of the vector, represents matrix multiplication, is a trainable parameter, and ||·||2 represents the 2-norm of the vector;
[0096] i.e. the aggregation of courses c i is represented as:
[0097]
[0098] Exemplarily, the information aggregated after the aggregation of the cooperative knowledge unit network set of courses c i is taken as the supplementary information of courses c i ; the courses c i are finally represented as:
[0099]
[0100] Step 4-4: According to the final representation o u of the user u and the final representation o i of the candidate courses c ci , the scores are calculated, and the top N courses in descending order of the scores are recommended to the user;
[0101] Exemplarily, the score calculation formula is as follows:
[0102]
[0103] wherein, σ represents a sigmoid activation function, “·” represents a dot product operation of a vector, and “· T ” represents a transpose operation;
[0104] Specifically, the recommendation loss function is:
[0105]
[0106] wherein, BCE is a binary cross-entropy loss function, is a course set that has not been interacted with by the user u;
[0107] The knowledge graph loss function is
[0108]
[0109] wherein, “·” represents a dot product operation of a vector, and ||·||2 represents a 2-norm of a vector;
[0110] The overall loss function is
[0111] Loss = RecLoss + KGLoss.
[0112] i.e. the overall loss function composed of the recommendation loss function and the knowledge graph loss function is obtained.
[0113] It should be noted that the relationship terms, such as first and second, and the like, are used only to differentiate one entity or action from another, and do not necessarily require or imply any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus.
[0114] Finally, it should be noted that the above-described embodiments are merely possible implementations of the present application, but not to be taken to limit the present application. Although the present application has been described in detail with reference to the foregoing embodiments, the technical solutions recorded in the foregoing embodiments can still be modified by those skilled in the art, or some technical features thereof can be replaced by equivalent replacements. Any modifications, equivalent replacements, improvements, and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A course recommendation method based on fine-grained interaction and knowledge graph, characterized in that: The method includes the following steps: Step 1: Collect user interaction behavior on the education platform and obtain user learning records; Step 2: Collect course data from the education platform and construct a knowledge graph containing schools, teachers, course names, course videos, and course knowledge points. ; Step 3: Utilize the knowledge graph Obtain the knowledge unit network of the course, analyze the user's learning records, and obtain the collaborative knowledge unit network sets of the user and the course respectively; Step 4: Extract the user's general and detailed preferences for courses, and generate a personalized course recommendation list based on the two preferences. The user's general preferences for courses are the user's overall core course content, and the detailed preferences are the user's overall core video content. The method for generating a personalized course recommendation list based on two preferences includes the following steps: Step 4-1: Obtain the overall core course content for both users and courses; Step 4-2: Obtain the user's overall core video content; Step 4-3: Obtain the final representations of users and courses respectively; Step 4-4: Based on the user The final representation and candidate courses The final representation Calculate scores and recommend the top N courses to users in descending order of scores. In step 4-3, the final representations of users and courses are obtained as follows: For users The courses they interacted with Knowledge unit network is ,course of The set of triples of order is ,course of First-order response The definition is as follows: ; ; ; ; ; in, , Represents the set of triples The number of elements in and They are all scalar weights. " "Represents the dot product operation of vectors," "Represents the transpose operation, represent Activation function, "Represents the vector concatenation operation, The unit vector representing a vector. Represents matrix multiplication. For trainable parameters, " represents the 2-norm of a vector; Course Initial entity embedding As its 0th order response ; That is, aggregated courses The responses of each order are obtained , is represented as: ; in, ; Aggregator users Collaborative knowledge unit network set The information in the middle, obtained by the user Final characterization , is represented as: ; in, , Representative knowledge unit network set The number of elements in; For the course ,course Knowledge unit network is ,course of The set of triples of order is ,course of First-order response The definition is as follows: ; ; ; ; in, Course Name Entity For the course Entities aligned in the knowledge graph Represents the set of triples The elements in For scalar weights, " "Represents the dot product operation of vectors," "Represents the transpose operation, represent Activation function, "Represents the vector concatenation operation, The unit vector representing a vector. Represents matrix multiplication. For trainable parameters, The 2-norm of a vector; That is, aggregated courses The responses of each order are obtained , is represented as: ; Course Collaborative knowledge unit network set The information obtained after aggregating information is used as a course. Additional information; obtain course Final characterization , is represented as: ; 。 2. The course recommendation method based on fine-grained interaction and knowledge graph as described in claim 1, characterized in that: In step 1, the user's learning record includes the user's course registration record and the user's video viewing record for the registered courses; the courses on the education platform are statistically analyzed to obtain a course set. A total of Courses; analyze videos on educational platforms to obtain video collections. A total of One video; By analyzing the users on the education platform, we can obtain a user set. A total of Number of users; For users , Its course registration collection , That is, users Total registered Courses, for registered courses The collection of videos he has watched is , is represented as: That is, users Total Views Each course The video; obtaining the user and course interaction matrix. Interaction matrix The elements of the matrix take values of 0 or 1. A value of 1 represents the user Interactive Course Conversely, a value of 0 indicates that no interaction has occurred.
3. The course recommendation method based on fine-grained interaction and knowledge graph according to claim 2, characterized in that: The knowledge graph Represented as: ; in, Indicates the head entity. This indicates the relationship between the head entity and the tail entity. Indicates the tail entity. Represents a set of entities in a knowledge graph. Represents a set of relations in a knowledge graph. This represents a triple; the head entity and the tail entity both include school, teacher, course name, course video, and course knowledge points.
4. The course recommendation method based on fine-grained interaction and knowledge graph as described in claim 3, characterized in that: The method for obtaining the collaborative knowledge unit network set for users and courses respectively further includes: Step 3-1: Select courses from the course collection Aligning with the course name entity in the knowledge graph yields... , to collect videos from the video collection Align with the course video entities in the knowledge graph to obtain The The entity representing the course name, the stated Represents the physical entity of the course video; Step 3-2: Obtain the knowledge unit network of the course in the knowledge graph; Step 3-3: Obtain the course A collection of collaborative courses; Steps 3-4: Obtain the course A collection of collaborative knowledge unit networks; Steps 3-5: Obtain the user's collaborative knowledge unit network set.
5. The course recommendation method based on fine-grained interaction and knowledge graph according to claim 4, characterized in that: The method for obtaining the knowledge unit network of courses in the knowledge graph specifically involves: in the knowledge graph, all course name entities are initial entities; for courses... Its entity in the knowledge graph is ,get initial entity set , is represented as: ; and The directly connected entities are first-order entities, thus... First-order entity set , is represented as: ; Course Name Entity The set of first-order triples in a knowledge graph Defined as: ; Extended to Order Entity Set and Set of triples , respectively represented as: ; ; The set of triples at each level of a course is called the knowledge unit network of that course; course Knowledge unit network is .
6. The course recommendation method based on fine-grained interaction and knowledge graph according to claim 5, characterized in that: The sets in steps 3-3, 3-4, and 3-5 are respectively represented as follows: The course A collection of collaborative courses: consisting of courses that users who have interacted with this course have also interacted with. The collaborative course set is defined as , Represented as: ; in, It's a course. User A collection of course registrations. It is an interactive course Users in the user set It is an interactive course users, User and courses The interaction record is 1 if there has been an interaction, and 0 if there has been no interaction. The course The collaborative knowledge unit network set is defined as , Represented as: ; in, Indicates course Knowledge unit network; The user A collection of collaborative knowledge unit networks: for users Through its course registration collection The set of its collaborative knowledge unit networks is obtained. , Represented as: ; in, Indicates user A knowledge unit network formed based on its course registration set.
Citation Information
Patent Citations
Heterogeneous graph neural network course recommendation method and system based on attention mechanism
CN116662651A
Course recommendation method based on attention mechanism and knowledge graph
CN118469774A