Course recommendation method and device, electronic equipment and storage medium
By constructing a target heterogeneous map and calculating the similarity between users and courses, and generating a course recommendation list, the problem of difficulty in selecting high conversion users in the existing technology is solved, and the efficiency and user experience of course recommendations are improved.
Patent Information
- Application Number
- CN202411564282.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-02-11
AI Technical Summary
It is difficult to select users with high conversion rates for existing course recommendation methods, and it is impossible to effectively utilize the relationship between courses and the relationship between users.
By constructing a target heterogeneous graph, identify the target object vector and course vector, calculate the similarity between the two, sort the courses to generate a recommendation list, and make course recommendations based on this list.
It improves the efficiency and effectiveness of course recommendations, enables the courses that the target object may purchase to be visually displayed, and avoids reducing the user experience due to excessive course recommendations.
Smart Images

Figure CN119417572A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of course recommendation, and in particular to a course recommendation method, device, electronic equipment and storage medium. Background Art
[0002] Nowadays, online teaching platforms are everywhere, allowing people to choose courses and study according to their personal interests.
[0003] However, there are many courses on online platforms nowadays, and there are many similar courses, which makes it difficult for users to choose courses when using them. Therefore, the course recommendation method came into being. However, the existing course recommendation methods often rely on the user's own historical purchase behavior and the characteristics of the purchased courses to make recommendations, which makes it difficult to select users with high conversion rates. Summary of the invention
[0004] The present invention provides a course recommendation method, device, electronic device and storage medium to solve the problem that it is difficult to select users with high conversion rates when recommending courses.
[0005] According to one aspect of the present invention, a course recommendation method is provided, the method comprising:
[0006] Determine a target object vector of the target object, the target object vector is used to represent the association relationship between the target object and each candidate object under at least one meta-path where the target object is located in the target heterogeneous graph, the meta-path is a path formed between each node in the target heterogeneous graph, the candidate object is an object that uses the course, the target object is a candidate object that needs to be recommended for a course, and the target heterogeneous graph is a heterogeneous graph with each candidate object and each course as nodes, and connected by the use relationship between the candidate object and the course;
[0007] Determine the similarity between the target object vector and the course vectors of each predetermined course to obtain at least one object course similarity, where the course vector is used to represent the association relationship between the course and each course other than the course under at least one meta-path where the course is located in the target heterogeneous graph;
[0008] Sort the courses according to at least one object course similarity to obtain a course recommendation list;
[0009] Based on the course recommendation list, recommend courses to target objects.
[0010] According to another aspect of the present invention, a course recommendation device is provided, the device comprising:
[0011] A target vector determination module is used to determine a target object vector of a target object. The target object vector is used to represent the association relationship between the target object and each candidate object under at least one meta-path where the target object is located in the target heterogeneous graph. The meta-path is a path formed between each node in the target heterogeneous graph. The candidate object is an object that uses the course. The target object is a candidate object that needs to be recommended for a course. The target heterogeneous graph is a heterogeneous graph with each candidate object and each course as nodes and connected by the use relationship between the candidate object and the course.
[0012] A similarity determination module is used to determine the similarity between the target object vector and the course vectors of each predetermined course to obtain at least one object course similarity, wherein the course vector is used to represent the association relationship between the course and each course other than the course under at least one meta-path where the course is located in the target heterogeneous graph;
[0013] A course list generation module, used to sort the courses according to at least one object course similarity to obtain a course recommendation list;
[0014] The course recommendation module is used to recommend courses to target objects based on the course recommendation list.
[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0016] at least one processor; and
[0017] a memory communicatively connected to at least one processor; wherein,
[0018] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by at least one processor so that the at least one processor can execute the course recommendation method of any embodiment of the present invention.
[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the course recommendation method of any embodiment of the present invention when executed.
[0020] The technical solution of the embodiment of the present invention is to determine the target object vector of the target object; determine the similarity between the target object vector and the course vectors of each predetermined course to obtain at least one object course similarity; sort each course according to the at least one object course similarity to obtain a course recommendation list; finally, based on the course recommendation list, recommend courses to the target object, thereby making an intuitive display of the courses that the target object may purchase, and subsequently directly using the course recommendation list to recommend courses to the target object, thereby improving the effect of each course recommendation and avoiding reducing the target object's usage experience due to excessive course recommendations.
[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 is a flow chart of a course recommendation method provided according to Embodiment 1 of the present invention;
[0024] Figure 2 is a flow chart of another course recommendation method provided according to the second embodiment of the present invention;
[0025] Figure 3 is a structural diagram of a course recommendation device provided according to Embodiment 3 of the present invention;
[0026] Figure 4 It is a structural schematic diagram of an electronic device for implementing the course recommendation method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Embodiment 1
[0030] Figure 1 A flowchart of a course recommendation method is provided for the first embodiment of the present invention. This embodiment is applicable to the case of course recommendation. The method can be executed by a course recommendation device. The course recommendation device can be implemented in the form of hardware and / or software. The course recommendation device can be configured in an electronic device with data processing capabilities. Figure 1 As shown, the method includes:
[0031] S110. Determine the target object vector of the target object. The target object vector is used to represent the association relationship between the target object and each candidate object under at least one meta-path where the target object is located in the target heterogeneous graph. The meta-path is a path formed between each node in the target heterogeneous graph. The candidate object is an object that uses the course. The target object is a candidate object that needs to be recommended for a course. The target heterogeneous graph is a heterogeneous graph with each candidate object and each course as nodes and connected by the usage relationship between the candidate object and the course.
[0032] The target object may be a candidate object for which a course recommendation is required. The target heterogeneous graph is a heterogeneous graph with candidate objects and courses as nodes, and with candidate objects and courses of candidate objects as connection relationships. The meta-path is a path formed between nodes in the target heterogeneous graph. The target object vector is used to represent the association relationship between the target object and each candidate object in the meta-path under at least one meta-path where the target object is located in the target heterogeneous graph.
[0033] When recommending courses to the target object, previous course recommendations often utilized the courses that the target object already had and found the commonalities among these existing courses. For example, if the courses that the target object had were all programming-related courses, programming would be used as a label. When recommending courses to the target object in the future, courses containing the programming label would be given priority.
[0034] However, previous course recommendation methods rely too much on the target object's previous courses, and do not consider the relationship between courses, as well as the relationship between the target object and other candidate objects.
[0035] This application uses expert knowledge and previous work experience to establish a target heterogeneous graph for each candidate object and each course, and thereby determine a homogeneous graph between the candidate objects and a homogeneous graph between the courses. Based on the homogeneous graph, the association between the candidate objects and the candidate objects, as well as the association between the courses and the courses are determined, and in subsequent recommendations, the association between the candidate objects and the candidate objects, as well as the association between the courses and the courses are used, thereby improving the recommendation efficiency of course recommendations. For this purpose, this application needs to first determine the target object vector of the target object, and the target object vector of the target object is determined in advance to determine the result.
[0036] Optionally, before determining the course vector for each course, the following steps may also be included:
[0037] A random initialization vector is performed on each candidate object and each course to obtain an initialization object vector for each candidate object and an initialization course vector corresponding to each course.
[0038] Since the vectors corresponding to each candidate object and each course may not be directly and accurately assigned, this application performs random vectorization processing for each candidate object and each course through random initialization, so that each candidate object has an initialized object vector and each course has an initialized course vector.
[0039] In an optional solution, before determining the target object vector of the target object, steps A1-A4 may be included:
[0040] Step A1: Determine an object homogeneous graph from the target heterogeneous graph, where the object homogeneous graph is a homogeneous graph with candidate objects as nodes and connection relationships between candidate objects.
[0041] Step A2: For each candidate object, determine each candidate object meta-path corresponding to the candidate object.
[0042] Step A3: according to each candidate object meta-path, aggregate the initialized object vectors of the neighboring nodes corresponding to the candidate object to obtain at least one candidate object fusion vector.
[0043] Step A4: concatenate at least one candidate object fusion vector and the initialization object vector corresponding to the candidate object, and map the concatenation result through a graph neural network to obtain a candidate object vector of the candidate object.
[0044] A homogeneous graph is one in which all nodes and edges are of the same type. In a homogeneous graph, nodes represent entities with the same properties, and edges represent a specific relationship between these entities.
[0045] After randomly initializing the representation vector for each candidate object, the initialization object vector of each candidate object needs to be adjusted.
[0046] In the target heterogeneous graph, the courses are removed, thus obtaining an object homogeneous graph that only retains candidate objects.
[0047] For example, when the target heterogeneous graph is candidate object a-course A-candidate object b, course A can be removed to obtain a homogeneous graph of candidate object a-candidate object b.
[0048] For each candidate object, it is necessary to determine each candidate object meta-path of the object, wherein the candidate object meta-path is a meta-path that includes the candidate object in the object homogeneity graph.
[0049] Take candidate object u as an example to determine, in candidate object u, the corresponding total k1 candidate object meta-paths are determined from the target object homogeneity graph
[0050] Correspondingly, the initialization object vector of the candidate objects under each meta-path is:
[0051]
[0052] The semantic aggregator aggregates the initialization object vectors of other candidate objects in the candidate object meta-path corresponding to the candidate object u to obtain at least one candidate object fusion vector. The specific formula is as follows:
[0053]
[0054] in, is a semantic aggregator, Φ U The candidate object meta-path representing the candidate object u; Represents other candidate objects in the candidate object meta-path, that is, given a candidate object u and its meta-path Φ U Based on this, other candidate objects can be obtained
[0055] This application uses an average pooling operation to improve the aggregation process, thereby improving the aggregation efficiency and reducing the time required for aggregation, as shown in the following formula;
[0056]
[0057] Among them, MeanPooling represents the average pooling operation.
[0058] After obtaining at least one candidate object fusion vector, considering that the characteristics of the node itself also need to be included in the representation of the node, it is necessary to merge the candidate object fusion vector of the candidate object The candidate object vector is concatenated with the initialization object vector of the candidate object to obtain an updated candidate object vector of the candidate object.
[0059] In an optional solution, after concatenating at least one candidate object fusion vector and the initialization object vector corresponding to the candidate object, and mapping the concatenation result through a graph neural network to obtain a candidate object vector of the candidate object, steps B1-B7 are also included:
[0060] Step B1: Determine the initial weight of each candidate object meta-path in each candidate object vector through the attention mechanism.
[0061] Step B2: randomly group the candidate object vectors to obtain at least one candidate object vector group.
[0062] Step B3: Determine the semantic level attention vector corresponding to each candidate object vector group.
[0063] Step B4: Fuse the semantic level attention vectors corresponding to each candidate object vector group to obtain a fused semantic level attention vector.
[0064] Step B5: Update the initial weight of each candidate object meta-path in each candidate object vector based on the fused semantic level attention vector and the candidate object vector of each candidate object, and normalize the updated result to obtain the weight of each candidate object meta-path in each candidate object vector.
[0065] Step B6: normalize the weight of each candidate object meta-path in each candidate object vector to obtain the normalized weight of each candidate object meta-path in each candidate object vector.
[0066] Step B7: updating the candidate object vector of each candidate object according to the normalized weight of each candidate object meta-path in each candidate object vector.
[0067] After obtaining the updated candidate object vector, the initial weights of different meta-paths corresponding to the candidate object will be determined through the semantic level attention mechanism.
[0068] As shown below:
[0069]
[0070] In the formula, attsem Represents the semantic level attention mechanism; Represents the initial weight of each meta-path.
[0071] However, determining the weight of each meta-path only through the attention mechanism may lead to certain errors in the results. In this regard, each candidate object vector will be randomly grouped to obtain at least one candidate object vector group.
[0072] For each candidate object vector group, a semantic level attention vector needs to be determined, and the semantic level attention vectors corresponding to each candidate object vector group are fused to obtain a fused semantic level attention vector.
[0073] Then, with the help of the fused semantic level attention vector and the candidate object vectors of each candidate object, the initial weights of each candidate object meta-path in each candidate object vector are updated, and the updated results are normalized to obtain the weights of each candidate object meta-path in each candidate object vector. As shown in the following formula:
[0074]
[0075] U represents the set of candidate objects; q represents the fused semantic level attention vector; W represents the weight matrix; and b represents the bias vector.
[0076] Since the sum of the weights corresponding to the meta-paths corresponding to the same candidate object should be 1, the obtained weights need to be normalized to obtain the normalized weights of each candidate object meta-path in each candidate object vector.
[0077] After the normalized weights are obtained, the candidate object vectors of each candidate object may be updated by calling the normalized weights.
[0078] S120. Determine the similarity between the target object vector and the course vectors of each predetermined course to obtain at least one object course similarity. The course vector is used to represent the association relationship between the course and each course other than the course under at least one meta-path where the course is located in the target heterogeneous graph.
[0079] Since each candidate object and each course are located in the same heterogeneous graph, and the candidate object vector of the candidate object and the course vector of each course are updated through samples during the training process, the similarity between the candidate object vector of the candidate object and the course vector of each course can show the degree of relevance of the candidate object to the course. The higher the degree of relevance, the more likely the candidate object is to purchase the course.
[0080] Therefore, the similarity between the target object vector and the course vector of each course is determined, and the degree of similarity between the target object vector and the course vector of each course is judged, thereby obtaining at least one object course similarity.
[0081] In an optional solution, the process of determining the course vector of each course may include C1-C4:
[0082] Step C1: Determine a course homogeneous graph from the target heterogeneous graph. The course homogeneous graph is a homogeneous graph with courses as nodes and connections between courses.
[0083] Step C2: For each course, determine each course meta-path corresponding to the course.
[0084] Step C3: According to each course meta-path, the initialized course vectors of other courses corresponding to the course are aggregated to obtain at least one course fusion vector.
[0085] Step C4: concatenate at least one course fusion vector and the initialized course vector corresponding to the course, and map the concatenation result through a graph neural network to obtain a course vector for the course.
[0086] The operation is the same as that of determining the candidate object vector of the candidate object, and will not be elaborated in this application.
[0087] In an optional solution, after splicing at least one course fusion vector and the initialization course vector corresponding to the course, and mapping the splicing result through a graph neural network to obtain the course vector of the course, steps D1-D7 are also included:
[0088] Step D1: Determine the initial weight of each course meta-path in each course vector through the attention mechanism.
[0089] Step D2: randomly group each course vector to obtain at least one course vector group.
[0090] Step D3: Determine the semantic level attention vector corresponding to each course vector group.
[0091] Step D4: Fuse the semantic level attention vectors corresponding to each course vector group to obtain a fused semantic level attention vector.
[0092] Step D5: Update the initial weight of each course meta-path in each course vector based on the fused semantic level attention vector and the course vector of each course, and normalize the updated result to obtain the weight of each course meta-path in each course vector.
[0093] Step D6: normalize the weight of each course meta-path in each course vector to obtain the normalized weight of each course meta-path in each course vector.
[0094] Step D7: Update the course vector of each course according to the normalized weight of each course meta-path in each course vector.
[0095] The updating process of the course vector is the same as the updating process of the candidate object vector of the candidate object, and will not be described in detail in this application.
[0096] S130. Sort the courses according to at least one object course similarity to obtain a course recommendation list.
[0097] S140. Recommend courses to the target object based on the course recommendation list.
[0098] After obtaining at least one object course similarity, each course will be sorted from large to small according to the size of its corresponding object course similarity, so as to obtain a course recommendation list.
[0099] By sorting each course according to at least one object course similarity, a course recommendation list is obtained, thereby making an intuitive display of the courses that the target object may purchase, and subsequently directly using the course recommendation list to recommend courses to the target object, thereby improving the effect of each course recommendation and avoiding reducing the target object's usage experience due to inappropriate course recommendations.
[0100] According to the technical solution of the embodiment of the present invention, the target object vector of the target object is determined; the similarity between the target object vector and the course vectors of each predetermined course is determined to obtain at least one object-course similarity; the courses are sorted according to the at least one object-course similarity to obtain a course recommendation list; finally, based on the course recommendation list, courses are recommended to the target object, so that the courses that the target object may purchase can be intuitively displayed, and the course recommendation list is directly used to recommend courses to the target object in the future, thereby improving the effect of each course recommendation and avoiding reducing the target object's usage experience due to excessive course recommendations.
[0101] Embodiment 2
[0102] Figure 2 The present invention provides a flowchart of another course recommendation method. Based on the above embodiment, this embodiment further optimizes the process of determining the similarity between the target object vector and the course vectors of each predetermined course in the above embodiment to obtain at least one object course similarity. This embodiment can be combined with various optional solutions in one or more of the above embodiments. Figure 2As shown, the course recommendation method of this embodiment may include the following steps:
[0103] S210: Determine a target object vector of the target object.
[0104] S220, transposing the target object vector, and performing inner product processing with the course vectors of each course after the transposition, to obtain at least one object course similarity.
[0105] When determining the similarity of the object course, a qualitative determination method is required. Since the target object vector and the course vector are constructed in the same way and are both represented by vectors, we can consider transposing the target object vector and performing inner product processing with the course vectors of each course after transposition to obtain the object course similarity between 0 and 1.
[0106] The closer the object-course similarity is to 1, the closer the target object vector is to the course vector of the course.
[0107] By transposing the target object vector and performing inner product processing with the course vector of each course after transposition, at least one object course similarity is obtained, so that the object course similarity can be qualitatively determined, thereby ensuring the accuracy of the determination result.
[0108] S230. Sort the courses according to at least one object course similarity to obtain a course recommendation list.
[0109] S240: Recommend courses to the target object based on the course recommendation list.
[0110] According to the technical solution of the embodiment of the present invention, by transposing the target object vector and performing inner product processing with the course vector of each course after the transposition, at least one object course similarity is obtained, so that the object course similarity can be qualitatively determined, thereby ensuring the accuracy of the determination result.
[0111] Embodiment 3
[0112] Figure 3 The present invention provides a structural block diagram of a course recommendation device, which is applicable to the case of course recommendation. The course recommendation device can be implemented in the form of hardware and / or software, and can be configured in an electronic device with data processing capabilities. Figure 3 As shown, the course recommendation device of this embodiment may include: a target vector determination module 310, a similarity determination module 320, a course list generation module 330 and a course recommendation module 340. Among them:
[0113] The target vector determination module 310 is used to determine the target object vector of the target object. The target object vector is used to represent the association relationship between the target object and each candidate object under at least one meta-path where the target object is located in the target heterogeneous graph. The meta-path is a path formed between each node in the target heterogeneous graph. The candidate object is an object that uses the course. The target object is a candidate object that needs to be recommended for a course. The target heterogeneous graph is a heterogeneous graph with each candidate object and each course as nodes and connected by the use relationship between the candidate object and the course.
[0114] A similarity determination module 320 is used to determine the similarity between the target object vector and the course vectors of each predetermined course to obtain at least one object course similarity, wherein the course vector is used to represent the association relationship between the course and each course other than the course under at least one meta-path where the course is located in the target heterogeneous graph;
[0115] A course list generating module 330 is used to sort the courses according to at least one object course similarity to obtain a course recommendation list;
[0116] The course recommendation module 340 is used to recommend courses to the target object based on the course recommendation list.
[0117] Based on the above embodiment, optionally, before the target vector determination module 310, the following further includes:
[0118] A random initialization vector is performed on each candidate object and each course to obtain an initialization object vector for each candidate object and an initialization course vector corresponding to each course.
[0119] Based on the above embodiment, optionally, the process of determining the course vector of each course includes:
[0120] From the target heterogeneous graph, determine the course homogeneous graph, which is a homogeneous graph with courses as nodes and connections between courses;
[0121] For each course, determine the course meta-paths corresponding to the course;
[0122] According to each course meta-path, aggregate the initialized course vectors of other courses corresponding to the course to obtain at least one course fusion vector;
[0123] At least one course fusion vector and the initialization course vector corresponding to the course are concatenated, and the concatenation result is mapped through a graph neural network to obtain a course vector for the course.
[0124] Based on the above embodiment, optionally, after splicing at least one course fusion vector and the initialization course vector corresponding to the course, and mapping the splicing result through a graph neural network to obtain the course vector of the course, the method further includes:
[0125] Determine the initial weight of each course meta-path in each course vector through the attention mechanism;
[0126] Randomly grouping the course vectors to obtain at least one course vector group;
[0127] Determine the semantic level attention vector corresponding to each course vector group;
[0128] The semantic level attention vectors corresponding to each course vector group are fused to obtain a fused semantic level attention vector;
[0129] According to the fusion semantic level attention vector and the course vector of each course, the initial weight of each course meta-path in each course vector is updated, and the updated result is normalized to obtain the weight of each course meta-path in each course vector;
[0130] Normalizing the weight of each course meta-path in each course vector to obtain the normalized weight of each course meta-path in each course vector;
[0131] The course vector of each course is updated according to the normalized weight of each course meta-path in each course vector.
[0132] Based on the above embodiment, optionally, before determining the target object vector of the target object, the method further includes:
[0133] From the target heterogeneous graph, determine an object homogeneous graph, where the object homogeneous graph is a homogeneous graph with candidate objects as nodes and connection relationships between candidate objects;
[0134] For each candidate object, determine each candidate object meta-path corresponding to the candidate object;
[0135] According to each candidate object meta-path, the initialized object vectors of the neighboring nodes corresponding to the candidate object are aggregated to obtain at least one candidate object fusion vector;
[0136] At least one candidate object fusion vector and the initialization object vector corresponding to the candidate object are concatenated, and the concatenation result is mapped through a graph neural network to obtain a candidate object vector of the candidate object.
[0137] Based on the above embodiment, optionally, after splicing at least one candidate object fusion vector and the initialization object vector corresponding to the candidate object, and mapping the splicing result through a graph neural network to obtain a candidate object vector of the candidate object, the method further includes:
[0138] Determine the initial weight of each candidate object meta-path in each candidate object vector through the attention mechanism;
[0139] Randomly grouping the candidate object vectors to obtain at least one candidate object vector group;
[0140] Determine the semantic level attention vector corresponding to each candidate object vector group;
[0141] The semantic level attention vectors corresponding to each candidate object vector group are fused to obtain a fused semantic level attention vector;
[0142] According to the fused semantic level attention vector and the candidate object vectors of each candidate object, the initial weight of each candidate object meta-path in each candidate object vector is updated, and the updated result is normalized to obtain the weight of each candidate object meta-path in each candidate object vector;
[0143] Normalizing the weight of each candidate object meta-path in each candidate object vector to obtain the normalized weight of each candidate object meta-path in each candidate object vector;
[0144] The candidate object vector of each candidate object is updated according to the normalized weight of each candidate object meta-path in each candidate object vector.
[0145] Based on the above embodiment, optionally, the similarity determination module 320 includes:
[0146] The target object vector is transposed, and after the transposition, inner product processing is performed with the course vectors of each course to obtain at least one object course similarity.
[0147] The course recommendation device provided in the embodiment of the present invention can execute the course recommendation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0148] Embodiment 4
[0149] Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0150] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0151] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0152] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the course recommendation method.
[0153] In some embodiments, the course recommendation method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the course recommendation method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the course recommendation method in any other appropriate manner (e.g., by means of firmware).
[0154] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0155] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0156] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0157] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0158] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0159] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0160] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0161] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A course recommendation method, characterized in that: include: Determine a target object vector of the target object, wherein the target object vector is used to represent the association relationship between the target object and each candidate object under at least one meta-path where the target object is located in the target heterogeneous graph, the meta-path is a path formed between each node in the target heterogeneous graph, the candidate object is an object that uses the course, the target object is a candidate object that needs to be recommended for a course, and the target heterogeneous graph is a heterogeneous graph with each candidate object and each course as nodes, and connected by the use relationship between the candidate object and the course; Determine the similarity between the target object vector and the course vectors of each predetermined course to obtain at least one object course similarity, wherein the course vector is used to represent the association relationship between the course and each course other than the course under at least one meta-path where the course is located in the target heterogeneous graph; Sort the courses according to at least one object course similarity to obtain a course recommendation list; Based on the course recommendation list, courses are recommended to the target object.
2. The method according to claim 1, characterized in that Before determining the target object vector of the target object, it also includes: A random initialization vector is performed on each candidate object and each course to obtain an initialization object vector for each candidate object and an initialization course vector corresponding to each course.
3. The method according to claim 2, characterized in that The process of determining the course vector for each course includes: Determine a course homogeneous graph from the target heterogeneous graph, wherein the course homogeneous graph is a homogeneous graph with courses as nodes and connections between courses; For each course, determine the course meta-paths corresponding to the course; According to each course meta-path, aggregate the initialized course vectors of other courses corresponding to the course to obtain at least one course fusion vector; At least one course fusion vector and the initialization course vector corresponding to the course are concatenated, and the concatenation result is mapped through a graph neural network to obtain a course vector for the course.
4. The method according to claim 3, characterized in that After concatenating at least one course fusion vector and the initialization course vector corresponding to the course, and mapping the concatenation result through a graph neural network to obtain the course vector of the course, the method further includes: Determine the initial weight of each course meta-path in each course vector through the attention mechanism; Randomly grouping the course vectors to obtain at least one course vector group; Determine the semantic level attention vector corresponding to each course vector group; The semantic level attention vectors corresponding to each course vector group are fused to obtain a fused semantic level attention vector; According to the fusion semantic level attention vector and the course vector of each course, the initial weight of each course meta-path in each course vector is updated, and the updated result is normalized to obtain the weight of each course meta-path in each course vector; Normalizing the weight of each course meta-path in each course vector to obtain the normalized weight of each course meta-path in each course vector; The course vector of each course is updated according to the normalized weight of each course meta-path in each course vector.
5. The method according to claim 2, characterized in that: Before determining the target object vector of the target object, it also includes: Determine an object homogeneous graph from the target heterogeneous graph, wherein the object homogeneous graph is a homogeneous graph with candidate objects as nodes and connection relationships between candidate objects; For each candidate object, determine each candidate object meta-path corresponding to the candidate object; According to each candidate object meta-path, the initialized object vectors of the neighboring nodes corresponding to the candidate object are aggregated to obtain at least one candidate object fusion vector; At least one candidate object fusion vector and the initialization object vector corresponding to the candidate object are concatenated, and the concatenation result is mapped through a graph neural network to obtain a candidate object vector of the candidate object.
6. The method according to claim 5, characterized in that After concatenating at least one candidate object fusion vector and the initialization object vector corresponding to the candidate object, and mapping the concatenation result through a graph neural network to obtain a candidate object vector of the candidate object, the method further includes: Determine the initial weight of each candidate object meta-path in each candidate object vector through the attention mechanism; Randomly grouping the candidate object vectors to obtain at least one candidate object vector group; Determine the semantic level attention vector corresponding to each candidate object vector group; The semantic level attention vectors corresponding to each candidate object vector group are fused to obtain a fused semantic level attention vector; According to the fused semantic level attention vector and the candidate object vectors of each candidate object, the initial weight of each candidate object meta-path in each candidate object vector is updated, and the updated result is normalized to obtain the weight of each candidate object meta-path in each candidate object vector; Normalizing the weight of each candidate object meta-path in each candidate object vector to obtain the normalized weight of each candidate object meta-path in each candidate object vector; The candidate object vector of each candidate object is updated according to the normalized weight of each candidate object meta-path in each candidate object vector.
7. The method according to claim 1, characterized in that Determining the similarity between the target object vector and the course vectors of each predetermined course to obtain at least one object course similarity includes: The target object vector is transposed, and after the transposition, inner product processing is performed with the course vectors of each course to obtain at least one object course similarity.
8. A course recommendation device, characterized in that: include: A target vector determination module is used to determine a target object vector of a target object, wherein the target object vector is used to represent an association relationship between the target object and each candidate object under at least one meta-path where the target object is located in a target heterogeneous graph, wherein a meta-path is a path formed between each node in the target heterogeneous graph, wherein the candidate object is an object that uses a course, wherein the target object is a candidate object that needs to be recommended for a course, and wherein the target heterogeneous graph is a heterogeneous graph with each candidate object and each course as nodes and connected by a usage relationship between the candidate object and the course; A similarity determination module is used to determine the similarity between the target object vector and the course vectors of each predetermined course to obtain at least one object course similarity, wherein the course vector is used to represent the association relationship between the course and each course other than the course under at least one meta-path where the course is located in the target heterogeneous graph; A course list generation module, used to sort the courses according to at least one object course similarity to obtain a course recommendation list; The course recommendation module is used to recommend courses to the target object based on the course recommendation list.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the course recommendation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the course recommendation method according to any one of claims 1 to 7 when executed.