Resource recommendation method and device based on cognitive diagnosis, medium and equipment
By acquiring the assessment knowledge points associated with code blocks, and using a large language model for feature extraction and weight fusion, cognitive level diagnostic results are generated. This solves the problem of the inability to assess students' mastery in programming education systems, enables targeted learning resource recommendations, and improves learning efficiency.
Patent Information
- Application Number
- CN202510894069.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-10-31
AI Technical Summary
Existing programming education systems struggle to assess students' mastery of concepts, making it difficult to recommend targeted learning resources.
By acquiring the assessment knowledge points associated with the code block, feature extraction is performed using a large language model to obtain quality scores in multiple dimensions, and weighted fusion is performed to generate cognitive level diagnostic results and push educational resources.
It enables automated assessment of students' mastery of knowledge points, improves the relevance of learning resource recommendations, and enhances learning efficiency.
Smart Images

Figure CN120873276A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, medium and device for resource recommendation based on cognitive diagnosis. Background Technology
[0002] With the development of computer technology, computer programming has become one of the most competitive skills. Programming education aims to cultivate learners' ability to understand and create computer programs, and to provide learners with computer programming knowledge and systematic learning methods.
[0003] Currently, existing programming education systems struggle to assess students' mastery of knowledge points, making it difficult to recommend targeted learning resources. For example, coding assignments are a crucial indicator of student understanding; reviewing them reveals areas where students' knowledge is weak. Traditionally, assignment review is done manually, but this is inefficient and unsuitable for large-scale programming education platforms. Existing automated assignment review methods rely primarily on automated scoring tools. However, these tools only verify the code output, offering a limited evaluation dimension and failing to accurately assess students' understanding, thus hindering the ability to recommend targeted learning resources. Summary of the Invention
[0004] In view of this, this application provides a resource recommendation method, apparatus, medium and device based on cognitive diagnosis, the main purpose of which is to solve the problem that existing programming education systems have difficulty in assessing students' mastery of knowledge points, and thus cannot recommend targeted learning resources.
[0005] Firstly, this application provides a resource recommendation method based on cognitive diagnosis, including:
[0006] The assessment knowledge points associated with the code block are obtained by matching the relevance of the code block to multiple nodes in the knowledge graph. The nodes correspond to the knowledge points in the textbook document. The nodes include node attribute information, which is used to describe the assessment characteristics of the knowledge points corresponding to the nodes.
[0007] The attribute information of the knowledge points to be assessed, as well as the code blocks, are input into a large language model for feature extraction, and quality scores of multiple dimensions corresponding to the code blocks are obtained.
[0008] The quality scores of multiple dimensions corresponding to the code block are fused together with the first weight to obtain the cognitive level diagnostic results corresponding to the assessment knowledge points. The cognitive level diagnostic results represent the author of the code block's mastery of the assessment knowledge points.
[0009] Based on the cognitive level diagnosis results, educational resources are pushed to you.
[0010] Secondly, embodiments of this application provide a resource recommendation device based on cognitive diagnosis, comprising:
[0011] The acquisition module is configured to acquire the assessment knowledge points associated with the code block. The assessment knowledge points are obtained by matching the relevance of multiple nodes in the knowledge graph based on the code block. The nodes correspond to the knowledge points in the textbook document. The nodes include node attribute information, which is used to describe the assessment characteristics of the knowledge points corresponding to the nodes.
[0012] The feature extraction module is configured to input the attribute information of the knowledge points to be assessed, as well as the code block, into the large language model for feature extraction, and obtain quality scores of multiple dimensions corresponding to the code block.
[0013] The diagnostic module is configured to fuse the quality scores of multiple dimensions corresponding to the code block with the first weight to obtain the cognitive level diagnostic result corresponding to the knowledge point being assessed. The cognitive level diagnostic result represents the author of the code block's mastery of the knowledge point being assessed.
[0014] The recommendation module is configured to push educational resources based on the cognitive level diagnosis results.
[0015] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the resource recommendation method based on cognitive diagnosis of the first aspect.
[0016] Fourthly, this application provides an electronic device, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the computer program to implement the resource recommendation method based on cognitive diagnosis of the first aspect.
[0017] By employing the above technical solution, this application provides a resource recommendation method, apparatus, medium, and device based on cognitive diagnosis. Compared with existing technologies, this application locates the knowledge point range corresponding to the cognitive diagnosis by obtaining the assessment knowledge points with the highest relevance to the code block. Then, a large language model is used to evaluate the code block to obtain quality scores across multiple dimensions. Next, the quality scores from multiple dimensions are fused using a first weighting to obtain the cognitive level diagnostic result corresponding to the assessment knowledge point. This achieves automated assessment of the student's mastery of the knowledge point. Furthermore, based on the cognitive level diagnostic result, educational resources are pushed, enabling targeted recommendations of learning resources based on the student's mastery of the knowledge point, thereby improving learning efficiency. Attached Figure Description
[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 The illustration shows a flowchart of a resource recommendation method based on cognitive diagnosis provided in an embodiment of this application;
[0021] Figure 2 The illustration shows a flowchart of a resource recommendation method based on cognitive diagnosis provided in an embodiment of this application;
[0022] Figure 3 The illustration shows a flowchart of a resource recommendation method based on cognitive diagnosis provided in an embodiment of this application;
[0023] Figure 4 The illustration shows a flowchart of a resource recommendation method based on cognitive diagnosis provided in an embodiment of this application;
[0024] Figure 5 A flowchart illustrating an example provided in an embodiment of this application is shown;
[0025] Figure 6 A schematic diagram of the structure of a resource recommendation device based on cognitive diagnosis provided in an embodiment of this application is shown;
[0026] Figure 7 A schematic diagram of the structure of a resource recommendation device based on cognitive diagnosis provided in an embodiment of this application is shown;
[0027] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0028] The embodiments of this application will now be described in more detail with reference to the accompanying drawings. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0029] To address the problem in current programming education systems where it's difficult to assess students' mastery of knowledge points, thus hindering the recommendation of targeted learning resources, this application provides a resource recommendation method, apparatus, medium, and device based on cognitive diagnosis. Figure 1 As shown, the method includes:
[0030] Step 101: Obtain the assessment knowledge points associated with the code block.
[0031] In this system, code blocks are erroneous code snippets submitted by students. There can be one or more code blocks, and each code block must have at least one matching knowledge point. The assessment knowledge points are derived by matching the code blocks with multiple nodes in the knowledge graph. In some examples, the assessment knowledge point is the one with the highest relevance to the code block among the multiple knowledge points in the textbook document. Nodes correspond to knowledge points in the textbook document; each node in the knowledge graph corresponds one-to-one with a knowledge point in the textbook document. A node can be identical to a knowledge point in content, or it can be a structured representation of the knowledge point's content. Nodes include node attribute information, which describes the assessment characteristics of their corresponding knowledge point. In some examples, the assessment characteristics of a knowledge point may include, for example, syntactic features, contextual semantic features, and cognitive level labels.
[0032] For example, cognitive level labels can be based on Bloom's hierarchy of knowledge, which describes the learner's level of mastery of knowledge. Bloom's hierarchy of knowledge consists of six levels, ordered from lowest to highest level of mastery: memory level, comprehension level, application level, analysis level, evaluation level, and creation level. In this embodiment, cognitive level labels are represented by level identifier values, which correspond one-to-one with Bloom's hierarchy of knowledge. For example, L1 corresponds to the memory level, L2 to the comprehension level, L3 to the application level, L4 to the analysis level, L5 to the evaluation level, and L6 to the creation level.
[0033] Step 102: Input the features of the knowledge points to be assessed and the code blocks into the large language model for feature extraction to obtain quality scores for multiple dimensions corresponding to the code blocks.
[0034] The Large Language Model (LLM) is a deep learning-based artificial intelligence model. In this embodiment, the LLM used includes, but is not limited to, the Claude 3 model. Multiple quality scores corresponding to code blocks are used to characterize the quality of the code blocks written by the learner from multiple dimensions. In this embodiment, the multiple quality scores output by the LLM may include, for example, syntactic quality score, comment quality score, test coverage score, code complexity score, code optimization score, and innovativeness score.
[0035] In some examples, factors influencing the syntax quality score include the number of syntax errors. After obtaining the number of syntax errors, the value is normalized, and then the normalized value is subtracted from 1 to obtain the syntax quality score. Factors influencing the comment quality score include the presence of comments, the relevance of comments to the code block, and their level of detail. Factors influencing the test coverage score include the proportion of code jobs covered by tests. Factors influencing the code complexity score include the number of lines of code in the code block that implements the target functionality, the level of nesting, etc. Factors influencing the code optimization score include the performance improvement compared to standard code that implements the target functionality. Factors influencing the innovativeness score include whether design patterns are used or whether innovative solutions exist.
[0036] Step 103: Perform first-weighted fusion of the quality scores of multiple dimensions corresponding to the code block to obtain the cognitive level diagnostic results corresponding to the knowledge points being assessed.
[0037] Among them, the cognitive level diagnostic results represent the degree to which the author (trainee) of the code block has mastered the knowledge points being assessed.
[0038] In some examples, corresponding weight values are set according to the degree of influence of different dimensions on the cognitive level diagnosis results. Then, the quality scores of multiple dimensions are fused by first weighting according to the quality scores of different dimensions and their corresponding weight values to obtain the cognitive level diagnosis results of the trainees on the assessment knowledge points.
[0039] Step 104: Based on the cognitive level diagnosis results, push educational resources.
[0040] The educational resources can be in the form of teaching videos, audio, text, etc. They can be pushed out directly or as links, allowing students to access the resources by clicking on the links.
[0041] Compared to existing technologies, this application identifies the knowledge points most relevant to the code block for assessment, thus defining the scope of knowledge points corresponding to the cognitive diagnosis. Then, a large language model is used to evaluate the code block, obtaining quality scores across multiple dimensions. These quality scores are then weighted and fused to obtain the cognitive level diagnostic result corresponding to the assessment knowledge points. This achieves automated assessment of the student's mastery of the knowledge points. Furthermore, based on the cognitive level diagnostic results, educational resources are recommended, enabling targeted learning resource recommendations based on the student's knowledge point mastery, thereby improving learning efficiency.
[0042] As a refinement and extension of the above embodiments, when retrieving assessment knowledge points associated with code blocks, the following methods can be used, but are not limited to: Figure 2 As shown, the method includes:
[0043] Step 1011: Perform syntax feature matching on the code block based on the syntax features of the knowledge points. Among multiple knowledge points, obtain candidate knowledge points whose syntax matching value with the code block is greater than the first preset threshold.
[0044] In some examples, the syntactic features of knowledge points can be obtained by querying the node attribute information included in the knowledge graph.
[0045] For example, a knowledge graph is a structured semantic network whose basic components include nodes, node relationships, and node attributes. The triple network structure composed of nodes, node relationships, and node attributes can be stored in a graph database (e.g., Neo4j, Janus Graph). Then, a matching algorithm is used to perform syntactic feature matching between the code block and the knowledge graph stored in the graph database, obtaining at least one candidate node whose syntactic matching value with the code block is greater than a first preset threshold, thereby obtaining candidate knowledge points corresponding to the candidate nodes.
[0046] In some examples, the first preset threshold can be pre-set based on the similarity of syntactic features. The matching algorithm is used to match the code block with the knowledge graph stored in the graph database to obtain the syntactic matching value of the node. Then, the syntactic matching value is compared with the first preset threshold. Nodes with syntactic matching values higher than the first preset threshold are selected as candidate nodes, and then candidate knowledge points corresponding to the candidate nodes are obtained.
[0047] In some examples, the similarity of syntactic features can be defined as: Syntactic_Match = 1 / (1 + level_diff).
[0048] Here, Syntactic_Match represents the syntax matching value, and level_diff represents the difference level between the code block and the syntax structure indicated by the knowledge point. The greater the difference level between the code block and the syntax structure indicated by the knowledge point, the larger the level_diff value.
[0049] For example, the code block might be based on a counting loop (For loop), while the knowledge point indicates a conditional loop (While loop). Both are loop structures, but different in type. The `level_diff` value can be the first value, such as 1. Another example: the code block might be a conditional statement (if-else), while the knowledge point indicates a For loop. Their structures and types are different, and the `level_diff` value can be the second value, such as 2. Yet another example: the code block might be based on a For loop, and the knowledge point also uses a For loop. Both have the same structure and type, and the `level_diff` value can be the third value, such as 0. The smaller the `level_diff` value, the closer the `Syntactic_Match` value is to 1; the larger the `level_diff` value, the closer the `Syntactic_Match` value is to 0.
[0050] In some examples, code blocks can be converted into abstract syntax trees (ASTs) using an abstract syntax tree (AST) parser. ASTs are used to represent the syntactic features of code blocks.
[0051] Step 1012: Perform contextual semantic feature matching on the code block based on the semantic vector of the knowledge point. Among multiple knowledge points, obtain candidate knowledge points whose semantic approximation value with the code block is greater than the second preset threshold.
[0052] In some examples, the semantic vectors of knowledge points can be obtained by querying a graph database.
[0053] In some examples, the second preset threshold can be pre-set based on the degree of approximation of the context semantic features. The matching algorithm is used to match the code block with the knowledge graph stored in the graph database to obtain the semantic approximation value of the node. Then, the semantic approximation value of the node is compared with the second preset threshold. Nodes with semantic approximation values higher than the first preset threshold are selected as candidate nodes, thereby obtaining the candidate knowledge points corresponding to the candidate nodes.
[0054] In some examples, the similarity of contextual semantics can be determined as: Semantic_Similarity = BERT_Score(knowledge, code_context).
[0055] Among them, Semantic_Similarity represents the semantic approximation value. The higher the Semantic_Similarity value, the more relevant the contextual semantics of the code block are to the contextual semantics of the knowledge point description.
[0056] BERT_Score(knowledge, code_context) represents the cosine similarity between the semantic vector of a code block and the semantic vector of a node. In the example, the semantic vectors of the code block and the node can be obtained using a pre-trained language model (BERT).
[0057] Step 1013: Obtain the error association compensation value of the candidate knowledge point based on the number of times the code block and the candidate knowledge point co-occur.
[0058] In some examples, the error association compensation value represents the number of times the knowledge point and such errors co-occur in historical data. In this embodiment, since a code block is defined as code with errors in a coding job, the error association compensation value represents the number of times the code block and candidate knowledge points co-occur. It should be noted that the correlation between non-candidate knowledge points and code blocks is relatively low, and the co-occurrence frequency of non-candidate knowledge points and code blocks is not considered here.
[0059] In some examples, the error correlation compensation value can be defined as: Error_Correlation = log(1 + error_frequency) / log(1 + max_error_frequency).
[0060] Here, `error_frequency` represents the number of times the knowledge point and the code block co-occur in historical data, and `max_error_frequency` is the preset maximum number of co-occurrences. Taking the logarithm of the `Error_Correlation` value can prevent the dominant influence of excessive co-occurrences, and adding 1 can prevent the logarithm from being negative infinity. When the co-occurrence frequency of a code block and a knowledge point is high, the `Error_Correlation` value increases.
[0061] Step 1014: Perform second weight fusion on the grammar matching value, semantic approximation value, and error association compensation value of the candidate knowledge points according to the second preset fusion weight ratio to obtain the second fusion value of the candidate knowledge points;
[0062] The second preset fusion weight ratio represents the degree of influence of grammatical matching value, semantic approximation value, and error association compensation value on determining the knowledge points to be assessed. In some examples, the object of the second preset fusion weight ratio may include: grammatical structure, contextual semantics, and error association compensation.
[0063] For example, the second preset fusion weight ratio can be set to (0.4, 0.5, 0.1). This means that the syntax matching value accounts for 40% of the second fusion value, the semantic approximation value accounts for 50% of the second fusion value, and the error association compensation value accounts for 10% of the second fusion value.
[0064] It should be noted that the second preset fusion weight ratio can also be set to other values according to the actual situation, and this application embodiment does not impose any restrictions.
[0065] Step 1015: Sort the second fusion values of multiple candidate knowledge points, and obtain the assessment knowledge points associated with the code block based on the sorting results.
[0066] For example, after obtaining the second fusion value of multiple candidate knowledge points, the candidate knowledge points can be sorted according to the magnitude of the second fusion value. The candidate knowledge point with the highest second fusion value is selected as the assessment knowledge point.
[0067] In some examples, after obtaining the assessment knowledge points corresponding to the code block, the error_frequency value can be updated and saved. The updated error_frequency value is used for subsequent calculation of error-related compensation values.
[0068] In this embodiment, the knowledge point most similar to the code block can be matched from the graph database storing the knowledge graph. Using this knowledge point as the assessment knowledge point can accurately diagnose the learner's cognitive level. Furthermore, learning resources can be precisely recommended based on the learner's cognitive level diagnosis results, improving the learner's learning efficiency.
[0069] As a refinement and extension of the above embodiments, when performing a first-weighted fusion of the quality scores of multiple dimensions corresponding to the code block to obtain the cognitive level diagnostic result corresponding to the assessed knowledge point, the following methods may be used, such as... Figure 3 As shown, the method includes:
[0070] Step 1031: Based on the first preset fusion weight ratio, perform first weight fusion on the syntax quality score, comment quality score, test coverage score, code complexity score, code optimization score, and innovation score corresponding to the code block to obtain the first fusion value.
[0071] The first preset fusion weight ratio represents the degree of influence of the quality score of each dimension on the cognitive level diagnostic results. In some examples, the objects of the first preset fusion weight ratio may include: syntax quality, annotation quality, test coverage, code complexity, code optimization level, and innovativeness.
[0072] In some examples, the objects whose weight ratios are combined correspond to Bloom's cognitive levels, such as syntax quality corresponding to the memory level, annotation quality corresponding to the comprehension level, test coverage corresponding to the application level, code complexity corresponding to the analysis level, code optimization level corresponding to the evaluation level, and innovativeness corresponding to the creation level.
[0073] For example, the first preset fusion weight ratio can be set to (0.1, 0.15, 0.25, 0.2, 0.15, 0.15). This represents the following weights: syntax quality score accounts for 10% of the first fusion value, comment quality score accounts for 15% of the first fusion value, test coverage score accounts for 25% of the first fusion value, code complexity accounts for 20% of the first fusion value, and innovativeness accounts for 15% of the first fusion value.
[0074] It should be noted that the first preset fusion weight ratio can also be set to other values according to the actual situation. For example, it can be adjusted according to the different emphases of the knowledge points, and different first preset fusion weight ratios can be set for each knowledge point. Alternatively, it can be dynamically adjusted according to the different learning objectives of the students. This application embodiment does not limit this.
[0075] Step 1032: Based on the correspondence between the first fusion value and the cognitive level, obtain the cognitive level diagnosis result corresponding to the knowledge point being assessed.
[0076] In some examples, the cognitive level diagnostic results corresponding to the assessed knowledge points can evaluate the learner's level of mastery of those knowledge points. For instance, the cognitive level diagnostic results may include the learner's scores for each cognitive level of the assessed knowledge point, an overall evaluation, and targeted reinforcement suggestions.
[0077] In this embodiment of the application, the cognitive level diagnostic result corresponding to the assessment knowledge point is obtained based on the correspondence between the first fusion value and the cognitive level, including the following steps:
[0078] The first step is to normalize the first fusion value.
[0079] In some examples, methods such as Z-Score normalization and L2 normalization can be used to normalize the first fusion value.
[0080] The second step is to multiply the normalized first fusion value by a preset coefficient and round it up to obtain the cognitive level determination value.
[0081] In some examples, the preset coefficient is the same as the number of cognitive level labels for the knowledge point being assessed. For example, if the number of labels for the knowledge point being assessed is 5, then the preset coefficient is equal to 5.
[0082] It should be noted that the number of cognitive level tags for a knowledge point is preset based on the level of mastery required for that knowledge point.
[0083] The third step is to compare the cognitive level judgment value with the level identifier value to determine the target level corresponding to the knowledge point being assessed. The level identifier value of the target level is the same as the cognitive level judgment value.
[0084] As a refinement and extension of the above embodiments, when pushing educational resources based on cognitive level diagnostic results, the following methods, but not limited to the following, can be used, including:
[0085] If the cognitive level diagnosis indicates that the cognitive level of the knowledge point being assessed is the memory level or the comprehension level, grammar practice resources corresponding to the knowledge point will be pushed to you; if the cognitive level diagnosis indicates that the cognitive level of the knowledge point being assessed is the application level or the analysis level, project case resources corresponding to the knowledge point will be pushed to you; if the cognitive level diagnosis indicates that the cognitive level of the knowledge point being assessed is the evaluation level or the creation level, innovation challenge resources corresponding to the knowledge point will be pushed to you.
[0086] In some examples, project case resources may include web scraping, automated file operations, etc., while innovation challenge resources may include designing a command-line task manager, building a web application, etc.
[0087] In this embodiment, the knowledge graph is constructed based on the content of the textbook document. The nodes of the knowledge graph correspond to knowledge points in the textbook document, and their attributes include the grammatical features, semantic vectors, and cognitive levels of the knowledge points. The relationships between nodes are determined based on the chapter dependencies within the textbook document. Figure 4 As shown below, the construction process of a knowledge graph will be described in detail:
[0088] Step 401: Obtain the nodes of the knowledge graph based on the knowledge points included in the textbook document.
[0089] In some examples, the nodes of a knowledge graph can be structured representations of knowledge points from textbook documents. For instance, the textual descriptions of knowledge points from textbook documents can be input into a pre-trained language model to obtain a structured representation of those knowledge points.
[0090] Step 402: Use the abstract syntax tree parser to extract the syntax features of the typical code patterns corresponding to the knowledge points, and obtain the first attribute information of the nodes.
[0091] An abstract syntax tree (AST) is a data structure that, compared to source code, primarily represents the syntactic features of the code. The role of the AST parser is to convert source code into an AST. The first attribute information of a node is one type of node attribute information. In this embodiment, the node attribute information of the knowledge graph includes, but is not limited to, the first attribute information, the second attribute information, and the third attribute information.
[0092] In some examples, such as if-else (conditional statement) concepts, the abstract syntax tree is [If, Compare, BoolOp]. Here, If, Compare, and BoolOp are the core node types representing conditional logic in programming languages.
[0093] By using an abstract syntax tree parser to extract the syntactic features corresponding to knowledge points, code blocks can be analyzed and diagnosed more efficiently.
[0094] Step 403: Use a pre-trained language model to convert the textual description of knowledge points into semantic vectors to obtain the second attribute information of the nodes.
[0095] In some examples, the textual descriptions of knowledge points are input into a pre-trained language model, and the output vector of the classification (CLS) tag is taken as the semantic vector. The CLS tag is a special tag used in the pre-trained language model to extract and analyze the semantic information of the entire text, i.e., the complete textual descriptions of the knowledge points, to obtain the semantic vector.
[0096] By taking the output vector of the CLS tag as a semantic vector, the contextual semantic information of the code block can be represented, which facilitates subsequent semantic feature matching.
[0097] Step 404: Set cognitive level labels for knowledge points according to the teaching plan for the knowledge points, and obtain the third attribute information of the nodes.
[0098] In some examples, the curriculum plan for a knowledge point may include the required level of mastery that students are expected to achieve. For instance, conditional statements are a cornerstone and core of programming languages; for this knowledge point, the curriculum plan would require students to master and apply this knowledge point to develop projects.
[0099] For example, a pre-trained language model can be used to assign cognitive level labels to knowledge points. For instance, the content of a knowledge point is input into a pre-trained language model, which then outputs the corresponding cognitive level label for that knowledge point.
[0100] For example, a training dataset can be obtained by annotating knowledge points with Bloom's hierarchy of knowledge, and a pre-trained language model can be trained. Then, the trained pre-trained language model can be used to annotate knowledge points with the hierarchy of knowledge.
[0101] Step 405: Determine the node relationships based on the dependencies between chapters in the textbook.
[0102] In some examples, a directed acyclic graph (DAG) of knowledge points corresponding to each textbook chapter is constructed by analyzing the dependencies between the chapters.
[0103] For example, keyword association or dependency matrix plotting can be used to analyze the dependencies between textbook chapters. Then, a topological sorting algorithm is used to determine the prerequisite knowledge points for the knowledge points corresponding to the textbook chapters, and then the relationships between nodes are determined based on the knowledge points and their corresponding prerequisite knowledge points.
[0104] S406. Construct a knowledge graph based on the nodes, node relationships, first attribute information of nodes, second attribute information of nodes, and third attribute information of nodes.
[0105] In some examples, knowledge graphs can be constructed using a visual ontology editor (Protege), the Semantic Web Ontology Language (OWL), or the tagging system of the Neo4j graph database.
[0106] In addition, once the knowledge graph is constructed, it can be stored in a graph database (such as Neo4j or JanusGraph).
[0107] To illustrate the specific implementation process of this embodiment, this application embodiment is applied to a teaching system, which includes: a teaching needs analysis module, an education review engine, a graph database, and a resource library.
[0108] The following are specific application examples, such as Figure 5 As shown, but not limited to:
[0109] The first step is for the teaching needs analysis module to construct a knowledge graph based on the textbook documents and store the knowledge graph in a graph database.
[0110] In some examples, the execution of the teaching needs parsing module can refer to the process of constructing the knowledge graph described above, which will not be repeated here.
[0111] The second step involves the educational review engine performing cognitive level diagnosis on students' code assignments based on a graph database.
[0112] In some examples, the educational review engine includes an error localization process and a cognitive diagnostic process. The error localization process includes: using an AST parser to convert the code block into an abstract syntax tree and recording line number information; then, based on the line number of the compiler / interpreter error, finding the corresponding erroneous code node to obtain the syntactic structure of the code block; next, verifying the type of the erroneous node in the code block by combining the error type; generating a complete path chain from the root node to the erroneous code node by traversing upwards from the erroneous code node; and finally, collecting the adjacent node information of the erroneous code node to obtain the complete semantic context of the code block.
[0113] If the error localization process fails to locate the error, then the cognitive diagnostic process is stopped, and the trainee's achievement record is saved.
[0114] If the error localization process locates the error, it executes the cognitive diagnostic process after obtaining the syntactic structure and complete semantic context of the code block.
[0115] In some examples, the cognitive diagnosis process of the education review engine can refer to the above-mentioned cognitive diagnosis execution process, which will not be repeated here.
[0116] The third step involves the education review engine searching the resource library based on the cognitive level diagnosis results and generating resource recommendation information.
[0117] The fourth step involves the education review engine pushing cognitive level diagnostic results to teachers.
[0118] In some examples, cognitive level diagnostic results may include, for instance, the learner's cognitive level rating of the assessed knowledge points, an overall evaluation, and targeted reinforcement suggestions.
[0119] The fifth step involves the education review engine pushing resource recommendation information to students.
[0120] In some examples, the learning resource recommendations include learning phase planning and links to learning resources.
[0121] Compared to existing technologies, this application identifies the knowledge points most relevant to the code block for assessment, thus defining the scope of knowledge points corresponding to the cognitive diagnosis. Then, a large language model is used to evaluate the code block, obtaining quality scores across multiple dimensions. These quality scores are then weighted and fused to obtain the cognitive level diagnostic result corresponding to the assessment knowledge points. This achieves automated assessment of the student's mastery of the knowledge points. Furthermore, based on the cognitive level diagnostic results, educational resources are recommended, enabling targeted learning resource recommendations based on the student's knowledge point mastery, thereby improving learning efficiency.
[0122] Furthermore, as Figures 1 to 5 The specific implementation of the method shown in this embodiment provides a resource recommendation device based on cognitive diagnosis, such as... Figure 6 As shown, the device includes: an acquisition module 61, a feature extraction module 62, a diagnosis module 63, and a recommendation module 64.
[0123] The acquisition module 61 is configured to acquire the assessment knowledge points associated with the code block. The assessment knowledge points are obtained by matching the relevance of multiple nodes in the knowledge graph based on the code block. The nodes correspond to the knowledge points in the textbook document. The nodes include node attribute information, which represents the grammatical features, semantic vectors, and cognitive levels of the knowledge points corresponding to the nodes.
[0124] The feature extraction module 62 is configured to input the attribute information of the assessment knowledge points and the code block into a large language model for feature extraction, and obtain quality scores of multiple dimensions corresponding to the code block;
[0125] The diagnostic module 63 is configured to perform a first weighted fusion of the quality scores of multiple dimensions corresponding to the code block to obtain a cognitive level diagnostic result corresponding to the assessment knowledge point. The cognitive level diagnostic result represents the degree to which the author of the code block has mastered the assessment knowledge point.
[0126] Recommendation module 64 is configured to push educational resources based on the cognitive level diagnosis results.
[0127] In some examples of this embodiment, the acquisition module 61 is further configured to: perform syntactic feature matching on the code block based on the syntactic features of the knowledge points; obtain candidate knowledge points among multiple knowledge points whose syntactic matching value with the code block is greater than a first preset threshold; perform contextual semantic feature matching on the code block based on the semantic vector of the knowledge points; obtain candidate knowledge points among multiple knowledge points whose semantic approximation value with the code block is greater than a second preset threshold; obtain the error association compensation value of the candidate knowledge point based on the co-occurrence frequency of the code block and the candidate knowledge point; perform second weight fusion on the syntactic matching value, semantic approximation value, and error association compensation value of the candidate knowledge point based on a second preset fusion weight ratio; the second preset fusion weight ratio characterizes the degree of influence of the syntactic matching value, semantic approximation value, and error association compensation value on determining the assessment knowledge point; sort the second fusion values of multiple candidate knowledge points, and obtain the assessment knowledge point associated with the code block based on the sorting result.
[0128] In some examples of this embodiment, the diagnostic module 62 is further configured to perform a first weighted fusion of the syntax quality score, comment quality score, test coverage score, code complexity score, code optimization score, and innovation score corresponding to the code block according to a first preset fusion weight ratio, to obtain a first fusion value; the first preset fusion weight ratio characterizes the degree of influence of the quality score of each dimension on the cognitive level diagnostic result; and based on the correspondence between the first fusion value and the cognitive level, the cognitive level diagnostic result corresponding to the assessment knowledge point is obtained.
[0129] In some examples of this embodiment, the diagnostic module 62 is specifically configured to normalize the first fusion value; multiply the normalized first fusion value by a preset coefficient and round up to obtain a cognitive level determination value; compare the cognitive level determination value with the level identifier value to determine the target level corresponding to the assessment knowledge point, wherein the level identifier value of the target level is the same as the cognitive level determination value.
[0130] In some examples of this embodiment, the recommendation module 63 is further configured to: if the cognitive level diagnosis result indicates that the cognitive level of the assessment knowledge point is the memory level or the comprehension level, push grammar practice resources corresponding to the assessment knowledge point; if the cognitive level diagnosis result indicates that the cognitive level of the assessment knowledge point is the application level or the analysis level, push project case resources corresponding to the assessment knowledge point; if the cognitive level diagnosis result indicates that the cognitive level of the assessment knowledge point is the evaluation level or the creation level, push innovative project resources corresponding to the assessment knowledge point.
[0131] In addition, embodiments of this application also provide another resource recommendation device based on cognitive diagnosis, such as... Figure 7 As shown, the device includes: an acquisition module 61, a feature extraction module 62, a diagnosis module 63, a recommendation module 64, and a construction module 65. The acquisition module 61, the feature extraction module 62, the diagnosis module 63, and the recommendation module 64 have been described in the above embodiments and will not be repeated here.
[0132] In some examples of this embodiment, the construction module 65 is also configured to obtain the knowledge points and chapters included in the textbook document; and to construct a knowledge graph based on the knowledge points, chapters, and cognitive levels included in the textbook document.
[0133] In some examples of this embodiment, the construction module 65 is specifically configured to: obtain nodes of the knowledge graph based on the knowledge points included in the textbook document; extract syntactic features of typical code patterns corresponding to the knowledge points using an abstract syntax tree parser to obtain the first attribute information of the nodes; convert the textual description of the knowledge points into semantic vectors using a pre-trained language model to obtain the second attribute information of the nodes; set cognitive level labels for the knowledge points according to the teaching plan of the knowledge points to obtain the third attribute information of the nodes; determine the node relationships according to the dependencies of the textbook chapters; and construct the knowledge graph based on the nodes, node relationships, first attribute information, second attribute information, and third attribute information of the knowledge graph.
[0134] It should be noted that other corresponding descriptions of the functional units involved in the cognitive diagnosis-based resource recommendation device provided in this embodiment can be found in [reference]. Figures 1 to 5 The corresponding descriptions in [the document] will not be repeated here.
[0135] Based on the above, Figures 1 to 5 Accordingly, this embodiment also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method. Figures 1 to 5 The method shown.
[0136] Based on this understanding, the technical solution of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as CD-ROM, USB flash drive, mobile hard drive, etc.) and includes several instructions to cause a computer device (such as personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of this application.
[0137] like Figure 8 The diagram shown is a hardware structure schematic of an electronic device according to the present invention, comprising:
[0138] At least one processor 801; and,
[0139] A memory 802 is communicatively connected to at least one of the processors 801; wherein,
[0140] The memory 802 stores instructions that can be executed by at least one of the processors to enable at least one of the processors to perform the method for determining test cases as described above.
[0141] Figure 8 Take the 801 processor as an example.
[0142] The electronic device may also include an input device 803 and a display device 804.
[0143] The processor 801, memory 802, input device 803, and display device 804 can be connected via a bus or other means. Figure 8 Taking the example of a connection between China and Israel via a bus.
[0144] The memory 802, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the test case determination method in the embodiments of this application, for example, Figures 1 to 5 The method flow is shown. The processor 801 executes various functional applications and data processing by running non-volatile software programs, instructions, and modules stored in the memory 802, thereby implementing the test case determination method in the above embodiments.
[0145] Memory 802 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the method for determining test cases. Furthermore, memory 802 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 802 may optionally include memory remotely located relative to processor 801, and these remote memories may be connected via a network to means of executing the method for determining test cases. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0146] Input device 803 can receive user clicks and generate signal inputs related to user settings and function control for determining test cases. Display device 804 may include display devices such as a display screen.
[0147] When one or more modules are stored in the memory 802, and are run by one or more processors 801, the method for determining test cases in any of the above method embodiments is executed.
[0148] Optionally, the aforementioned physical devices may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB interfaces, card reader interfaces, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Wi-Fi interfaces), etc.
[0149] Those skilled in the art will understand that the physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or combine certain components, or have different component arrangements.
[0150] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the aforementioned physical device, supporting the operation of information processing programs and other software and / or programs. The network communication module is used to enable communication between the various components within the storage medium, as well as communication with other hardware and software in the information processing physical device.
[0151] Through the above description of the implementation methods, those skilled in the art can clearly understand that this application can be implemented using software plus necessary general-purpose hardware platforms, or it can be implemented through hardware. By applying the solution of this embodiment, compared with the prior art, this application locates the knowledge point range corresponding to the cognitive diagnosis by obtaining the assessment knowledge point with the highest relevance to the code block. Then, a large language model is used to evaluate the code block to obtain quality scores in multiple dimensions. Next, the quality scores in multiple dimensions are fused using a first weight to obtain the cognitive level diagnostic result corresponding to the assessment knowledge point. This achieves automated assessment of the student's mastery of the knowledge point. Furthermore, based on the cognitive level diagnostic result, educational resources are pushed, enabling targeted recommendations of learning resources based on the student's mastery of the knowledge point, thereby improving learning efficiency.
[0152] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0153] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A resource recommendation method based on cognitive diagnosis, characterized in that, include: The assessment knowledge points associated with the code block are obtained based on the relevance matching of multiple nodes in the knowledge graph included by the code block. The nodes correspond to the knowledge points in the textbook document. The nodes include node attribute information, which is used to describe the assessment characteristics of the knowledge points corresponding to the nodes. The assessment features of the assessment knowledge points and the code block are input into a large language model for feature extraction to obtain quality scores in multiple dimensions corresponding to the code block. The quality scores of multiple dimensions corresponding to the code block are fused with a first weight to obtain the cognitive level diagnostic result corresponding to the assessment knowledge point. The cognitive level diagnostic result represents the author of the code block's mastery of the assessment knowledge point. Based on the cognitive level diagnosis results, educational resources are recommended.
2. The method according to claim 1, characterized in that, The acquisition of assessment knowledge points associated with the code block includes: Syntactic feature matching is performed on the code block based on the syntactic features of the knowledge points, and candidate knowledge points with syntactic matching values greater than a first preset threshold are obtained from multiple knowledge points. Based on the semantic vector of the knowledge point, the code block is matched with contextual semantic features. Among the multiple knowledge points, candidate knowledge points whose semantic approximation value with the code block is greater than a second preset threshold are obtained. The error association compensation value of the candidate knowledge point is obtained based on the number of times the code block and the candidate knowledge point co-occur. Based on the second preset fusion weight ratio, the grammar matching value, semantic approximation value, and error association compensation value of the candidate knowledge point are fused using the second weight to obtain the second fusion value of the candidate knowledge point; the second preset fusion weight ratio characterizes the degree of influence of the grammar matching value, semantic approximation value, and error association compensation value on determining the assessment knowledge point; The second fusion values of multiple candidate knowledge points are sorted, and the assessment knowledge points associated with the code block are obtained based on the sorting results.
3. The method according to claim 1 or 2, characterized in that, The quality scores for the code block across multiple dimensions include at least: syntax quality score, comment quality score, test coverage score, code complexity score, code optimization score, and innovation score. The step of performing a first-weighted fusion of the quality scores of multiple dimensions corresponding to the code block to obtain a cognitive level diagnostic result corresponding to the assessment knowledge point includes: Based on the first preset fusion weight ratio, the syntax quality score, comment quality score, test coverage score, code complexity score, code optimization score, and innovation score corresponding to the code block are fused using the first weight to obtain a first fusion value; the first preset fusion weight ratio represents the degree of influence of the quality score of each dimension on the cognitive level diagnosis result; Based on the correspondence between the first fusion value and the cognitive level, a cognitive level diagnostic result corresponding to the assessment knowledge point is obtained.
4. The method according to claim 3, characterized in that, The cognitive hierarchy includes a hierarchy identifier value, which is an integer; The step of obtaining the cognitive level diagnostic result corresponding to the assessment knowledge point based on the correspondence between the first fusion value and the cognitive level includes: The first fusion value is normalized. The first fusion value after normalization is multiplied by a preset coefficient and rounded up to obtain the cognitive level determination value. The cognitive level determination value is compared with the level identifier value to determine the target level corresponding to the assessment knowledge point. The level identifier value of the target level is the same as the cognitive level determination value.
5. The method according to claim 1, characterized in that, Before obtaining the assessment knowledge points associated with the code block, the method further includes: Obtain the knowledge points and chapters included in the textbook document; The knowledge graph is constructed based on the knowledge points, chapters, and cognitive levels included in the textbook document.
6. The method according to claim 5, characterized in that, The knowledge graph includes nodes, node relationships, and node attribute information. The node attribute information includes first attribute information, second attribute information, and third attribute information of the node. The construction of the knowledge graph based on the knowledge points, chapters, and cognitive levels included in the textbook document includes: The nodes of the knowledge graph are obtained based on the knowledge points included in the textbook document; The abstract syntax tree parser is used to extract the syntactic features of the typical code patterns corresponding to the knowledge points, and the first attribute information of the nodes is obtained. The textual descriptions of the knowledge points are converted into semantic vectors using a pre-trained language model to obtain the second attribute information of the nodes. Based on the teaching plan for the knowledge points, cognitive level labels are set for the knowledge points to obtain the third attribute information of the nodes; Determine the node relationships based on the dependencies between the chapters in the textbook; The knowledge graph is constructed based on the nodes, node relationships, first attribute information of nodes, second attribute information of nodes, and third attribute information of nodes.
7. The method according to claim 1, characterized in that, The process of pushing educational resources based on the cognitive level diagnosis results includes: If the cognitive level diagnosis result indicates that the cognitive level of the assessment knowledge point is the memory level or the comprehension level, then push the grammar practice resources corresponding to the assessment knowledge point; If the cognitive level diagnosis result indicates that the cognitive level of the assessment knowledge point is the application level or the analysis level, the project case resources corresponding to the assessment knowledge point will be pushed. If the cognitive level diagnosis result indicates that the cognitive level of the assessment knowledge point is the evaluation level or the creation level, then the corresponding innovative project resources will be pushed.
8. A resource recommendation method and apparatus based on cognitive diagnosis, characterized in that, include: The acquisition module is configured to acquire assessment knowledge points associated with the code block. The assessment knowledge points are obtained by matching the relevance of multiple nodes in the knowledge graph based on the code block. The nodes correspond to knowledge points in the textbook document. The nodes include node attribute information, which is used to describe the assessment characteristics of the knowledge points corresponding to the nodes. The feature extraction module is configured to input the attribute information of the assessment knowledge points and the code block into a large language model for feature extraction, and obtain quality scores of multiple dimensions corresponding to the code block; The diagnostic module is configured to perform a first weighted fusion of the quality scores of multiple dimensions corresponding to the code block to obtain a cognitive level diagnostic result corresponding to the assessment knowledge point. The cognitive level diagnostic result represents the degree to which the author of the code block has mastered the assessment knowledge point. The recommendation module is configured to push educational resources based on the diagnostic results of the cognitive level.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.
10. An electronic device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 7.