Personalized programming question recommendation method based on knowledge tracking
By using a knowledge tracking model based on feature enhancement and attention mechanism on the online programming learning platform, combined with the learner's historical knowledge status information, the problem of poor recommendation of personalized programming questions in the existing technology is solved, and more accurate The prediction of answering performance and personalized recommendations have improved the learning effect.
Patent Information
- Application Number
- CN202411045781.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2025-01-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing online programming learning platform is difficult to recommend personalized programming questions based on the changes in the learner's knowledge status, which makes it difficult for learners to choose questions that conform to their own learning process and abilities, which affects the learning effect.
Using a knowledge tracking model based on feature enhancement and attention mechanism, combining learners' historical knowledge status information to predict their future answer performance, and adjust the recommended questions through personalized programming questions recommendation strategies to ensure that the recommended programming questions meet the learners' needs. Current learning process and abilities.
By making full use of the relevant feature information of programming questions and learners' historical knowledge status information, we can more accurately predict learners' answer performance, timely adjust recommendation strategies, and improve the personalized recommendation effect of programming questions.
Smart Images

Figure CN119271873A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a personalized programming question recommendation method based on a knowledge tracking model, and belongs to the technical field of information recommendation. Background Art
[0002] With the development of educational informatization, online education platforms have become one of the important ways for people to obtain learning resources and learn knowledge. The OJ (Online Judge) system is an online education platform for programming learning, which provides a wealth of programming question resources. Learners can write corresponding problem-solving codes according to the requirements of the programming questions, and then submit the code to the OJ system for automatic compilation and operation to check the correctness of the code. By completing programming questions, learners can consolidate their understanding of programming knowledge points and improve their own programming level.
[0003] Although the rich programming question resources in the OJ system can provide learners with a variety of learning options, due to the relatively simple organization and sorting method of its programming question bank, learners often face the dilemma of "information overload" and "learning wandering", and it is difficult to choose programming questions that are in line with their own learning progress and learning ability. How to recommend appropriate programming questions to learners to achieve personalized programming learning and improve learners' programming learning effects has become a technical problem that needs to be solved urgently.
[0004] At present, existing personalized learning recommendation technologies mainly use deep learning models to learn more accurate learner vector representations and learning resource vector representations to improve the recommendation effect, but rarely incorporate changes in learners' knowledge status into the recommendation process, which may result in the recommended programming questions not being in line with the learners' current learning progress and learning ability. Summary of the invention
[0005] The purpose of the present invention is to creatively provide a personalized programming question recommendation method based on a knowledge tracking model in view of the shortcomings and limitations of the prior art. This method, through the knowledge tracking model, integrates the learner's knowledge state change process into the programming question recommendation process, so that the recommended programming questions are in line with the learner's current learning progress and learning ability.
[0006] The present invention proposes a knowledge tracking model based on feature enhancement and attention mechanism, which makes full use of programming question information and learners' historical knowledge status information to more accurately predict learners' future answering performance. Combined with the above model, the present invention proposes a personalized programming question recommendation strategy, which incorporates the learners' knowledge status changes into the recommendation process, so as to recommend programming questions that meet the learners' current learning progress and learning ability.
[0007] Beneficial Effects
[0008] Compared with the prior art, the method of the present invention has the following advantages:
[0009] 1. This method makes full use of the feature information related to programming questions and the learner's historical knowledge status information, and can more accurately predict the learner's answering performance in the next time step.
[0010] 2. This method combines the knowledge tracking model into the programming question recommendation process, so that the programming question recommendation strategy can timely adjust the recommended questions according to the changes in the learner's knowledge status. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 It is a schematic diagram of the knowledge tracking model FAKT based on feature enhancement and attention mechanism of the method of the present invention.
[0012] Figure 2 It is a schematic diagram of a programming question feature information encoder of the method of the present invention.
[0013] Figure 3 It is a schematic diagram of the overall process FAKT-CQR of the personalized programming question recommendation strategy of the method of the present invention.
[0014] Figure 4 It is a flowchart of a programming question recommendation candidate set screening module of the method of the present invention.
[0015] Figure 5 It is a flowchart of a programming question recommendation list generation module of the method of the present invention. DETAILED DESCRIPTION
[0016] The method of the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0017] Example
[0018] A personalized programming question recommendation method based on knowledge tracking includes the following steps:
[0019] Step 1: Use the programming question feature information encoder to obtain the programming question information vector.
[0020] like Figure 2 , which is a schematic diagram of a programming question feature information encoder, wherein the encoder is used to integrate the question text information, optimal solution code information, difficulty label information, and knowledge point label information of the programming question into the programming question information vector.
[0021] Specifically, the steps include:
[0022] Step 1.1: Encode the programming question text information.
[0023] Specifically, the description text of the programming question is converted into a vector representation containing corresponding semantic information. In this embodiment, the jina-embeddings-v2-small-en pre-trained model provided by Jina AI can be directly used to encode the text of the programming question to obtain a 512-dimensional vector representation of the question text.
[0024] In order to balance the information content of each feature of the programming question, the obtained text vector representation is input into the fully connected layer for dimensionality reduction. As shown in Equation 1 and Equation 2:
[0025]
[0026] Where t represents the title text of the programming question; represents the text vector representation obtained through the pre-training model; q represents the final programming question text information vector after dimension reduction by the fully connected layer; W q and b q They represent the weight matrix and bias vector of the fully connected layer respectively, both of which are trainable parameters.
[0027] Step 1.2: Encode the optimal solution to the programming problem.
[0028] Specifically, the optimal solution code of the programming problem is converted into a vector representation containing the corresponding code information. In this embodiment, the InferCode model proposed by Bui et al. can be directly used to encode the optimal solution code of the programming problem. The tree-shaped convolutional neural network (TBCNN) used by the model encodes the AST of the code and trains it by predicting the self-supervision of the subtree. In addition, Bui et al. also provide a python tool library of the same name for easy calling. The optimal solution code of the programming problem is encoded using the InferCode library to obtain a 100-dimensional code vector representation.
[0029] In order to balance the information content of each feature of the programming question, the obtained code vector representation is input into the fully connected layer for dimensionality reduction. As shown in Equation 3 and Equation 4:
[0030]
[0031] Where c represents the optimal solution code of the programming problem; represents the code vector representation obtained through the InferCode library; p represents the final optimal solution information vector of the programming problem after dimension reduction by the fully connected layer; W p and b p They represent the weight matrix and bias vector of the fully connected layer respectively, both of which are trainable parameters.
[0032] Step 1.3: Encode the difficulty label of the programming question.
[0033] Specifically, the difficulty label of the programming problem is mapped into a difficulty information vector representation. The difficulty label of the programming problem can reflect the difficulty of the programming problem and is one of the important information describing the characteristics of the programming problem.
[0034] Furthermore, suppose there are m difficulty labels in total, and each programming question corresponds to one of the difficulty labels. The difficulty label information of the programming question is represented as a one-hot form Then the one-hot vector is multiplied by the low-dimensional mapping matrix to obtain a low-dimensional dense vector representation of the difficulty information. As shown in Formula 5:
[0035]
[0036] Where d represents the low-dimensional dense final programming problem difficulty information vector; W diff Represents a trainable low-dimensional mapping matrix.
[0037] Step 1.4: Label and encode the knowledge points of the programming questions.
[0038] Specifically, the knowledge point labels of programming questions are mapped into knowledge point information vector representations. The knowledge point labels of programming questions reflect the programming knowledge points involved in the programming questions, so the characterization of the characteristics of programming questions is also very important.
[0039] Furthermore, suppose there are n programming knowledge points in total, and each programming question corresponds to at least one knowledge point label. First, the knowledge point label information of the programming question is represented as a multi-hot form Then multiply the multi-hot vector by the low-dimensional mapping matrix and divide it by the number of knowledge points to obtain a low-dimensional dense knowledge point information vector representation. As shown in Formula 6:
[0040]
[0041] Among them, k represents the low-dimensional dense final programming question knowledge point information vector; Indicates the number of knowledge points involved in the programming question; W k Represents a trainable low-dimensional mapping matrix.
[0042] Step 1.5: Get the programming question information vector.
[0043] After obtaining the information vector of each feature of the programming problem, they are connected and input into the multi-layer perceptron for calculation to obtain a feature-enhanced programming problem information vector x.
[0044] Furthermore, the multi-layer perceptron includes three fully connected layers, and each layer uses the ReLU function as the activation function. As shown in Equation 7 and Equation 8:
[0045]
[0046] Among them, ⊕ represents the vector concatenation operation; represents the vector obtained by connecting the feature information vectors; x represents the final programming question information vector; Φ MLP Represents the trainable parameters of a multilayer perceptron.
[0047] Step 2: Learner knowledge status update.
[0048] like Figure 1 As shown. In order to more accurately model the learner's mastery of each programming knowledge point, the FAKT model uses vectors to represent the learner's knowledge state of a single programming knowledge point. The knowledge state vectors of n programming knowledge points constitute the learner's knowledge state matrix H. Each time a learner completes a programming question, the knowledge state of the knowledge point involved in the programming question will change according to the correctness of the answer. The FAKT model uses GRU units to model this process.
[0049] Step 2.1: Get the response vector.
[0050] First, the answer response vector is obtained. This vector consists of the programming question information vector x and the correctness of the answer, which represents the learner's answer performance on the corresponding programming question. As shown in Formula 9:
[0051]
[0052] Among them, x t represents the information vector of the programming questions answered by the learner at time t; 0 represents the same information as x t Zero vectors of the same dimension; r t represents the correctness of the learner's answer at time t; z t Represents the answer response vector at time t.
[0053] Step 2.2: Update the knowledge state using a GRU unit (gated recurrent unit).
[0054] Specifically, the knowledge state vector of the knowledge points involved in the programming question is used as the hidden state of the GRU unit, z t It is calculated as the input of the GRU unit. As shown in formula 10:
[0055]
[0056] Among them, K(e t ) represents the programming question e answered by the learner at time t t The set of knowledge points involved; represents the knowledge state of knowledge point i at time t; Indicates that the GRU unit is based on and the answer response vector zt The knowledge state of the updated knowledge point i. The specific calculation of the GRU unit is shown in equations 11 to 14:
[0057] u t =σ(W uh h t-1 +W uz z t +b u ) (11)
[0058] r t =σ(W rh h t-1 +W rz z t +b r ) (12)
[0059]
[0060] Among them, u t is the update gate at time t, r t is the reset gate at time t; W uh , W uz represents the weight matrix of the reset gate, W rh , W rz represents the weight matrix of the update gate, W hh , W hz represents the weight matrix of the candidate memory state; b is the bias vector, σ is the sigmoid activation function, tanh is the hyperbolic tangent activation function, and ⊙ represents the element-wise multiplication of the vector; for the GRU unit at time t, its input is z t 、h t-1 , the corresponding output is h t .
[0061] Step 3: Prediction of learners’ performance in answering questions.
[0062] For a new programming problem t+1 , the learner's knowledge status of the corresponding knowledge point of the programming question can be used to predict the correctness of the learner's answer. The FAKT model uses the scaled dot product attention mechanism to weighted sum the learner's historical knowledge status to obtain a more accurate representation of the learner's knowledge status, thereby better predicting the learner's correctness of the answer.
[0063] Step 3.1: Calculate the attention weight corresponding to each historical knowledge state.
[0064] Specifically, with programming questions t+1 The information vector x t+1 is the query vector, with the learner's historical programming questions (e1, e2, ..., e t)’s information vector (x1,x2,…,x t ) is the key vector, and the attention weight α is calculated i As shown in formula 15:
[0065]
[0066] Where T represents vector transpose.
[0067] Step 3.2: Obtain a comprehensive knowledge state by weighted summing of historical knowledge states.
[0068] Specifically, according to the programming question t+1 The knowledge points involved are combined with the attention weight calculated by formula 15 to perform a weighted summation of the learner's historical knowledge state As shown in formula 16:
[0069]
[0070] Among them, K(e t+1 ) represents the programming question e answered by the learner at time t+1 t+1 The set of knowledge points involved; |K(e t+1 )| represents the number of knowledge points; Represents the knowledge status of knowledge point k in the programming question at time i.
[0071] Step 3.3: Predict the correctness of the answer.
[0072] Specifically, the comprehensive knowledge state and programming questions t+1 The information vector x t+1 The prediction layer is connected and input to the prediction layer to predict the correctness of the learner's answer. The prediction layer includes two fully connected layers. The first layer uses the ReLU function as the activation function, and the second layer uses the sigmoid function as the activation function. As shown in Equation 17 and Equation 18:
[0073]
[0074] Among them, ⊕ represents the vector connection operation; y t+1 Represents the calculation results of the first fully connected layer; Indicates that the learner correctly answers the programming question e t+1 ; σ represents the sigmoid function; W1 and W2 represent weight matrices, b1 and b2 represent bias vectors, all of which are trainable parameters.
[0075] Step 4: Train the FAKT model.
[0076] One of the tasks of the knowledge tracking model is to predict whether the learner can answer a question correctly based on his knowledge status. The output result only contains two results: yes or no, so it can be regarded as a binary classification task.
[0077] During the model training process, by minimizing the predicted results and the actual result r t+1 The binary cross entropy loss between is used to optimize the model parameters. The loss function L is shown in Formula 19:
[0078]
[0079] Here, t represents the time step.
[0080] Step 5: Screening of candidate sets for programming question recommendations.
[0081] Specifically, the programming questions in the programming question bank are preliminarily screened according to the following two conditions: one is the learners' mastery of the knowledge points of the programming questions, and the other is the learners' predicted answering performance.
[0082] Use the FAKT model trained in steps 1 to 5 to obtain learners' mastery of programming knowledge points and their predicted performance in answering questions. Figure 4 shown.
[0083] Step 5.1: Select a set of programming questions of corresponding difficulty level based on the learners’ mastery of programming knowledge points.
[0084] Specifically, according to the learner's mastery of programming knowledge points, a sub-question set with an appropriate difficulty level is selected from the corresponding programming question set of the programming knowledge point. The FAKT model is used to analyze the learner's historical answer records to obtain the learner's corresponding knowledge state matrix H. Each column vector h i Represents the learner's knowledge state of the corresponding programming knowledge point. This knowledge state is input into the prediction layer of the FAKT model to obtain a number λ in the range of [0,1]. i , indicating the learner's mastery of the programming knowledge point. The calculation is shown in formula 20 and formula 21:
[0085] y = ReLU(W1[h i ⊕0]+b1) (20)
[0086]
[0087] Among them, y represents the calculation result of the first fully connected layer; σ represents the sigmoid function; W1 and W2 represent weight matrices, and b1 and b2 represent bias vectors. Represents the minimization prediction result.
[0088] Set a threshold range [α, β], and there are three sub-question set selection situations:
[0089] The learner's mastery of programming knowledge point i is 0<λ i ≤α, it means that the learner is not proficient in programming knowledge point i. You can do simple programming questions about programming knowledge point i to strengthen your foundation.
[0090] The learner's mastery of programming knowledge point i is α<λ i ≤β, indicating that the learner's proficiency in programming knowledge point i is moderate. You can further do medium-level programming questions to further deepen your mastery of programming knowledge point i.
[0091] The learner's mastery of programming knowledge point i is β<λ i ≤1, indicating that the learner has mastered programming knowledge point i and can do programming questions of higher difficulty to broaden his understanding of programming knowledge point i.
[0092] Furthermore, the set of sub-question sets obtained in this step is recorded as E1.
[0093] Step 5.2: Screen E1 based on the learners’ predicted performance.
[0094] To further ensure that the difficulty of the recommended programming questions is appropriate for learners, the programming questions in E1 are screened based on the learners' predicted answering performance.
[0095] For each programming question in E1 i , we can predict the probability p of the learner correctly answering the programming question based on the FAKT model i The corresponding calculation formulas are shown in Equation 17 and Equation 18.
[0096] Set an expected correct answer rate δ and calculate p i The distance from δ. As shown in formula 22:
[0097] distance(e i ,δ)=|δ-p i | (22)
[0098] Sort the programming questions in E1 according to the distance value from small to large, and take the first N programming questions to form the recommended candidate set of programming questions.
[0099] Step 6: Generate a recommended list of programming questions.
[0100] From the perspective of diversity, the questions in the recommended candidate set EC are screened again, and finally M programming questions are screened out and recommended to learners. EC is regarded as a high-dimensional space, where each programming question is regarded as a point in the space. The above screening conditions are transformed into M programming questions with the largest sum of distances in EC. This is a combinatorial optimization problem, which can be solved by the simulated annealing algorithm, such as Figure 5 shown.
[0101] Step 6.1: Initialization.
[0102] Assume the initial temperature is τ s , the termination temperature is τ e , the cooling coefficient is c. Randomly select M programming problems from EC as the initial solution L0, and define the objective function f as the sum of the distances of the M programming problems.
[0103] Step 6.2: Repeat the cycle at the same temperature.
[0104] Set the number of iterations to I, and perform the following steps in each iteration:
[0105] Step 6.2.1: Generate neighbor solutions.
[0106] Randomly select a non-repeated programming problem from EC and randomly replace the current solution L c A programming problem in generating neighbor solutions L n .
[0107] Step 6.2.2: Calculate the objective function difference between the current solution and the adjacent solution.
[0108] Use the objective function to calculate the current solution L c and neighbor solution L n The sum of the distances is calculated, and then the difference is taken. If the difference is less than 0, it means that the neighboring solution is better than the current solution.
[0109] Step 6.2.3: Accept the strategy.
[0110] If the neighboring solution is better than the current solution, the neighboring solution is accepted as the current solution; otherwise, the neighboring solution is accepted according to the Metropolis criterion with probability P. The probability P is calculated as shown in formula 23:
[0111]
[0112] Where T′ represents the current temperature; f() represents the target function. e is an exponential function with a constant e as the base.
[0113] Step 6.3: Record the optimal solution.
[0114] Compare the objective function values of the current solution and the optimal solution, and make the one with the larger objective function value the optimal solution.
[0115] Step 6.4: Update the temperature.
[0116] According to formula 24, the temperature value is reduced so that it gradually approaches the termination temperature.
[0117] T′=c×T′ (24) where c represents the temperature drop coefficient.
[0118] Step 6.5: Termination conditions.
[0119] If the temperature drops to the set threshold τ e When , stop the iteration; otherwise, continue to repeat steps 6.1 to 6.4.
[0120] Example
[0121] like Figure 3 As shown. After the learner has accumulated a certain amount of answer records, the knowledge tracking model FAKT in the present invention can be used to evaluate his or her mastery of each programming knowledge point. After the evaluation is completed, the pre-recommended programming question candidate set is first obtained through the programming question recommendation candidate set module. This module performs the first round of screening of programming questions based on the learner's mastery of each programming knowledge point and the predicted answer performance of each programming question to ensure that the recommended programming questions are of moderate difficulty; then, the final recommended programming set is screened out from the programming question recommendation candidate set using the programming question recommendation list generation module. This module performs a second round of screening of programming questions from a diversity perspective to ensure the learner's interest in learning programming questions; after the learner completes the recommended programming questions, the FAKT model is continued to be used to update and evaluate its knowledge status, and then a new round of programming question recommendations is performed, which is repeated, reflecting the dynamic changes in the learner's knowledge status during the programming learning process.
[0122] Specifically, the following steps are included:
[0123] Step 1: Use the programming question feature information encoder to obtain the programming question information vector.
[0124] Step 1 includes the following sub-steps:
[0125] Step 1.1: Encode the programming question text information.
[0126] Step 1.2: Encode the optimal solution to the programming problem.
[0127] Step 1.3: Encode the difficulty label of the programming question.
[0128] Step 1.4: Label and encode the knowledge points of the programming questions.
[0129] Step 1.5: Get the programming question information vector.
[0130] After obtaining the information vector of each feature of the programming problem through the above steps, they are connected and input into the multi-layer perceptron for calculation to obtain a feature-enhanced programming problem information vector.
[0131] Step 2: Learner knowledge status update.
[0132] Step 2 includes the following sub-steps:
[0133] Step 2.1: Get the response vector.
[0134] First, the answer response vector is obtained. The vector consists of the programming question information vector x and the correctness of the answer to the question, so as to represent the learner's answer performance on the corresponding programming question.
[0135] Step 2.2: Update the knowledge state using GRU units.
[0136] The knowledge state vector of the knowledge points involved in the programming question is used as the hidden state of the GRU unit, z t Calculated as input to the GRU unit.
[0137] Step 3: Prediction of learners’ performance in answering questions.
[0138] Step 3 includes the following sub-steps:
[0139] Step 3.1: Calculate the attention weight corresponding to each historical knowledge state.
[0140] Programming questions t+1 The information vector x t+1 is the query vector, with the learner's historical programming questions (e1, e2, ..., e t )’s information vector (x1,x2,…,x t ) is the key vector and the attention weight is calculated.
[0141] Step 3.2: Obtain a comprehensive knowledge state by weighted summing of historical knowledge states.
[0142] According to the programming question t+1 The knowledge points involved are combined with the attention weights calculated in step 3.1 to perform weighted summation on the learner’s historical knowledge state to obtain a comprehensive knowledge state.
[0143] Step 3.3: Predict the correctness of the answer.
[0144] Combine the knowledge status and programming questions t+1 The information vector x t+1 Connect them and input them into the prediction layer to predict whether the learner’s answer is correct or not.
[0145] Step 4: Train the FAKT model.
[0146] Step 5: Screening of candidate sets for programming question recommendations.
[0147] Step 5 includes the following sub-steps:
[0148] Step 5.1: According to the learners' mastery of programming knowledge points, select programming question sub-sets of corresponding difficulty levels, and record the set of all selected sub-sets as E1.
[0149] Step 5.2: Filter E1 according to the learner's predicted answer performance to obtain the programming question candidate set EC.
[0150] Step 6: Generate a recommended list of programming questions.
[0151] This step mainly performs secondary screening of the questions in the candidate set EC for programming question recommendation from the perspective of diversity, and finally selects M programming questions to recommend to learners. This step is solved by the simulated annealing algorithm, and includes the following sub-steps:
[0152] Step 6.1: Set the initial temperature to τ s , the termination temperature is τ e , the cooling coefficient is c, M programming problems are randomly selected from EC as the initial solution L0, and the objective function f is defined as the sum of the distances of the M programming problems.
[0153] Step 6.2: Iterate repeatedly at the same temperature. Set the number of iterations to I, and perform the following steps in each iteration:
[0154] Step 6.2.1: Generate neighboring solutions. Randomly select a non-repeated programming problem from EC and randomly replace the current solution L c A programming problem in generating neighbor solutions L n .
[0155] Step 6.2.1: Calculate the objective function difference between the current solution and the neighboring solution. Use the objective function to calculate the current solution L c and neighbor solution L n The sum of the distances is calculated, and then the difference is taken. If the difference is less than 0, it means that the neighboring solution is better than the current solution.
[0156] Step 6.2.3: Acceptance strategy: If the neighboring solution is better than the current solution, accept the neighboring solution as the current solution; otherwise, accept the neighboring solution with a certain probability according to the Metropolis criterion.
[0157] Step 6.3: Compare the objective function values of the current solution and the optimal solution, and make the one with the larger objective function value the optimal solution.
[0158] Step 6.4: Gradually reduce the temperature value until it gradually approaches the termination temperature.
[0159] Step 6.5: If the temperature drops to the set threshold τ e When , stop the iteration; otherwise, continue to repeat steps 6.1 to 6.4.
[0160] In order to illustrate the content and implementation method of the present invention, this specification provides a specific embodiment. The purpose of introducing details in the embodiment is not to limit the scope of the claims, but to help understand the method of the present invention. Those skilled in the art should understand that various modifications, changes or replacements of the steps of the best embodiment are possible without departing from the spirit and scope of the present invention and the claims attached thereto. Therefore, the present invention should not be limited to the content disclosed in the best embodiment and the drawings.
Claims
1. A personalized programming question recommendation method based on a knowledge tracking model, characterized in that: Through the knowledge tracking model, the learner's knowledge state change process is integrated into the programming question recommendation process, so that the recommended programming questions are in line with the learner's current learning progress and learning ability, including the following steps: Step 1: Use the programming question feature information encoder to obtain the programming question information vector; Schematic diagram of a programming question feature information encoder, which is used to integrate the question text information, optimal solution code information, difficulty label information, and knowledge point label information of the programming question into the programming question information vector; Step 2: Learner knowledge status update; The FAKT model uses vectors to represent the learner's knowledge state of a single programming knowledge point. The knowledge state vectors of n programming knowledge points form the learner's knowledge state matrix H. Each time a learner completes a programming problem, the knowledge state of the knowledge point involved in the programming problem will change according to the correctness of the answer. The FAKT model uses GRU units to model this process. Step 3: Prediction of learners’ performance in answering questions; For a new programming problem t+1 , predict the correctness of the learner's answer through the learner's knowledge state of the corresponding knowledge point of the programming question; the FAKT model uses the scaled dot product attention mechanism to weighted sum the learner's historical knowledge state to obtain a more accurate representation of the learner's knowledge state, thereby better predicting the correctness of the learner's answer; Step 4: Train the FAKT model; During the model training process, by minimizing the predicted results and the actual result r t+1 The binary cross entropy loss between is used to optimize the parameters of the model; the loss function L is shown as follows: Where t represents the time step; Step 5: Screening of candidate sets for programming question recommendations; The programming questions in the programming question bank are preliminarily screened based on the following two conditions: first, the learner's mastery of the knowledge points of the programming questions, and second, the learner's predicted answering performance; Use the trained FAKT model to obtain learners’ mastery of programming knowledge points and learners’ predicted performance in answering questions; Step 6: Generate a recommended list of programming questions; From the perspective of diversity, the questions in the programming question recommendation candidate set EC are secondary screened, and finally M programming questions are screened out and recommended to learners; EC is regarded as a high-dimensional space, in which each programming question is regarded as a point in the space, and the above screening conditions are converted into M programming questions with the largest sum of distances in EC.
2. A personalized programming question recommendation method based on a knowledge tracking model as claimed in claim 1, characterized in that: Step 1 includes the following steps: Step 1.1: Encode the text information of the programming question; The description text of the programming question is converted into a vector representation containing the corresponding semantic information; the obtained text vector representation is input into the fully connected layer for dimensionality reduction, as shown in Equation 1 and Equation 2: Where t represents the title text of the programming question; represents the text vector representation obtained through the pre-training model; q represents the final programming question text information vector after dimension reduction by the fully connected layer; W q and b q They represent the weight matrix and bias vector of the fully connected layer, respectively, and are both trainable parameters; Step 1.2: Encode the optimal solution to the programming problem; The optimal solution code of the programming problem is converted into a vector representation containing the corresponding code information; the obtained code vector representation is input into the fully connected layer for dimensionality reduction, as shown in Equation 3 and Equation 4: Where c represents the optimal solution code of the programming problem; represents the code vector representation obtained through the InferCode library; p represents the final optimal solution information vector of the programming problem after dimension reduction by the fully connected layer; W p and b p They represent the weight matrix and bias vector of the fully connected layer, respectively, and are both trainable parameters; Step 1.3: Encode the difficulty label of the programming question; Map the difficulty label of the programming problem into a difficulty information vector representation; Assume there are m difficulty labels in total, and each programming question corresponds to one of the difficulty labels; the difficulty label information of the programming question is represented as a one-hot form Then the one-hot vector is multiplied by the low-dimensional mapping matrix to obtain a low-dimensional dense vector representation of the difficulty information, as shown in Equation 5: Where d represents the low-dimensional dense final programming problem difficulty information vector; W diff Represents a trainable low-dimensional mapping matrix; Step 1.4: Label coding of knowledge points in programming questions; Map the knowledge point labels of programming questions into knowledge point information vector representations; Assume there are n programming knowledge points in total, and each programming question corresponds to at least one knowledge point label; first, the knowledge point label information of the programming question is represented as a multi-hot form Then, the multi-hot vector is multiplied by the low-dimensional mapping matrix and divided by the number of knowledge points to obtain a low-dimensional dense knowledge point information vector representation, as shown in Equation 6: Among them, k represents the low-dimensional dense final programming question knowledge point information vector; Indicates the number of knowledge points involved in the programming question; W k Represents a trainable low-dimensional mapping matrix; Step 1.5: Get the programming question information vector; After obtaining the information vector of each feature of the programming problem, connect them and input them into the multi-layer perceptron for calculation to obtain a feature-enhanced programming problem information vector x; The multi-layer perceptron consists of three fully connected layers, each of which uses the ReLU function as the activation function; as shown in Equation 7 and Equation 8: in, Represents a vector concatenation operation; represents the vector obtained by connecting the feature information vectors; x represents the final programming question information vector; Φ MLP Represents the trainable parameters of a multilayer perceptron.
3. A personalized programming question recommendation method based on a knowledge tracking model as claimed in claim 1, characterized in that: Step 2 includes the following steps: Step 2.1: Get the answer response vector; First, the answer response vector is obtained. This vector consists of the programming question information vector x and the correctness of the answer, which represents the learner's answer performance for the corresponding programming question; as shown in Formula 9: Among them, x t represents the information vector of the programming questions answered by the learner at time t; 0 represents the same information as x t Zero vectors of the same dimension; r t represents the correctness of the learner's answer at time t; z t represents the answer response vector at time t; Step 2.2: Update the knowledge state using GRU units; The knowledge state vector of the knowledge points involved in the programming question is used as the hidden state of the GRU unit, z t It is calculated as the input of the GRU unit; as shown in formula 10: Among them, K(e t ) represents the programming question e answered by the learner at time t t The set of knowledge points involved; represents the knowledge state of knowledge point i at time t; Indicates that the GRU unit is based on and the answer response vector z t The knowledge state of the updated knowledge point i; the specific calculation of the GRU unit is shown in Equations 11 to 14: u t =σ(W uh h t-1 +W uz z t +b u ) (11) r t =σ(W rh h t-1 +W rz z t +b r ) (12) Among them, u t is the update gate at time t, r t is the reset gate at time t; W uh , W uz Represents the weight matrix of the reset gate, W rh , W rz represents the weight matrix of the update gate, W hh , W hz represents the weight matrix of the candidate memory state; b is the bias vector, σ is the sigmoid activation function, tanh is the hyperbolic tangent activation function, and ⊙ represents the element-wise multiplication of the vector; for the GRU unit at time t, its input is z t 、h t-1 , the corresponding output is h t .
4. A personalized programming question recommendation method based on a knowledge tracking model as claimed in claim 1, characterized in that: Step 3 includes the following steps: Step 3.1: Calculate the attention weight corresponding to each historical knowledge state; Programming questions t+1 The information vector x t+1 is the query vector, with the learner's historical programming questions (e1, e2, ..., e t )’s information vector (x1,x2,…,x t ) is the key vector, and the attention weight α is calculated i ; As shown in formula 15: Where T represents vector transpose; Step 3.2: Obtain a comprehensive knowledge state by weighted summing of historical knowledge states; According to the programming question t+1 The knowledge points involved are combined with the attention weight calculated by formula 15 to perform a weighted summation of the learner's historical knowledge state As shown in formula 16: Among them, K(e t+1 ) represents the programming question e answered by the learner at time t+1 t+1 The set of knowledge points involved; |K(e t+1 )| represents the number of knowledge points; Represents the knowledge status of knowledge point j of programming question at time i; Step 3.3: Prediction of the correct rate of answering questions; The integrated state of knowledge and programming questions t+1 The information vector x t+1 The prediction layer is connected to the input layer to predict the correctness of the learner's answer; the prediction layer includes two fully connected layers, the first layer uses the ReLU function as the activation function, and the second layer uses the sigmoid function as the activation function; as shown in Equation 17 and Equation 18: in, Represents a vector concatenation operation; y t+1 Represents the calculation results of the first fully connected layer; Indicates that the learner correctly answers the programming question e t+1 ; σ represents the sigmoid function; W1 and W2 represent weight matrices, b1 and b2 represent bias vectors, all of which are trainable parameters.
5. A personalized programming question recommendation method based on a knowledge tracking model as claimed in claim 1, characterized in that: Step 5 includes the following steps: Step 5.1: Select a set of programming questions of corresponding difficulty level according to the learner's mastery of programming knowledge points; According to the learner's mastery of programming knowledge points, select sub-question sets with appropriate difficulty levels from the corresponding programming question sets of programming knowledge points; use the FAKT model to analyze the learner's historical answer records to obtain the learner's corresponding knowledge state matrix H. Each column vector h of this matrix i Represents the learner's knowledge state of the corresponding programming knowledge point; this knowledge state is input into the prediction layer of the FAKT model to obtain a number λ in the range of [0,1] i , indicating the learner's mastery of the programming knowledge point; the calculation is shown in formula 20 and formula 21: Where y represents the calculation result of the first fully connected layer; σ represents the sigmoid function; W1 and W2 represent weight matrices, and b1 and b2 represent bias vectors; represents the minimization prediction result; Set a threshold range [α, β], and there are three sub-question set selection situations: The learner's mastery of programming knowledge point i is 0<λ i ≤α, indicating that the learner is not proficient in programming knowledge point i, and can strengthen the foundation by doing simple programming questions about programming knowledge point i; The learner's mastery of programming knowledge point i is α<λ i ≤β, indicating that the learner has a moderate level of proficiency in programming knowledge point i, and can further deepen his mastery of programming knowledge point i by doing medium-level programming questions; The learner's mastery of programming knowledge point i is β<λ i ≤1, indicating that the learner has mastered programming knowledge point i and broadens his understanding of programming knowledge point i by doing programming problems of higher difficulty levels; The set of sub-questions obtained in this step is recorded as E1; Step 5.2: Screen E1 based on learners’ predicted performance; The programming questions in E1 were screened based on the learners’ predicted performance; For each programming question in E1 i , according to the FAKT model, predict the probability p of the learner correctly answering the programming question i , as shown in equations 17 and 18; Set an expected correct answer rate δ and calculate p i The distance from δ is shown in Equation 22: distance(e i ,δ)=|δ-p i | (22) Sort the programming questions in E1 according to the distance value from small to large, and take the first N programming questions to form the recommended candidate set of programming questions.
6. A personalized programming question recommendation method based on a knowledge tracking model as claimed in claim 1, characterized in that: Step 6 includes the following steps: Step 6.1: Initialization; Assume the initial temperature is τ s , the termination temperature is τ e , the cooling coefficient is c; randomly select M programming problems from EC as the initial solution L0, and define the objective function f as the sum of the distances of the M programming problems; Step 6.2: Iterate the cycle at the same temperature; Set the number of iterations to I, and perform the following steps in each iteration: Step 6.2.1: Generate neighbor solutions; Randomly select a non-repeated programming problem from EC and randomly replace the current solution L c A programming problem in generating neighbor solutions L n ; Step 6.2.2: Calculate the objective function difference between the current solution and the adjacent solution; Use the objective function to calculate the current solution L c and neighbor solution L n The sum of the distances is calculated, and then the difference is taken. If the difference is less than 0, it means that the neighboring solution is better than the current solution. Step 6.2.3: Accept the strategy; If the neighboring solution is better than the current solution, the neighboring solution is accepted as the current solution; otherwise, the neighboring solution is accepted according to the Metropolis criterion with probability P; the probability P is calculated as shown in formula 23: Wherein, T′ represents the current temperature; f() represents the target function; e is an exponential function with constant e as the base; Step 6.3: Record the optimal solution; Compare the objective function values of the current solution and the optimal solution, and make the larger objective function value the optimal solution; Step 6.4: Update temperature; According to formula 24, reduce the temperature value so that it gradually approaches the termination temperature; T′=c×T′ (24)where c represents the temperature drop coefficient; Step 6.5: Termination conditions; If the temperature drops to the set threshold τ e When , stop the iteration; otherwise, continue to repeat steps 6.1 to 6.4.
Citation Information
Cited By
Personalized programming question recommendation method fusing dynamic interaction information
CN120892633A
