Exercise recommendation method, device, electronic device and storage medium
By generating heterogeneous diagrams and predicting the correct probability of students completing exercises, the personalized problem of exercise recommendations in large-scale online question bank is solved, improving the accuracy and effectiveness of recommendations.
Patent Information
- Application Number
- CN202110277534.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-15
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2041-03-15
AI Technical Summary
The existing exercise recommendation methods are difficult to personalize the recommendation of large-scale online question banks, especially for exercises that have not been done by students, and it is impossible to accurately determine whether recommendations are needed.
By obtaining exercises and question making records, determine the correlation between exercises and the question making relationship between students and exercises, generate heterogeneous graphs, use heterogeneous graphs to determine the student vector of student nodes and the exercise vector of exercise nodes, predict the correct probability of students completing the exercises based on the student vector and exercise vector, and recommend exercises within the preset probability interval.
It realizes personalized exercise recommendations for large-scale question banks, improves the accuracy of exercise recommendations and the accuracy of correct probability prediction, and avoids the limitations of problem recording.
Smart Images

Figure CN115080724B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an exercise recommendation method, device, electronic device, and storage medium. Background Art
[0002] With the development of computer technology and the education industry, various online education software programs have emerged, allowing students to practice by using question banks within these programs. Compared to traditional offline question banks, online question banks offer the advantages of a large number of exercises and convenient, timely updates, providing students with higher-quality exercises. However, selecting exercises from these large online question banks and providing personalized recommendations to students has become a pressing issue.
[0003] The current exercise recommendation method used in online question banks mainly obtains students' exercise records and determines whether to recommend them to students by detecting the similarity between the exercises in the question bank and the exercises in the exercise records. Specifically, if the similarity is high, the exercises will not be recommended to the students. Otherwise, if the similarity is not high, the exercises will be recommended to the students.
[0004] However, the method of recommending exercises based on question-answering records is only applicable to situations where the question bank is relatively small. In the face of a large-scale online question bank, only a relatively small number of exercises have been done by students, and there are question-answering records. Exercise recommendations can be made based on the question-answering records. However, for the relatively large number of exercises that have not been done, it is impossible to determine whether they need to be recommended.
[0005] Therefore, the current exercise recommendation method has the problem of difficulty in making personalized recommendations for large-scale exercises. Summary of the Invention
[0006] Based on this, it is necessary to provide an exercise recommendation method, device, electronic device and storage medium to address the above technical problems.
[0007] In a first aspect, a method for recommending exercises is provided, the method comprising:
[0008] Get exercises and exercise records;
[0009] Determining the association relationship between the exercises, and obtaining the relationship between the student and the exercises based on the exercise record;
[0010] Generate a heterogeneous graph based on the association relationship and the problem-solving relationship, and determine the student vector of the student node and the problem vector of the problem node through the heterogeneous graph; the heterogeneous graph includes node relationship edges between nodes; the nodes include the student node and the problem node; the node relationship edges are used to record the association relationship and the problem-solving relationship;
[0011] Obtaining a correct probability of the student completing the exercise based on the student vector and the exercise vector;
[0012] If the correct probability is within a preset probability interval, the exercise is recommended to the student.
[0013] In another embodiment, determining the association relationship between the exercises includes:
[0014] Obtain the text vector of the exercise through the pre-trained language model;
[0015] Determining vector similarity between the text vectors;
[0016] If the vector similarity exceeds a preset similarity threshold, it is determined that the association relationship exists between the exercises.
[0017] In another embodiment, obtaining the relationship between the student and the exercise based on the exercise record includes:
[0018] Obtaining the student's answer status to the exercise according to the exercise record; the answer status includes correct answer, incorrect answer and no answer;
[0019] If the answer is correct, then determining that there is a problem-solving relationship between the student and the problem;
[0020] If the answering status is the incorrect answering or the non-answering, it is determined that there is no question-answering relationship between the student and the question.
[0021] In another embodiment, determining the student vector of the student node and the exercise vector of the exercise node through the heterogeneous graph includes:
[0022] Selecting a target node in the heterogeneous graph and obtaining neighbor nodes of the target node; the target node includes the student node and the exercise node;
[0023] Determining a correlation between the target node and the neighboring nodes, and obtaining a first weight according to the correlation;
[0024] Performing weighted summation on the neighbor node vectors according to the first weight to obtain a first vector of the target node;
[0025] Obtaining a second weight according to a type of a node relationship edge between the target node and the neighboring node;
[0026] The first vectors are weighted and summed according to the second weight to obtain a second vector of the target node; the second vector includes the student vector and the exercise vector.
[0027] In another embodiment, determining the degree of correlation between the target node and the neighboring nodes includes:
[0028] Get the target node vector and neighbor node vector;
[0029] By performing linear mapping on the target node vector and the neighbor node vector, a mapped target node vector and a mapped neighbor node vector are obtained; the mapped target node vector and the mapped neighbor node vector are in the same feature space;
[0030] The degree of correlation between the target node and the neighbor node is obtained according to the mapped target node vector and the mapped neighbor node vector.
[0031] In another embodiment, obtaining the correct probability of the student completing the exercise based on the student vector and the exercise vector includes:
[0032] Obtaining a target student node corresponding to a target student in the heterogeneous graph;
[0033] Determining candidate exercise nodes based on the target student node;
[0034] Obtaining a node similarity between the target student node and the candidate exercise node based on the student vector corresponding to the target student node and the exercise vector corresponding to the candidate exercise node;
[0035] By normalizing the node similarities, the correct probability of the target student completing the candidate exercises is obtained.
[0036] In another embodiment, determining a candidate exercise node based on the target student node includes:
[0037] Determining initial candidate exercise nodes from the exercise nodes in the heterogeneous graph according to the exercise identifier input by the target student;
[0038] Determine an exercise node that has a node relationship edge with the target student node as a first redundant node;
[0039] Determine the exercise node in the same cluster as the first redundant node as the second redundant node;
[0040] The candidate exercise node is obtained by removing the first redundant node and the second redundant node from the initial candidate exercise node.
[0041] In a second aspect, a device for recommending exercises is provided, the device comprising:
[0042] Acquisition module, used to obtain exercises and exercise records;
[0043] a relationship determination module, configured to determine the association relationship between the exercises, and obtain the relationship between the students and the exercises based on the exercise records;
[0044] a vector determination module, configured to generate a heterogeneous graph based on the association relationship and the problem-solving relationship, and determine a student vector of a student node and an exercise vector of an exercise node through the heterogeneous graph; the heterogeneous graph includes node relationship edges between nodes; the nodes include the student node and the exercise node; the node relationship edges are used to record the association relationship and the problem-solving relationship;
[0045] A correct probability calculation module, configured to obtain the correct probability of the student completing the exercise based on the student vector and the exercise vector;
[0046] The exercise recommendation module is configured to recommend the exercise to the student if the correct probability is within a preset probability interval.
[0047] In a third aspect, an electronic device is provided, comprising: a memory, one or more processors;
[0048] The memory is used to store one or more programs;
[0049] When the one or more programs are executed by the one or more processors, the one or more processors implement the following operations:
[0050] Get exercises and exercise records;
[0051] Determining the association relationship between the exercises, and obtaining the relationship between the student and the exercises based on the exercise record;
[0052] Generate a heterogeneous graph based on the association relationship and the problem-solving relationship, and determine the student vector of the student node and the problem vector of the problem node through the heterogeneous graph; the heterogeneous graph includes node relationship edges between nodes; the nodes include the student node and the problem node; the node relationship edges are used to record the association relationship and the problem-solving relationship;
[0053] Obtaining a correct probability of the student completing the exercise based on the student vector and the exercise vector;
[0054] If the correct probability is within a preset probability interval, the exercise is recommended to the student.
[0055] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0056] Get exercises and exercise records;
[0057] Determining the association relationship between the exercises, and obtaining the relationship between the student and the exercises based on the exercise record;
[0058] Generate a heterogeneous graph based on the association relationship and the problem-solving relationship, and determine the student vector of the student node and the problem vector of the problem node through the heterogeneous graph; the heterogeneous graph includes node relationship edges between nodes; the nodes include the student node and the problem node; the node relationship edges are used to record the association relationship and the problem-solving relationship;
[0059] Obtaining a correct probability of the student completing the exercise based on the student vector and the exercise vector;
[0060] If the correct probability is within a preset probability interval, the exercise is recommended to the student.
[0061] The above-mentioned exercise recommendation method, device, electronic device and storage medium determine the association relationship between exercises and the problem-solving relationship between students and exercises, generate a heterogeneous graph based on the association relationship and problem-solving relationship, determine the student vector of the student node and the exercise vector of the exercise node through the heterogeneous graph, and obtain the correct probability of the student completing the exercise based on the student vector and the exercise vector. If the correct probability is within a preset probability range, the exercise is recommended to the student, so that the exercise recommendation is not limited by the problem-solving record. The student vector and exercise vector in the heterogeneous graph can be used to predict the correct probability of the student completing each exercise in the question bank, and then it can be determined whether it needs to be recommended to the student, which facilitates personalized exercise recommendation for large-scale question banks.
[0062] Moreover, by obtaining exercises and exercise records, determining the correlation between exercises and the exercise-solving relationship between students and exercises, and predicting the correct probability based on the correlation and exercise-solving relationship, the correct probability can be predicted from multiple dimensions between exercises and between students and exercises, thereby improving the accuracy of the correct probability prediction and thus improving the accuracy of exercise recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 This is a flow chart of an exercise recommendation method provided in Example 1 of the present application;
[0064] Figure 2 is a schematic diagram of a student-exercise bipartite graph according to an embodiment of the present application;
[0065] Figure 3 This is a flow chart of an exercise recommendation method provided in Example 2 of the present application;
[0066] Figure 4This is a schematic diagram of the structure of an exercise recommendation device provided in Example 3 of the present application;
[0067] Figure 5 This is a structural diagram of an electronic device provided in Example 4 of the present application. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0069] The exercise recommendation method provided in this application can be applied to a terminal or a server. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablet computers, and portable wearable devices. The server can be implemented as a standalone server or a server cluster consisting of multiple servers.
[0070] Example 1
[0071] Figure 1 This is a flowchart of a method for recommending exercises provided in Example 1 of this application. Figure 1 The exercise recommendation method of the first embodiment of the present application specifically includes:
[0072] Step S110, obtaining exercises and exercise records.
[0073] The exercises can be the text data of the questions in the question bank. The question record can be the student's completion of the exercises, which may include the time and duration of the questions, whether the answer is correct, and the chapter, knowledge point, and difficulty level of the exercises.
[0074] In a specific implementation, the text data of all questions can be obtained from the question bank of the online education software. As students work through the questions, a behavior record sheet can be generated. The behavior record sheet records the time, duration, and correctness of each question, as well as the chapter, knowledge point, and difficulty level of each question. When a specific student's question-taking record is needed, all of that student's records can be retrieved from the behavior record sheet.
[0075] Step S120 , determining the association relationship between the exercises, and obtaining the problem-solving relationship between the student and the exercises based on the problem-solving record.
[0076] The association relationship may be information recording the association between exercises. For example, if the exercises are similar, there is an association relationship between the exercises.
[0077] The problem-solving relationship can be information recording the student's answers to the exercises. For example, if a student correctly answers an exercise, a problem-solving relationship exists between the student and the exercise.
[0078] In the specific implementation, since the exercises are text data, in order to facilitate data processing operations, the text data of the exercises can be converted into vectors through a pre-trained language model. By calculating the similarity between the two vectors, the similarity between the exercises can be obtained. If the similarity between the vectors exceeds the preset similarity threshold, it means that the similarity between the exercises is high and there is a correlation relationship. Otherwise, if the similarity between the vectors does not exceed the preset similarity threshold, it means that the similarity between the exercises is low and there is no correlation relationship.
[0079] As for the problem-solving relationship between students and exercises, all exercises done by students and whether the answers are correct or not can be obtained from the students' problem-solving records. If a student gets an exercise right, a problem-solving relationship can be established between the student and the exercise. Otherwise, if the student gets the exercise wrong or has not done the exercise, there is no problem-solving relationship between the student and the exercise.
[0080] In practical applications, the BERT (Bidirectional Encoder Representations from Transformers, the bidirectional encoder representation of the Google machine translation model) language model can be used. By training it, a pre-trained language model is obtained. The text data of the exercises is input into the model, and a vector representation of the text data can be output. The traditional BERT language model is trained with a large amount of Chinese and English public data (for example, encyclopedia data). When it is necessary to process the text data of exercises, the BERT language model can be fine-tuned according to the exercise data to improve its accuracy in vector conversion of the exercise text data. For example, the MLM model (Masked Language Model) in BERT can be used, and the exercises in the question bank can be used as samples and input into the MLM model for training. For each sample, 15% of the tokens can be randomly masked. Among these 15% of tokens, 80% can be converted into them. <mask>, 10% is to randomly select a text to replace the masked text, and the remaining 10% can remain unchanged.
[0081] After obtaining the vector representation of the exercise text data, the cosine similarity between the two vectors can be calculated. The cosine similarity can reflect the distance between the vectors. If the cosine similarity exceeds the preset cosine similarity threshold, it can be determined that there is a correlation between the exercises. Otherwise, if the cosine similarity does not exceed the preset cosine similarity threshold, there is no correlation between the exercises.
[0082] It should be noted that for large-scale question banks, in order to prevent students from repeating exercises, after obtaining the vector representation of the exercise text data, all exercises in the question bank can be clustered according to the vector. This allows for the recommendation of exercises that focus on exercises from different clusters, thus preventing students from repeating the same type of exercises. Specifically, algorithms such as K-means, DBSCAN (Density-Based Spatial Clustering of Applications with Noise), and hierarchical clustering can be used to directly cluster vectors.
[0083] Step S130, generate a heterogeneous graph based on the association relationship and the problem-solving relationship, and determine the student vector of the student node and the exercise vector of the exercise node through the heterogeneous graph; the heterogeneous graph includes node relationship edges between nodes; the nodes include the student nodes and the exercise nodes; the node relationship edges are used to record the association relationship and the problem-solving relationship.
[0084] A heterogeneous graph can be a network graph consisting of multiple nodes of different types and different types of node relationship edges connecting the nodes. For example, the node types can be students and exercises, and the node relationship edge types can be the association relationship between exercises and the problem-solving relationship between students and exercises.
[0085] The node relationship edge may be a connecting line between nodes for recording the association relationship between exercises and the problem-solving relationship between students and exercises.
[0086] The student node may be a node representing a student. Different student nodes in the heterogeneous graph represent different students.
[0087] The exercise node may be a node representing an exercise, and different exercise nodes in the heterogeneous graph represent different exercises.
[0088] The student vector may be a vector representation of a student node.
[0089] The exercise vector may be a vector representation of an exercise node.
[0090] In a specific implementation, all exercises in the question bank can be treated as exercise nodes in a heterogeneous graph, and all students in the student behavior record table can be treated as student nodes in the heterogeneous graph. If there is an association between exercises, a connecting line is generated between the corresponding exercise nodes as a node relationship edge between the exercises. If there is a problem-solving relationship between students and exercises, a connecting line is generated between the corresponding student nodes and the exercise nodes as a node relationship edge between the students and the exercises. Based on the above method, a student-exercise bipartite graph, i.e., a heterogeneous graph, can be constructed. For the constructed heterogeneous graph, the initial vectors of each node can be input into the heterogeneous graph neural network. The initial vectors are iteratively updated by the heterogeneous graph neural network until the iterations converge, resulting in the final vector representation of each node. The final vector representation includes the student vector corresponding to the student node and the exercise vector corresponding to the exercise node.
[0091] In practical applications, we can first obtain the initial vectors of each node in the heterogeneous graph. For example, for the exercise node, the vector representation of the exercise text data can be used as the initial exercise vector. For the student node, the initial student vector can be randomly generated, and the dimension of the initial student vector is the same as that of the initial exercise vector. Since there are different types of node relationship edges in the heterogeneous graph, and different types of node relationship edges connect different types of nodes, in order to ensure that different types of nodes (for example, student nodes and exercise nodes) are represented in the same feature space, the initial vectors of each node can be linearly mapped. For the i-th node in the heterogeneous graph (i = 1, 2, ..., I, I is the number of nodes in the heterogeneous graph), the linear mapping formula can be
[0092]
[0093] Among them, h i represents the initial vector of the i-th node, h i ′ represents the updated vector of the i-th node, φ i represents the i-th relationship, is the learnable parameter matrix.
[0094] After obtaining the updated vectors of each node, the updated vectors can be further iterated and updated through the heterogeneous graph neural network. Taking the i-th node in the heterogeneous graph as an example, all nodes that have a connection line with the i-th node are regarded as neighbor nodes. In order to consider the different contributions of each neighbor node, an attention mechanism can be introduced. The specific formula can be
[0095]
[0096] in, represents the weight between the i-th node and the j-th neighbor node (j = 1, 2, ..., J, J is the number of all neighbor nodes), σ represents the activation function, is the softmax function parameter, Indicates the type of neighbor node, Indicates type All neighbor nodes of The neighbor node index value of .
[0097] according to By performing weighted summation on the neighbor node vectors of the i-th node under the relationship Φ, the vector representation of the i-th node can be updated. The specific formula can be
[0098]
[0099] In order to avoid the problem of excessive variance, a multi-head attention mechanism can be introduced to obtain K attentions and then perform splicing. The vector representation of the i-th node under the relationship Φ can be updated as
[0100]
[0101] Among them, || represents the splicing operation.
[0102] Since node i may be connected to multiple different types of node relationship edges, different types of node relationship edges have different vector representations for node i. Therefore, a set of weights can be obtained to measure the contribution of different node relationship edge types to node i. This can also be achieved by introducing an attention mechanism to calculate the weights. The formula can be
[0103]
[0104]
[0105] Among them, |V| represents the number of neighbor nodes, P represents the number of node relationship edges, W, q, b are learnable weights, is the weight of the node relationship edge under the relationship Φ.
[0106] according to Further By performing weighted summation, the vector representation of the i-th node can be updated again. The specific formula can be
[0107]
[0108] According to the above process, z is iteratively updated until the iteration converges, and the final vector representation of node i can be obtained.
[0109] Figure 2 This is a schematic diagram of a student-exercise bipartite graph in an embodiment of the present application. The number of exercises in the question bank is m, and the student behavior record table contains the exercise records of n students. As shown in the figure, n student nodes and m exercise nodes can be generated. By connecting them based on the associations between exercises and the exercise-solving relationships between students and exercises, a student-exercise bipartite graph can be generated.
[0110] Step S140 , obtaining the correct probability of the student completing the exercise based on the student vector and the exercise vector.
[0111] In the specific implementation, after determining the final student vector and exercise vector, the link prediction method can be used to calculate the cosine similarity between the student vector and the exercise vector, and the obtained cosine similarity is normalized. The final normalized value can be used as the probability that the student has completed the exercise correctly.
[0112] In practical applications, for students who need exercise recommendations, they can first screen all exercises in the question bank based on knowledge points or chapters to obtain an initial list of candidate exercises. Then, through the heterogeneous graph, exercises with node-relationship edges to the student's student node and the exercise clusters corresponding to the exercises with node-relationship edges are removed from the initial list of candidate exercises to obtain a list of candidate exercises for recommendation to the student. The exercise clusters can be obtained by clustering the vectors of the exercise text data in step S120. By using link prediction, the cosine similarity between the student's student vector and the vectors of each exercise in the candidate exercise list is calculated, and the cosine similarity is normalized to 0 to 1. The probability of the student correctly completing each exercise in the candidate exercise list can be predicted.
[0113] Step S150: If the correct probability is within a preset probability range, recommend the exercise to the student.
[0114] In a specific implementation, the upper and lower limits of the probability interval can be set in advance. For students who need exercise recommendations, the correct probability of each exercise in the predicted candidate exercise list is compared with the probability interval. If the correct probability is within the probability interval, the exercise can be recommended to the student. Otherwise, if the correct probability is not within the probability interval, the exercise may not be recommended to the student.
[0115] In practical applications, the upper and lower limits of the probability interval can be set within a reasonable range. The upper limit does not need to be too high, because if the exercises recommended to students are all things that students can do, it will not be of much significance to the students' improvement. The lower limit does not need to be too low, because if the exercises recommended to students are all things that students cannot do, it will easily discourage students' enthusiasm for learning and affect the user experience.
[0116] For example, the upper limit of the probability interval can be set to 0.8 and the lower limit can be set to 0.6, that is, exercises with a probability of 0.6 to 0.8 that the student may get right can be recommended to the student. If the predicted probability of the exercise being correct is between 0.6 and 0.8, the exercise can be recommended to the student. Otherwise, if the probability of the exercise being correct is not between 0.6 and 0.8, the exercise may not be recommended to the student.
[0117] It should be noted that the number of exercises to be recommended can also be set, and the exercises to be recommended are screened from the candidate exercise list in turn. When the number of screened exercises meets the pre-set number of exercises, the exercise screening is stopped and the screened exercises are recommended to students.
[0118] The technical solution provided in the embodiment of the present application determines the association relationship between exercises and the problem-solving relationship between students and exercises, generates a heterogeneous graph based on the association relationship and the problem-solving relationship, determines the student vector of the student node and the exercise vector of the exercise node through the heterogeneous graph, and obtains the correct probability of the student completing the exercise based on the student vector and the exercise vector. If the correct probability is within a preset probability range, the exercise is recommended to the student, so that the exercise recommendation is not limited by the problem-solving record. The student vector and exercise vector in the heterogeneous graph can be used to predict the correct probability of the student completing each exercise in the question bank, and then it can be determined whether it needs to be recommended to the student, which facilitates personalized exercise recommendation for large-scale question banks.
[0119] Moreover, by obtaining exercises and exercise records, determining the correlation between exercises and the exercise-solving relationship between students and exercises, and predicting the correct probability based on the correlation and exercise-solving relationship, the correct probability can be predicted from multiple dimensions between exercises and between students and exercises, thereby improving the accuracy of the correct probability prediction and thus improving the accuracy of exercise recommendations.
[0120] Example 2
[0121] refer to Figure 1 The exercise recommendation method of the second embodiment of the present application specifically includes:
[0122] Step S110, obtaining exercises and exercise records.
[0123] In a specific implementation, the text data of all questions can be obtained from the question bank of the online education software. As students work through the questions, a behavior record sheet can be generated. The behavior record sheet records the time, duration, and correctness of each question, as well as the chapter, knowledge point, and difficulty level of each question. When a specific student's question-taking record is needed, all of that student's records can be retrieved from the behavior record sheet.
[0124] Step S120 , determining the association relationship between the exercises, and obtaining the problem-solving relationship between the student and the exercises based on the problem-solving record.
[0125] Optionally, determining the association relationship between the exercises includes:
[0126] The text vectors of the exercises are obtained through a pre-trained language model; the vector similarity between the text vectors is determined; if the vector similarity exceeds a preset similarity threshold, it is determined that the association relationship exists between the exercises.
[0127] The text vector may be a vector representation of the text.
[0128] In the specific implementation, the text data of the exercises can be converted into text vectors through a pre-trained language model. The vector similarity can be obtained by calculating the cosine similarity between the two text vectors. The vector similarity can reflect the distance between the exercises. If the vector similarity exceeds the preset similarity threshold, it indicates that there is an association relationship between the exercises. Otherwise, if the vector similarity does not exceed the preset similarity threshold, it indicates that there is no association relationship between the exercises.
[0129] According to the technical solution of the embodiment of the present application, the text vector of the exercise is obtained through a pre-trained language model, the exercise text data can be converted into a vector representation, the vector similarity between the text vectors can be determined, and the association relationship between the exercises can be quantified based on the text vectors. If the vector similarity exceeds the preset similarity threshold, it is determined that there is an association relationship between the exercises. The association relationship between the exercises can be determined quickly and accurately, the dimension of the exercise recommendation is increased, and the accuracy of the exercise recommendation is improved.
[0130] Optionally, obtaining the relationship between the student and the exercise based on the exercise record includes:
[0131] According to the question-doing record, the student's answer status for the exercise is obtained; the answer status includes correct answer, incorrect answer and no answer; if the answer status is correct answer, it is determined that there is the question-doing relationship between the student and the exercise; if the answer status is incorrect answer or no answer, it is determined that there is no question-doing relationship between the student and the exercise.
[0132] The answer status may be the status of the student completing the exercises. For example, if the student answers a question correctly, the student's answer to the exercise is correct; if the student answers a question incorrectly, the student's answer to the exercise is incorrect; if the student has not done a question, the student's answer to the exercise is not answered.
[0133] In a specific implementation, all the exercises done by the student and whether the answers are correct or not can be obtained from the student's exercise records. For a certain exercise in the question bank, if the exercise record records the answer result to be correct, it can be determined that the answer to the exercise is correct, and a problem-solving relationship is established between the student and the exercise; if the exercise record records the answer result to be incorrect, it can be determined that the answer to the exercise is incorrect, that is, there is no problem-solving relationship between the student and the exercise; if the exercise record does not record the answer result to the exercise, it can be determined that the answer to the exercise is not answered, which is the same as an incorrect answer, and there is no problem-solving relationship between the student and the exercise.
[0134] According to the technical solution of the embodiment of the present application, by determining that there is a problem-solving relationship between the student and the exercise when the answer is correct, and determining that there is no problem-solving relationship between the student and the exercise when the answer is incorrect or no answer is given, the problem-solving relationship between the student and the exercise can be determined quickly and accurately, the dimension of the exercise recommendation is increased, and the accuracy of the exercise recommendation is improved.
[0135] Step S130, generate a heterogeneous graph based on the association relationship and the problem-solving relationship, and determine the student vector of the student node and the exercise vector of the exercise node through the heterogeneous graph; the heterogeneous graph includes node relationship edges between nodes; the nodes include the student nodes and the exercise nodes; the node relationship edges are used to record the association relationship and the problem-solving relationship.
[0136] Optionally, the step S130 includes:
[0137] A target node is selected in the heterogeneous graph, and neighbor nodes of the target node are obtained; the target node includes the student node and the exercise node; the degree of correlation between the target node and the neighbor nodes is determined, and a first weight is obtained according to the degree of correlation; the neighbor node vectors are weighted summed according to the first weight to obtain a first vector of the target node; a second weight is obtained according to the type of the node relationship edge between the target node and the neighbor nodes; the first vectors are weighted summed according to the second weight to obtain a second vector of the target node; the second vector includes the student vector and the exercise vector.
[0138] The target node may be any node in the heterogeneous graph, for example, the target node may be a student node or an exercise node.
[0139] The neighbor nodes may be nodes that have a node relationship edge with the target node.
[0140] The type of the node relationship edge may be the type of relationship recorded by the node relationship edge. For example, the type of the node relationship edge may include a type that records the association relationship between exercises and a type that records the problem-solving relationship between students and exercises.
[0141] In the specific implementation, a target node can be randomly selected in the heterogeneous graph. In order to determine the vector representation of the target node, the initial vector of the target node can be obtained first. Specifically, if the target node is an exercise node, the vector representation of the exercise text data can be used as the initial vector. If the target node is a student node, an initial vector can be randomly generated. Since there are different types of node relationship edges in the heterogeneous graph, different types of node relationship edges connect different types of nodes. In order to ensure that different types of nodes are represented in the same feature space, the initial vector of the target node can be linearly mapped. The formula can be
[0142]
[0143] Among them, h i represents the initial vector of the i-th node, that is, the initial vector of the target node, h i ′ represents the updated vector of the i-th node, that is, the vector after the linear mapping of the initial vector of the target node, φ i represents the i-th relationship, is the learnable parameter matrix.
[0144] After linearly mapping the initial vector of the target node, the vector of the target node can be further iteratively updated through the heterogeneous graph neural network. Specifically, the softmax function can be used to determine the degree of correlation between the target node and each neighboring node. Among them, the attention mechanism can be used to introduce the different contribution degrees of each neighboring node. The specific formula can be
[0145]
[0146] in, represents the weight (first weight) between the i-th node (target node) and the j-th neighbor node (j = 1, 2, ..., J, J is the number of all neighbor nodes), σ represents the activation function, is the softmax function parameter, Indicates the type of neighbor node, Indicates type All neighbor nodes of The neighbor node index value of .
[0147] According to the first weight By weighted summing of the neighbor node vectors under the relationship Φ, the vector representation of the target node can be updated to obtain the first vector of the target node. The specific formula can be
[0148]
[0149] In order to avoid the problem of too large variance, a multi-head attention mechanism can be introduced to calculate K times of attention and then splice. The first vector of the target node under the relationship Φ can be
[0150]
[0151] Among them, || represents the splicing operation.
[0152] Since the target node may be connected to multiple different types of node relationship edges, different types of node relationship edges have different vector representations for the target node. Therefore, a second weight can be obtained to measure the contribution of different types of node relationship edges to the target node. The attention mechanism can also be introduced. The formula can be
[0153]
[0154]
[0155] Among them, |V| represents the number of neighbor nodes, P represents the number of node relationship edges, W, q, b are learnable weights, is the second weight under the relationship Φ.
[0156] According to the second weight For the first vector By performing weighted summation, the vector representation of the target node can be updated again to obtain the second vector z of the target node. The specific formula can be
[0157]
[0158] The second vector z can be a student vector or an exercise vector.
[0159] According to the technical solution of the embodiment of the present application, by determining the degree of correlation between the target node and the neighbor nodes, and obtaining a first weight based on the degree of correlation, the neighbor node vectors are weightedly summed according to the first weight to obtain the first vector of the target node, the target node vector can be updated according to the degree of correlation between the target node and the neighbor nodes, and a second weight is obtained according to the type of the node relationship edge between the target node and the neighbor nodes, and the first vector is weightedly summed according to the second weight to obtain the second vector of the target node, and the target node can be updated again according to the type of the node relationship edge between the target node and the neighbor nodes, so that the final target node vector is affected by both the degree of node correlation and the type of node relationship edge. The target node vector determined according to multiple dimensions can improve the accuracy of exercise recommendations.
[0160] Optionally, determining the degree of correlation between the target node and the neighboring nodes includes:
[0161] Obtain a target node vector and a neighbor node vector; obtain a mapped target node vector and a mapped neighbor node vector by linearly mapping the target node vector and the neighbor node vector; the mapped target node vector and the mapped neighbor node vector are in the same feature space; and obtain a degree of correlation between the target node and the neighbor node based on the mapped target node vector and the mapped neighbor node vector.
[0162] The target node vector may be a vector representation of the target node, and the neighbor node vector may be a vector representation of the neighbor node.
[0163] In the specific implementation, after determining the target node and its neighbor nodes, the target node vector and the neighbor node vector can be obtained. Specifically, if the target node is an exercise node, the vector representation of the exercise text data can be used as the target node vector. If the target node is a student node, a target node vector can be randomly generated. If the neighbor node is an exercise node, the vector representation of the exercise text data can be used as the neighbor node vector. If the neighbor node is a student node, a neighbor node vector can be randomly generated. Since the types of the target node and the neighbor node may be different, for example, the target node may be a student and the neighbor node may be an exercise, in order to ensure that the target node vector and the neighbor node vector can be processed in the same feature space, the target node vector and the neighbor node vector can be linearly mapped. The formula can be
[0164]
[0165] Among them, h i represents the initial vector of the i-th node, that is, the target node vector or the neighbor node vector, h i ′ represents the updated vector of the i-th node, that is, the mapped target node vector or the mapped neighbor node vector. The correlation between the mapped target node and the mapped neighbor node is determined by the softmax function. The specific formula can be
[0166]
[0167] in, Represents the first weight between the target node and the neighboring nodes, which is used to characterize the correlation between the mapped target node and the mapped neighboring nodes.
[0168] According to the technical solution of the embodiment of the present application, by linearly mapping the target node vector and the neighbor node vector to obtain the mapped target node vector and the mapped neighbor node vector, the target node vector and the neighbor node vector can be placed in the same feature space, which is convenient for calculating the degree of correlation between the two. The degree of correlation between the target node and the neighbor node can be obtained based on the mapped target node vector and the mapped neighbor node vector. The vector representation of the node can be updated based on the degree of correlation between the target node and the neighbor node, thereby improving the accuracy of exercise recommendation.
[0169] Step S140 , obtaining the correct probability of the student completing the exercise based on the student vector and the exercise vector.
[0170] Optionally, the step S140 includes:
[0171] Obtain a target student node corresponding to a target student in the heterogeneous graph; determine a candidate exercise node based on the target student node; obtain a node similarity between the target student node and the candidate exercise node based on a student vector corresponding to the target student node and an exercise vector corresponding to the candidate exercise node; and obtain a probability that the target student correctly completes the candidate exercise by normalizing the node similarity.
[0172] The target students may be students who need exercise recommendations.
[0173] The candidate exercise nodes may be exercise nodes that are screened from the heterogeneous graph and can be used for exercise recommendation.
[0174] In the specific implementation, after determining the target student, the node corresponding to the target student can be obtained in the heterogeneous graph. As the target student node, the target student can enter the knowledge point or chapter to be solved. Candidate exercises are screened from the question bank based on the knowledge point or chapter, and the nodes corresponding to the candidate exercises are used as candidate exercise nodes in the heterogeneous graph. The student vector corresponding to the target student node and the exercise vector corresponding to the candidate exercise node are obtained. The cosine similarity between the student vector and the exercise vector is calculated. The node distance between the target student node and the candidate exercise node is measured by the cosine similarity. The cosine similarity is normalized to 0 to 1 to obtain the probability of the target student correctly completing each candidate exercise.
[0175] According to the technical solution of the embodiment of the present application, by obtaining the target student node corresponding to the target student in the heterogeneous graph and determining the candidate exercise node based on the target student node, the scope of exercise recommendation can be narrowed and the efficiency of exercise recommendation can be improved. The node similarity between the target student node and the candidate exercise node is obtained based on the student vector corresponding to the target student node and the exercise vector corresponding to the candidate exercise node. The correct probability of the target student completing the candidate exercise is obtained by normalizing the node similarity. The correct probability of a specified student completing each candidate exercise can be predicted based on the similarity between the nodes, which facilitates personalized exercise recommendation and improves the efficiency of exercise recommendation.
[0176] Optionally, determining a candidate exercise node according to the target student node includes:
[0177] According to the exercise identifier input by the target student, an initial candidate exercise node is determined among the exercise nodes of the heterogeneous graph; an exercise node that has a node relationship edge with the target student node is determined as a first redundant node; an exercise node in the same cluster as the first redundant node is determined as a second redundant node; and the candidate exercise node is obtained by removing the first redundant node and the second redundant node from the initial candidate exercise node.
[0178] The exercise identifier may be the knowledge point or chapter corresponding to the exercise.
[0179] In the specific implementation, the target student can input the knowledge points or chapters that need to be answered, and the initial candidate exercises can be screened out from the question bank based on the knowledge points or chapters. The nodes corresponding to the initial candidate exercises in the heterogeneous graph are used as the initial candidate exercise nodes. The exercise nodes that have node relationship edges with the target student nodes can also be searched in the heterogeneous graph as the first redundant nodes. The exercise nodes are clustered according to the exercise vectors of each exercise node in the heterogeneous graph to obtain clustering clusters of exercise nodes. The exercise nodes in the same clustering cluster as the first redundant nodes are determined as second redundant nodes. The first redundant nodes and the second redundant nodes are removed from the initial candidate exercise nodes to obtain candidate exercise nodes.
[0180] According to the technical solution of the embodiment of the present application, by determining the initial candidate exercise nodes in the exercise nodes of the heterogeneous graph according to the exercise identifier input by the target student, the initial candidate exercises can be screened out according to the exercise identifier, and the exercise node that has a node relationship edge with the target student node can be determined as the first redundant node. The exercises done by the target student can be determined as redundant, and the exercise nodes in the same cluster as the first redundant node can be determined as the second redundant node. Exercises similar to the exercises done by the target student can be determined as redundant. By removing the first redundant node and the second redundant node from the initial candidate exercise nodes to obtain the candidate exercise nodes, redundant exercises can be removed from the initial candidate exercises, narrowing the scope of exercise recommendation and improving the efficiency of exercise recommendation.
[0181] Step S150: If the correct probability is within a preset probability range, recommend the exercise to the student.
[0182] In the specific implementation, the upper and lower limits of the probability interval can be set in advance. For the target students who need exercise recommendations, the correct probability of each exercise in the predicted candidate exercise list is compared with the probability interval. If the correct probability is within the probability interval, the exercise can be recommended to the target student. Otherwise, if the correct probability is not within the probability interval, the exercise may not be recommended to the target student.
[0183] In order to facilitate those skilled in the art to have a deeper understanding of the embodiments of the present application, a specific example will be used for illustration below.
[0184] Figure 3 This is a flowchart of an exercise recommendation method provided in Example 2 of the present application. After obtaining the exercise data, the exercise data can be converted into exercise vectors through the BERT language model. On the one hand, the similarity between exercises can be calculated based on the exercise vectors to obtain the correlation between exercises. On the other hand, the exercises can be clustered using the exercise vectors through a clustering algorithm to obtain multiple exercise clusters. After the exercises in the question bank are preliminarily screened according to knowledge points or chapters, the exercises that the students have done and the exercises in the same exercise cluster as the exercises that the students have done can be removed from the screening results to obtain candidate exercises. After obtaining the student's exercise record, the exercise relationship between the student and the exercise can be determined based on the exercise record. According to the correlation between exercises and exercises, and the exercise relationship between students and exercises, a student-exercise bipartite graph is constructed. Based on the student-exercise bipartite graph, the student vector and exercise vector are obtained through a heterogeneous graph neural network. After obtaining the candidate exercises, the exercise vector of the candidate exercises can be obtained. Through link prediction, the cosine similarity between the student vector and the exercise vector of the candidate exercises can be calculated, and the cosine similarity can be normalized to 0 to 1 to obtain the correct probability of the student completing the candidate exercises. The correct probability is screened according to the preset probability interval. If the correct probability is within the preset probability interval, the candidate exercise can be recommended to the student. Otherwise, if it is not within the preset probability interval, it will not be recommended to the student. Finally, the exercise recommendation result is obtained.
[0185] It should be understood that although Figure 1 and Figure 3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 and Figure 3 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The order of execution of these steps or stages is not necessarily one by one, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0186] Example 3
[0187] Figure 4 This is a schematic diagram of the structure of an exercise recommendation device provided in Example 3 of this application. Figure 4 The exercise recommendation device provided in this embodiment specifically includes: an acquisition module 410, a relationship determination module 420, a vector determination module 430, a correct probability calculation module 440 and an exercise recommendation module 450; wherein:
[0188] Acquisition module 410, for acquiring exercises and exercise records;
[0189] A relationship determination module 420 is configured to determine the association relationship between the exercises, and to obtain the relationship between the student and the exercises based on the exercise record;
[0190] A vector determination module 430 is configured to generate a heterogeneous graph based on the association relationship and the problem-solving relationship, and determine a student vector for a student node and an exercise vector for an exercise node through the heterogeneous graph; the heterogeneous graph includes node relationship edges between nodes; the nodes include the student node and the exercise node; and the node relationship edges are used to record the association relationship and the problem-solving relationship.
[0191] A correct probability calculation module 440 is used to obtain the correct probability of the student completing the exercise based on the student vector and the exercise vector;
[0192] The exercise recommendation module 450 is configured to recommend the exercise to the student if the correct probability is within a preset probability interval.
[0193] The technical solution provided in the embodiment of the present application determines the association relationship between exercises and the problem-solving relationship between students and exercises, generates a heterogeneous graph based on the association relationship and the problem-solving relationship, determines the student vector of the student node and the exercise vector of the exercise node through the heterogeneous graph, and obtains the correct probability of the student completing the exercise based on the student vector and the exercise vector. If the correct probability is within a preset probability range, the exercise is recommended to the student, so that the exercise recommendation is not limited by the problem-solving record. The student vector and exercise vector in the heterogeneous graph can be used to predict the correct probability of the student completing each exercise in the question bank, and then it can be determined whether it needs to be recommended to the student, which facilitates personalized exercise recommendation for large-scale question banks.
[0194] Moreover, by obtaining exercises and exercise records, determining the correlation between exercises and the exercise-solving relationship between students and exercises, and predicting the correct probability based on the correlation and exercise-solving relationship, the correct probability can be predicted from multiple dimensions between exercises and between students and exercises, thereby improving the accuracy of the correct probability prediction and thus improving the accuracy of exercise recommendations.
[0195] In another embodiment, the relationship determination module 420 includes:
[0196] A text vector acquisition module, configured to obtain the text vector of the exercise using a pre-trained language model;
[0197] A vector similarity determination module, configured to determine the vector similarity between the text vectors;
[0198] The association relationship determination module is configured to determine that the association relationship exists between the exercises if the vector similarity exceeds a preset similarity threshold.
[0199] In another embodiment, the relationship determination module 420 further includes:
[0200] An answer status acquisition module is used to obtain the student's answer status to the exercise according to the exercise record; the answer status includes correct answer, incorrect answer and no answer;
[0201] A first determination module is configured to determine that there is a problem-solving relationship between the student and the problem if the answer is correct;
[0202] The second determination module is configured to determine that there is no question-answering relationship between the student and the question if the answering status is an incorrect answer or no answer.
[0203] In another embodiment, the vector determination module 430 includes:
[0204] A node acquisition module is used to select a target node in the heterogeneous graph and obtain neighbor nodes of the target node; the target node includes the student node and the exercise node;
[0205] a first weight calculation module, configured to determine a correlation between the target node and the neighboring nodes, and obtain a first weight according to the correlation;
[0206] A first vector calculation module, configured to perform weighted summation on the neighbor node vectors according to the first weight to obtain a first vector of the target node;
[0207] A second weight calculation module, configured to obtain a second weight according to the type of the node relationship edge between the target node and the neighbor node;
[0208] The second vector calculation module is used to perform weighted summation on the first vector according to the second weight to obtain a second vector of the target node; the second vector includes the student vector and the exercise vector.
[0209] In another embodiment, the first weight calculation module is specifically configured to:
[0210] Get the target node vector and neighbor node vector;
[0211] By performing linear mapping on the target node vector and the neighbor node vector, a mapped target node vector and a mapped neighbor node vector are obtained; the mapped target node vector and the mapped neighbor node vector are in the same feature space;
[0212] The degree of correlation between the target node and the neighbor node is obtained according to the mapped target node vector and the mapped neighbor node vector.
[0213] In another embodiment, the correct probability calculation module 440 includes:
[0214] A target student node acquisition module is used to obtain the target student node corresponding to the target student in the heterogeneous graph;
[0215] A candidate exercise node determination module, configured to determine a candidate exercise node based on the target student node;
[0216] A node similarity calculation module, configured to obtain the node similarity between the target student node and the candidate exercise node based on the student vector corresponding to the target student node and the exercise vector corresponding to the candidate exercise node;
[0217] The correct probability calculation module is used to obtain the correct probability of the target student completing the candidate exercises by normalizing the node similarities.
[0218] In another embodiment, the candidate exercise node determination module is specifically configured to:
[0219] Determining initial candidate exercise nodes from the exercise nodes in the heterogeneous graph according to the exercise identifier input by the target student;
[0220] Determine an exercise node that has a node relationship edge with the target student node as a first redundant node;
[0221] Determine the exercise node in the same cluster as the first redundant node as the second redundant node;
[0222] The candidate exercise node is obtained by removing the first redundant node and the second redundant node from the initial candidate exercise node.
[0223] The exercise recommendation device provided above can be used to execute the exercise recommendation and identification method provided in any of the above embodiments, and has corresponding functions and beneficial effects.
[0224] The specific limitations of the exercise recommendation device can be found in the limitations of the exercise recommendation method above and will not be repeated here. The various modules in the above-mentioned exercise recommendation device can be implemented in whole or in part through software, hardware, or a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in hardware form, or can be stored in the memory of the electronic device in software form, so that the processor can call and execute the corresponding operations of the above-mentioned modules.
[0225] Example 4
[0226] Figure 5 : It is a structural diagram of an electronic device provided in Example 4 of the present application. As shown in the figure, the electronic device includes: a processor 50, a memory 51, a display screen 52 with a touch function, an input device 53, an output device 54, and a communication device 55. The number of processors 50 in the electronic device can be one or more, and the figure takes one processor 50 as an example. The number of memories 51 in the electronic device can be one or more, and the figure takes one memory 51 as an example. The processor 50, memory 51, display screen 52, input device 53, output device 54, and communication device 55 of the electronic device can be connected via a bus or other means, and the figure takes the connection via a bus as an example. In the embodiment, the electronic device can be a computer, a mobile phone, a tablet, a projector, an interactive smart tablet, etc. In the embodiment, the electronic device is described by taking the interactive smart tablet as an example.
[0227] The memory 51 is a computer-readable storage medium that can be used to store software programs, computer executable programs, and modules, such as the program instructions / modules corresponding to the exercise recommendation method described in any embodiment of the present application. The memory 51 may mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required for a function; the data storage area can store data created based on the use of the device, etc. In addition, the memory 51 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 51 may further include a memory remotely located relative to the processor 50, and these remote memories can be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0228] Display screen 52 is a touch-enabled display screen 52, which can be a capacitive screen, an electromagnetic screen, or an infrared screen. Generally speaking, display screen 52 is used to display data according to instructions from processor 50, and is also used to receive touch operations on display screen 52 and transmit corresponding signals to processor 50 or other devices. Optionally, when display screen 52 is an infrared screen, it also includes an infrared touch frame, which is disposed around display screen 52 and is further used to receive infrared signals and transmit them to processor 50 or other devices.
[0229] The communication device 55 is used to establish a communication connection with other devices, and can be a wired communication device and / or a wireless communication device.
[0230] The input device 53 can be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device. It can also be a camera for capturing images and a sound pickup device for capturing audio data. The output device 54 can include audio equipment such as a speaker. It should be noted that the specific composition of the input device 53 and the output device 54 can be set according to actual circumstances.
[0231] The processor 50 executes the software programs, instructions and modules stored in the memory 51 to perform various functional applications and data processing of the device, that is, to implement the above-mentioned exercise recommendation method.
[0232] Specifically, in the embodiment, when the processor 50 executes one or more programs stored in the memory 51, the following operations are implemented:
[0233] Get exercises and exercise records;
[0234] Determining the association relationship between the exercises, and obtaining the relationship between the student and the exercises based on the exercise record;
[0235] Generate a heterogeneous graph based on the association relationship and the problem-solving relationship, and determine the student vector of the student node and the problem vector of the problem node through the heterogeneous graph; the heterogeneous graph includes node relationship edges between nodes; the nodes include the student node and the problem node; the node relationship edges are used to record the association relationship and the problem-solving relationship;
[0236] Obtaining a correct probability of the student completing the exercise based on the student vector and the exercise vector;
[0237] If the correct probability is within a preset probability interval, the exercise is recommended to the student.
[0238] Based on the above embodiment, the one or more processors 50 further implement the following operations:
[0239] Obtain the text vector of the exercise through the pre-trained language model;
[0240] Determining vector similarity between the text vectors;
[0241] If the vector similarity exceeds a preset similarity threshold, it is determined that the association relationship exists between the exercises.
[0242] Based on the above embodiment, the one or more processors 50 further implement the following operations:
[0243] Obtaining the student's answer status to the exercise according to the exercise record; the answer status includes correct answer, incorrect answer and no answer;
[0244] If the answer is correct, then determining that there is a problem-solving relationship between the student and the problem;
[0245] If the answering status is the incorrect answering or the non-answering, it is determined that there is no question-answering relationship between the student and the question.
[0246] Based on the above embodiment, the one or more processors 50 further implement the following operations:
[0247] Selecting a target node in the heterogeneous graph and obtaining neighbor nodes of the target node; the target node includes the student node and the exercise node;
[0248] Determining a correlation between the target node and the neighboring nodes, and obtaining a first weight according to the correlation;
[0249] Performing weighted summation on the neighbor node vectors according to the first weight to obtain a first vector of the target node;
[0250] Obtaining a second weight according to a type of a node relationship edge between the target node and the neighboring node;
[0251] The first vectors are weighted and summed according to the second weight to obtain a second vector of the target node; the second vector includes the student vector and the exercise vector.
[0252] Based on the above embodiment, the one or more processors 50 further implement the following operations:
[0253] Get the target node vector and neighbor node vector;
[0254] By performing linear mapping on the target node vector and the neighbor node vector, a mapped target node vector and a mapped neighbor node vector are obtained; the mapped target node vector and the mapped neighbor node vector are in the same feature space;
[0255] The degree of correlation between the target node and the neighbor node is obtained according to the mapped target node vector and the mapped neighbor node vector.
[0256] Based on the above embodiment, the one or more processors 50 further implement the following operations:
[0257] Obtaining a target student node corresponding to a target student in the heterogeneous graph;
[0258] Determining candidate exercise nodes based on the target student node;
[0259] Obtaining a node similarity between the target student node and the candidate exercise node based on the student vector corresponding to the target student node and the exercise vector corresponding to the candidate exercise node;
[0260] By normalizing the node similarities, the correct probability of the target student completing the candidate exercises is obtained.
[0261] Based on the above embodiment, the one or more processors 50 further implement the following operations:
[0262] Determining initial candidate exercise nodes from the exercise nodes in the heterogeneous graph according to the exercise identifier input by the target student;
[0263] Determine an exercise node that has a node relationship edge with the target student node as a first redundant node;
[0264] Determine the exercise node in the same cluster as the first redundant node as the second redundant node;
[0265] The candidate exercise node is obtained by removing the first redundant node and the second redundant node from the initial candidate exercise node.
[0266] Example 5
[0267] The fifth embodiment of the present application further provides a storage medium containing computer-executable instructions. When the computer-executable instructions are executed by a computer processor, the computer-executable instructions are used to perform an exercise recommendation method, including:
[0268] Get exercises and exercise records;
[0269] Determining the association relationship between the exercises, and obtaining the relationship between the student and the exercises based on the exercise record;
[0270] Generate a heterogeneous graph based on the association relationship and the problem-solving relationship, and determine the student vector of the student node and the problem vector of the problem node through the heterogeneous graph; the heterogeneous graph includes node relationship edges between nodes; the nodes include the student node and the problem node; the node relationship edges are used to record the association relationship and the problem-solving relationship;
[0271] Obtaining a correct probability of the student completing the exercise based on the student vector and the exercise vector;
[0272] If the correct probability is within a preset probability interval, the exercise is recommended to the student.
[0273] Of course, the storage medium containing computer-executable instructions provided in the embodiment of the present application, whose computer-executable instructions are not limited to the operations of the exercise recommendation method described above, can also execute related operations in the exercise recommendation method provided in any embodiment of the present application, and have corresponding functions and beneficial effects.
[0274] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0275] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0276] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.< / mask>
Claims
1. A method for recommending exercises, characterized in that: The method comprises: Get exercises and exercise records; Determining the association relationship between the exercises, and obtaining the relationship between the student and the exercises based on the exercise record; Generate a heterogeneous graph based on the association relationship and the problem-solving relationship; the heterogeneous graph includes nodes and node relationship edges between the nodes; the nodes include student nodes and problem nodes; the node relationship edges are used to record the association relationship and the problem-solving relationship; A target node is selected in the heterogeneous graph, and neighbor nodes of the target node are obtained, where the target node includes the student node and the exercise node; a correlation between the target node and the neighbor nodes is determined, and a first weight is obtained according to the correlation; a weighted sum of the neighbor node vectors is performed according to the first weight to obtain a first vector of the target node; a second weight is obtained according to the type of the node relationship edge between the target node and the neighbor nodes; a weighted sum of the first vectors is performed according to the second weight to obtain a second vector of the target node; the second vector includes a student vector and an exercise vector, and further includes: Obtain the initial vector of each node in the heterogeneous graph, and perform linear mapping on the initial vector of each node. The linear mapping formula is: Among them, h i represents the initial vector of the i-th node, h i ′ represents the updated vector of the i-th node, φ i represents the i-th relationship, is the learnable parameter matrix, All nodes that have a connection line with the i-th node are regarded as the neighbor nodes, and the first weight is calculated. in, represents the first weight between the i-th node and the j-th neighbor node, σ represents the activation function, is the softmax function parameter, Indicates the type of neighbor node, Indicates type All neighbor nodes of The index value of the neighbor node, According to the first weight Perform weighted summation on the neighbor node vectors of the i-th node under the relationship Φ to obtain the first vector of the i-th node Calculate K times of attention and then splice, the first vector Updated to Among them, || represents the splicing operation, Determine the second weight Among them, |V| represents the number of neighbor nodes, P represents the number of node relationship edges, W, q, b are learnable weights, is the second weight of the node relationship edge under the relationship Φ, According to the second weight For the first vector Perform weighted summation to obtain the second vector z of the i-th node, Obtaining a target student node corresponding to a target student in the heterogeneous graph, determining a candidate exercise node based on the target student node, obtaining a node similarity between the target student node and the candidate exercise node based on a student vector corresponding to the target student node and an exercise vector corresponding to the candidate exercise node, and obtaining a probability that the target student correctly completes the candidate exercise by normalizing the node similarity; If the correct probability is within a preset probability interval, the exercise is recommended to the student.
2. The method according to claim 1, characterized in that Determining the association relationship between the exercises includes: Obtain the text vector of the exercise through the pre-trained language model; Determining vector similarity between the text vectors; If the vector similarity exceeds a preset similarity threshold, it is determined that the association relationship exists between the exercises.
3. The method according to claim 1, characterized in that The obtaining of the relationship between the student and the exercise based on the exercise record includes: Obtaining the student's answer status to the exercise according to the exercise record; the answer status includes correct answer, incorrect answer and no answer; If the answer is correct, then determining that there is a problem-solving relationship between the student and the problem; If the answering status is the incorrect answering or the non-answering, it is determined that there is no question-answering relationship between the student and the question.
4. The method according to claim 1, wherein The determining the degree of correlation between the target node and the neighboring nodes includes: Get the target node vector and neighbor node vector; By performing linear mapping on the target node vector and the neighbor node vector, a mapped target node vector and a mapped neighbor node vector are obtained; the mapped target node vector and the mapped neighbor node vector are in the same feature space; The degree of correlation between the target node and the neighbor node is obtained according to the mapped target node vector and the mapped neighbor node vector.
5. The method according to claim 1, wherein Determining candidate exercise nodes according to the target student node includes: Determining initial candidate exercise nodes from the exercise nodes in the heterogeneous graph according to the exercise identifier input by the target student; Determine an exercise node that has a node relationship edge with the target student node as a first redundant node; Determine the exercise node in the same cluster as the first redundant node as the second redundant node; The candidate exercise node is obtained by removing the first redundant node and the second redundant node from the initial candidate exercise node.
6. A device for recommending exercises, characterized in that: The device comprises: Acquisition module, used to obtain exercises and exercise records; a relationship determination module, configured to determine the association relationship between the exercises, and obtain the relationship between the students and the exercises based on the exercise records; A vector determination module is configured to generate a heterogeneous graph based on the association relationship and the problem-solving relationship; the heterogeneous graph includes nodes and node relationship edges between the nodes; the nodes include student nodes and problem nodes; and the node relationship edges are configured to record the association relationship and the problem-solving relationship. The vector determination module is further configured to select a target node in the heterogeneous graph and obtain neighbor nodes of the target node, the target node including the student node and the exercise node, determine a correlation between the target node and the neighbor nodes, obtain a first weight based on the correlation, perform weighted summation of the neighbor node vectors based on the first weight to obtain a first vector of the target node, obtain a second weight based on the type of node relationship edge between the target node and the neighbor nodes, perform weighted summation of the first vectors based on the second weight to obtain a second vector of the target node; the second vector includes a student vector and an exercise vector; The vector determination module is also used to obtain the initial vector of each node in the heterogeneous graph and perform linear mapping on the initial vector of each node. The linear mapping formula is: Among them, h i represents the initial vector of the i-th node, h i ′ represents the updated vector of the i-th node, φ i represents the i-th relationship, is the learnable parameter matrix, All nodes that have a connection line with the i-th node are regarded as the neighbor nodes, and the first weight is calculated. in, represents the first weight between the i-th node and the j-th neighbor node, σ represents the activation function, is the softmax function parameter, Indicates the type of neighbor node, Indicates type All neighbor nodes of The index value of the neighbor node, According to the first weight Perform weighted summation on the neighbor node vectors of the i-th node under the relationship Φ to obtain the first vector of the i-th node Calculate K times of attention and then perform splicing. The first vector Updated to Among them, || represents the splicing operation, Determine the second weight Among them, |V| represents the number of neighbor nodes, P represents the number of node relationship edges, W, q, b are learnable weights, is the second weight of the node relationship edge under the relationship Φ, According to the second weight For the first vector Perform weighted summation to obtain the second vector z of the i-th node, a correctness probability calculation module, configured to obtain a target student node corresponding to a target student in the heterogeneous graph, determine a candidate exercise node based on the target student node, obtain a node similarity between the target student node and the candidate exercise node based on a student vector corresponding to the target student node and an exercise vector corresponding to the candidate exercise node, and obtain a correctness probability of the target student completing the candidate exercise by normalizing the node similarity; The exercise recommendation module is configured to recommend the exercise to the student if the correct probability is within a preset probability interval.
7. The device according to claim 6, characterized in that The relationship determination module is further configured to obtain the text vectors of the exercises through a pre-trained language model, determine the vector similarity between the text vectors, and determine that the association relationship exists between the exercises if the vector similarity exceeds a preset similarity threshold.
8. The device according to claim 6, characterized in that The relationship determination module is also used to obtain the student's answer status to the exercise based on the exercise record, and the answer status includes correct answer, incorrect answer and no answer. If the answer status is correct answer, it is determined that there is the exercise relationship between the student and the exercise. If the answer status is incorrect answer or no answer, it is determined that there is no exercise relationship between the student and the exercise.
9. An electronic device, characterized in that: include: memory, one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors execute the exercise recommendation method according to any one of claims 1 to 5.
10. A storage medium containing computer-executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to perform the exercise recommendation method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Bipartite graph-based question recommendation method and device, equipment and storage medium
CN110457587A
Method and device for question recommendation
WO2016179938A1