Intelligent test paper composition method, system and equipment based on large language model and medium
Through the large language model technology analysis and the generation of test papers, combined with similar questions recommendations and genetic algorithms, the subjectivity and limitations of traditional paper grouping methods are solved, personalized customization and quality improvement of test papers are realized, and teaching efficiency and students are improved. innovation ability.
Patent Information
- Application Number
- CN202411011548.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-12-17
AI Technical Summary
The traditional paper grouping method has subjectivity and limitations, is inefficient, and is difficult to meet the needs of personalized education. The quality of the test papers generated is of varying quality, which is difficult to match the actual situation of students.
Using an intelligent paper-sharing method based on a large language model, analyzing the test questions, forming a preliminary standard test bank, using the big model training fine-tuning technology to mark knowledge points and difficulty, combining similar questions to recommend the question setting method and genetic algorithm to generate a meeting teaching needs. Exam paper.
It realizes accurate customization of the test paper, ensures that the knowledge points and difficulty match user needs, improves the diversity and quality of the test paper, shortens the time for writing test questions, reduces labor costs, and stimulates students' innovative awareness and problem-solving ability.
Smart Images

Figure CN119149792A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of test paper generation systems, and in particular to an intelligent test paper generation method, system, device and medium based on a large language model. Background Art
[0002] In the educational scenario, test paper production is a tedious and important task that requires qualified teachers to spend a lot of time and energy. In addition, the quality of the questions is often limited by the teacher's personal experience and ability, and is very subjective and limited. With the development of artificial intelligence technology, it has become possible to generate test questions and organize test papers in an intelligent and automated manner, which can greatly improve the efficiency and quality of test paper production. In addition, using advanced large language model technology, educators can better understand each student's learning characteristics, interests, hobbies, and learning progress, so as to tailor personalized learning paths and teaching content for them.
[0003] At present, research on test paper composition systems at home and abroad can be divided into three categories: the first is manual test paper composition, which is based on a large number of teachers with rich teaching experience manually selecting test questions that match the knowledge points and are of moderate difficulty. This method of test paper composition is cumbersome, time-consuming, and highly subjective; the second is random test paper composition, which randomly selects test questions to form test papers based on the subjects, grades, and knowledge points selected by the user. The quality of the test papers generated in this way is not high, the coverage of knowledge points is low, and the difficulty is unstable; the third is to use advanced artificial intelligence technology to compose test papers, but most of the intelligent test paper composition methods currently proposed have relatively simple algorithms, the test question analysis and knowledge point annotation are not accurate enough, the quality of the generated test papers is uneven, and it is difficult to match the actual situation of students.
[0004] With the continuous advancement of artificial intelligence technology, personalized education is rapidly rising and becoming a hot topic and development direction in the education sector, which has brought new challenges and higher requirements to the field of test paper generation. Traditional test paper generation methods are inefficient, subjective, limited, and inflexible. Personalized education can not only meet the diverse learning needs of students, but also stimulate their learning motivation and interest, and improve learning efficiency and grades. Therefore, how to design a test paper generation method that deeply understands user needs and combines fixed question banks and no-question bank models to tailor a set of test papers that meet specific needs for students is an important issue that needs to be faced in test paper generation in educational scenarios. Summary of the invention
[0005] Aiming at the subjectivity and limitation problems existing in the traditional test paper generation system, the present invention provides an intelligent test paper generation method, system, device and medium based on the big model technology.
[0006] The present invention is achieved through the following technical solutions:
[0007] An intelligent test paper composition method based on a large language model comprises the following steps:
[0008] Analyze test questions and form a preliminary standard test question bank;
[0009] The questions in the preliminary standard question bank are labeled with knowledge points and difficulty according to the difficulty system architecture of each subject question. The large model training and fine-tuning technology is used to perform knowledge point and difficulty labeling training to form a large language model of the test paper.
[0010] Customized test papers are created based on user needs. The knowledge points and difficulty levels of the questions used for test paper creation are obtained through large-model training and fine-tuning technology, and the user's test paper creation intention is analyzed. The similar question recommendation method, genetic algorithm question setting method and test paper large language model question setting method are combined, and the question types, knowledge point coverage and difficulty factors are comprehensively considered to generate test papers that meet teaching needs and meet user customization needs.
[0011] The aforementioned analysis of test questions forms a preliminary standard test question bank by analyzing the test questions based on OSS storage, regular expression matching and OCR recognition technology, so that the test questions are decomposed and stored in the bank; the test question data is stored using OSS storage, and the test question title and question type are segmented using regular expression matching technology to obtain the test question subject and question type fields, and for each question type, regular expressions and OCR technology are used to analyze the question stem, answer and analysis, and the test question subject and question type field data are merged and stored with the analyzed question stem, answer and analysis data.
[0012] According to the corresponding textbooks of each subject test questions, standard graded knowledge points are formulated to form a graded difficulty system architecture, and a large amount of test paper data is used to train and fine-tune the knowledge points and difficulty annotations to form a large test paper language model; several question stems for this test paper are input into the trained test paper language model to obtain a standard test question bank containing corresponding knowledge points and difficulty, and the test paper intention is analyzed through question types, knowledge points and difficulty.
[0013] The method of recommending similar questions is to use the big model technology to adapt the original questions in the standard test question bank of this test, generate similar but different difficulty and type of analogy questions, and incorporate them into the standard test question bank.
[0014] The genetic algorithm question-setting method is to use a genetic algorithm to obtain the best question matching the subject content and the student's ability. The specific steps are as follows:
[0015] Step (1): Initialize the test paper, set the test paper initial list I = {1, 2, ..., i}, i is the number of test paper sets randomly selected from the standard test question bank according to the number of questions set by the user;
[0016] Step (2): Calculate the test paper fitness. First, calculate the knowledge point coverage C of each test paper. iand the difficulty of the question D i The knowledge point coverage is the ratio of the number of knowledge points involved in the question to the number of questions in the whole test paper. The difficulty of the whole test paper is the average difficulty of all questions:
[0017]
[0018] Among them, p is the number of knowledge points involved in all questions in this test paper, q is the number of questions in the whole test paper, and d j is the difficulty of each question, and then the fitness of the i-th test paper f(x i ):
[0019] f(x i )=1-(1-C i )*α 1 -|D 0 -D i |*α 2
[0020] Among them, α 1 and α 2 They are the weights of knowledge point coverage and test paper difficulty, which are dynamically adjusted according to user needs and the actual situation of test paper composition; D 0 The difficulty is preset;
[0021] Step (3): Select the appropriate test paper. First, generate the probability of selecting the test paper p(x i ) and the cumulative probability q(x i ), the selection probability is the ratio of the fitness of each test paper to the sum of the fitness of all test papers, and the cumulative probability represents the sum of the selection probabilities of all individuals before each individual:
[0022]
[0023] Among them, f(x i ) is the fitness of the i-th test paper, is the sum of the fitness of all test papers; then the roulette strategy is used to select m individuals, which can correct the problem of falling into the local optimum; randomly generate an array m, each element of which has a value range between 0 and 1, and sort them from small to large. If the cumulative probability q(x i ) is greater than the element m[i] in the array, then the test paper x i If it is selected and is less than m[i], the next one is compared until all test papers are selected;
[0024] Step (4): Test question exchange: randomly select two sets of test papers for pairing, generate a random number between [0, 1], and compare it with the crossover probability of 0.5. When the random number is less than the crossover probability, randomly select a crossover point and exchange the genes after the crossover point. Check whether there are repeated elements. If so, replace them with questions with the same configuration.
[0025] Step (5): Test question mutation. For each question in the test paper, generate a random number and compare it with the mutation probability 0.1. If it is less than the mutation probability, replace it with a question with the same configuration and calculate the fitness of the individual in the new test paper after mutation.
[0026] Step (6): Repeat the iteration until the maximum number of iterations is reached or the fitness converges, and obtain the test paper with the highest fitness.
[0027] The method of combining the similar question recommendation method, the genetic algorithm method and the test paper large language model method, comprehensively considering the question type, knowledge point coverage and difficulty factors, and generating a test paper that meets the teaching needs and meets the user's customization needs is as follows: according to the test paper composition intention, the question type, knowledge point and difficulty parameters are input into the fine-tuned test paper large language model, combined with the similar question recommendation method and the genetic algorithm method, the corresponding test questions are generated, and a new test paper is generated according to the user's needs. The specific steps are as follows:
[0028] Step (1): according to the test paper file uploaded by the user for setting test questions, the question stem, answer, analysis, question type and subject are parsed therefrom;
[0029] Step (2): Input the question stem of the test paper file into the trained test paper language model to obtain the knowledge points and difficulty of the question, and analyze the user's test paper composition intention;
[0030] Step (3): Obtain similar questions that can be applied to other situations based on the question stem, answer, and analysis content;
[0031] Step (4): Use genetic algorithm to obtain the test question with the highest fitness in the test bank;
[0032] Step (5): according to the user's test paper composition intention, the corresponding parameters are input into the test paper language model, and the corresponding test questions are generated by the test paper language model;
[0033] Step (6): Format according to user requirements and generate a new test paper.
[0034] The present invention also provides an intelligent test paper composition system based on a large language model, comprising:
[0035] The test question analysis layer includes a picture storage module and a test question analysis module. The picture storage module is used to store test question pictures, and the test question analysis module is used to analyze test questions to form a preliminary standard test question library.
[0036] The knowledge point and difficulty annotation layer includes a large model training fine-tuning module, a knowledge point annotation module and a difficulty annotation module. The knowledge point annotation module and the difficulty annotation module are used to annotate the knowledge points and difficulty of the questions in the preliminary standard question bank according to the difficulty system architecture of each subject question. The large model training fine-tuning module is used to perform knowledge point and difficulty annotation training using the large model training fine-tuning technology to form a large language model of the test paper.
[0037] The intelligent test-taking layer includes a similar question generation module, a genetic test-taking module and a large model test-taking module. The similar question generation module is used to adapt the original questions of the current test-taking question bank in the test-taking standard question bank to generate similar but different difficulty and type of analogy questions; the genetic test-taking module is used to obtain the questions that best match the subject content and student abilities; the large model test-taking module is used to obtain the knowledge points and difficulty of questions used for test-taking, analyze the user's test-taking intention, customize the test-taking according to user needs, combine the similar question recommendation method, the genetic algorithm method and the test paper large language model method, comprehensively consider the question type, knowledge point coverage and difficulty factors, and generate a test paper that meets teaching needs and meets user customization needs.
[0038] The test question parsing module includes a regular processing module, an OCR recognition module and a data storage module. The regular processing module is used to segment the test question title and question type to obtain the test question subject and question type fields. For each question type, the regular processing module and the OCR recognition module are used to parse the question stem, answer and analysis respectively. The test question subject and question type field data are merged with the parsed question stem, answer and analysis data and stored in the data storage module.
[0039] The present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the intelligent test paper composition method based on a large language model as described above is implemented.
[0040] The present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the intelligent test paper composition method based on a large language model as described above.
[0041] Compared with the prior art, the present invention has the following beneficial effects:
[0042] The system of the present invention analyzes the user's test paper composition intention from the uploaded file, deeply understands the user's needs and teaching content, and can accurately customize a set of test papers that meet the requirements, ensuring that the knowledge points and difficulty of the test papers match the files uploaded by the user. Different from the traditional one-size-fits-all teaching method, it can generate more targeted test papers based on the personal situation and needs of each student, providing services and support for personalized teaching.
[0043] Aiming at the problem that students mechanically memorize answers but ignore truly understanding knowledge points, the present invention can generate similar questions in real time that can be applied to the corresponding questions, rewrite the original questions to generate a series of new questions of different types and increasing difficulty, and dynamically update the question bank; by setting a large model prompt word template, adjusting the numbers in the questions, modifying the variables in the formulas, resetting the assumptions and other methods, the system generates adapted questions similar to the original questions while analyzing, and continuously expands the scope of questions; in addition, this method can not only increase the diversity of questions, but also stimulate students' thinking and cultivate their innovative consciousness and problem-solving ability.
[0044] In view of the problems of long test paper preparation time and uneven question quality in traditional test paper preparation methods, the present invention proposes a test paper preparation method that combines similar question generation, genetic algorithm, and large model generation, which can significantly shorten the test paper preparation time and reduce labor costs; in addition, the test paper preparation method combines the question bank and the model generation method without question bank, does not completely rely on the fixed question bank, and makes full use of the large amount of training data and language comprehension ability; by real-time adaptation of similar questions, the content of the question stem is flexibly adjusted to ensure the diversity and practicality of the test questions; at the same time, new questions are generated by using large models, and the content of the question bank is continuously enriched to maintain the novelty and challenge of the questions; this innovative method can not only meet the needs of different examinations, but also adapt to changes in teaching content and examination syllabus, bringing a new development direction to the education examination industry. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a schematic diagram of the architecture of the intelligent test paper composition system based on a large language model of the present invention.
[0046] Figure 2 This is a schematic diagram of the existing problem analysis and solution.
[0047] Figure 3 Schematic diagram of the process of large model training fine-tuning technology of the present invention.
[0048] Figure 4 The figure is a flow chart of a three-layer intelligent test paper forming method for customizing test papers according to user requirements according to the present invention.
[0049] Figure 5 It is a schematic diagram of the flow of the genetic test paper composition module of the present invention.
[0050] Figure 6 It is a flow chart of the large model test paper assembly module of the present invention. DETAILED DESCRIPTION
[0051] The above contents of the present invention are further described in detail below in the form of embodiments, but this should not be understood as the scope of the above subject matter of the present invention being limited to the following embodiments, and all technologies realized based on the above contents of the present invention belong to the scope of the present invention.
[0052] The present invention provides an intelligent test paper composition method based on a large language model, comprising the following steps:
[0053] 1. Analyze test questions and form a preliminary standard test question bank;
[0054] 2. Label the knowledge points and difficulty of the questions in the preliminary standard question bank according to the difficulty system architecture of each subject question, and use the large model training fine-tuning technology to perform knowledge point and difficulty labeling training to form a large language model of the test paper;
[0055] 3. Customize the test paper according to user needs, obtain the knowledge points and difficulty of the questions used for test paper creation through large model training and fine-tuning technology, and analyze the user's test paper creation intention; combine the similar question recommendation method, genetic algorithm question setting method and the test paper large language model question setting method, comprehensively consider the question type, knowledge point coverage and difficulty factors, and generate a test paper that meets teaching needs and meets user customization needs.
[0056] In a preferred embodiment, step 1 specifically includes decomposing the test questions of the test paper file uploaded by the user into a database, parsing the test questions based on OSS storage, regular expression matching and OCR recognition technology, and forming a preliminary standard test question database:
[0057] Perform data preprocessing on existing test papers and automatically upload the images in them to the object storage service OSS;
[0058] Use regular expression matching technology to obtain subject and question type fields, and segment each question type;
[0059] For each question type, regular expressions and OCR technology are used to parse the question stem, answer and analysis, and the data is stored in a preliminary standard question bank.
[0060] In a preferred embodiment, step 2 specifically includes completing the knowledge point and difficulty labeling, and using the large model training fine-tuning technology to obtain the knowledge point and difficulty corresponding to the question:
[0061] By adjusting appropriate parameters and using a large amount of high-quality test paper data to train and fine-tune a large language model dedicated to solving test paper problems, the corresponding knowledge points and difficulty levels are obtained and stored in the database by setting prompt word templates; the training and fine-tuning of the large language model is mainly divided into four steps, namely data preprocessing, model fine-tuning, verification and testing, and output result normalization.
[0062] In a preferred embodiment, step three specifically includes analyzing the user's test paper composition intention, combining similar question recommendations, genetic algorithms, and a large test paper composition model, comprehensively considering factors such as question types, knowledge point coverage, and difficulty, and generating a test paper that meets teaching needs and user customization needs in real time:
[0063] The system analyzes the user's test paper composition intention based on the uploaded test paper data, including the question types and knowledge points that the user wants to practice, the number of each question type, and the overall difficulty of the test paper;
[0064] By setting prompt word templates, adjusting numbers, changing formulas, resetting assumptions, etc., the original questions are changed to generate analogy questions that are similar to the original questions but of different difficulty and type;
[0065] Use the large amount of question data that has been parsed and stored to train and fine-tune the large model, and then tailor test questions with the same knowledge points and appropriate difficulty for users based on the analyzed test composition intentions;
[0066] In this way, similar questions generated by analogy, test questions generated by genetic algorithms and large models are combined to obtain test questions, which are automatically typeset according to user needs.
[0067] The present invention also provides an intelligent test paper composition system based on a large language model, comprising:
[0068] The test question analysis layer includes a picture storage module and a test question analysis module. The picture storage module is used to store test question pictures, and the test question analysis module is used to analyze test questions to form a preliminary standard test question library.
[0069] The knowledge point and difficulty annotation layer includes a large model training fine-tuning module, a knowledge point annotation module, and a difficulty annotation module. The knowledge point annotation module and the difficulty annotation module are used to annotate the knowledge points and difficulty of the questions in the preliminary standard question bank according to the difficulty system architecture of each subject question. The large model training fine-tuning module is used to perform knowledge point and difficulty annotation training using the large model training fine-tuning technology to form a large language model of the test paper.
[0070] The intelligent test-taking layer includes a similar question generation module, a genetic test-taking module and a large model test-taking module. The similar question generation module is used to adapt the original questions in the standard test question bank to generate similar but different difficulty and type of analogy questions; the genetic test-taking module is used to obtain the questions that best match the subject content and student abilities; the large model test-taking module is used to obtain the knowledge points and difficulty of questions used for test-taking, analyze the user's test-taking intention, customize the test according to user needs, combine the similar question recommendation method, the genetic algorithm method and the test paper large language model method, comprehensively consider the question type, knowledge point coverage and difficulty factors, and generate test papers that meet teaching needs and meet user customization needs.
[0071] The test question parsing module includes a regular processing module, an OCR recognition module and a data storage module. The regular processing module is used to segment the test question title and question type to obtain the test question subject and question type fields. For each question type, the regular processing module and the OCR recognition module are used to parse the question stem, answer and analysis respectively. The test question subject and question type field data are merged with the parsed question stem, answer and analysis data and stored in the data storage module.
[0072] The present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the intelligent test paper composition method based on the large language model as described above is implemented.
[0073] The present invention also provides a computer-readable storage medium storing a computer program, which enables a computer to execute the above-mentioned intelligent test paper composition method based on a large language model.
[0074] like Figure 1 As shown in Figure 1, the technical implementation of the present invention mainly includes three layers: question analysis layer, knowledge point and difficulty annotation layer, and intelligent test composition layer. This three-layer architecture makes the entire system clearly divided and reduces the coupling degree. Figure 2 shown.
[0075] 1. Question analysis layer
[0076] The main function of this layer is to complete the parsing and storage of test questions. It mainly includes four modules, namely, image storage module, regularization processing module, OCR recognition module and data storage module. The specific functions and implementations of each module are as follows:
[0077] Image storage module: pre-process the data of existing test papers, automatically upload the images in them to OSS (Object Storage Service), and mark the location of the images; OSS is a widely used cloud storage technology that can be used to store a large number of data objects, such as images, videos, etc.; this module uses Alibaba Cloud's OSS storage, sets the bucket name to "paper", the region to "East China 1 (Hangzhou)", the reader permission to "public read and write", and the rest are default settings; then obtain the access key AccessKey Id and AccessKey Secret, and configure each parameter in the Python code to realize file upload and download.
[0078] Regular expression processing module: Use regular expression matching technology to obtain subject and question type fields, and segment each question type. This technology is a very powerful and flexible text processing tool. It describes and matches various complex text patterns through concise expressions, providing an efficient way to process and operate text data. This module mainly relies on the Python built-in library re. First, call the compile method to obtain the pattern matching object, and then use it as a parameter to call the search method to obtain the matching results and perform text segmentation.
[0079] OCR recognition module: For each question type, regular expressions and OCR (Optical Character Recognition) technology are used to parse the question stem, answer and analysis in the question; the OCR technology in this module can extract text information from print or images and convert it into editable and searchable electronic text data, thereby realizing the digital processing and management of documents. The code environment includes python 3.10, conda 23.1, opencv-python 4.9.0, numpy 1.24, etc.
[0080] Data storage module: stores the content obtained by the OCR recognition module together with the subject and question type fields in the database, and obtains the corresponding number of each question type; this module uses MySQL as its database, which is a secure, reliable, and efficient relational data management system with a version number of 5.7.24.
[0081] 2. Knowledge point and difficulty annotation layer
[0082] The main function of this layer is to obtain the knowledge points and difficulty of each question, calculate the average difficulty, and analyze the user's test-taking intention; the core technology of knowledge point and difficulty annotation is to use a large amount of high-quality test paper data to train and fine-tune a large language model dedicated to solving test paper problems, and different effects can be achieved by changing the prompt words (prompt); the question stem obtained in the test question analysis module is input into the large model, so as to output the knowledge points and difficulty values of the corresponding structure; it is mainly divided into a large model training and fine-tuning module, a knowledge point annotation module and a difficulty annotation module; the specific functions and implementation are as follows:
[0083] Large model training and fine-tuning module: The training and fine-tuning of large models is mainly divided into four steps, namely data preprocessing, model fine-tuning, verification and testing, and output result normalization. The training and fine-tuning process is as follows: Figure 3As shown in the figure; data preprocessing is a series of processing on the original data before using a large neural network model for training, including word segmentation, sequence truncation and padding, data enhancement, etc., aiming to adapt the original data to the needs of the model, thereby improving training efficiency and model performance; model fine-tuning refers to additional training on a dataset of a specific task based on a pre-trained large neural network model to adapt the model to the task, including full fine-tuning, layer-by-layer fine-tuning, adversarial training and other strategies; this module in the system uses Lora fine-tuning, the core idea of which is to introduce an attention adjustment factor to dynamically adjust the contribution of each layer in training, so that the model focuses more on the layers that are more important to the task; the fine-tuning environment includes python 3.10, torch 2.0.1, transformers4.33.1, accelerate0.22, peft 0.5, jieba 0.42.1, etc.; adjust appropriate parameters, such as learning rate learning_rate, batch size batch_size, gradient accumulation steps gradient_accumulation_steps, etc., to obtain the best test paper language model; after the model training is completed, the test data set should be used for testing and evaluation, and the model should be adjusted and optimized according to the evaluation results, and the results should be output in a specific format.
[0084] Knowledge point annotation module: After the test paper language model training is completed, set the prompt word prompt template as follows, [Suppose you are a question knowledge point analyst, your job is to analyze the knowledge point of this question based on the question stem content {questionStem} provided by the user; the knowledge point format is based on the three-level structure formulated according to the textbooks of each subject, such as [numbers and algebra-number operations-four operations of integers]]; then input the question stem content obtained from the previous layer of analysis into the model, replace {questionStem} in the template, obtain the corresponding knowledge point and store it in the database.
[0085] Difficulty labeling module: Set the prompt word of this module as follows: [Suppose you are a question difficulty analyst. Your job is to analyze the difficulty of this question based on the question stem content {questionStem} provided by the user. The difficulty is divided into five levels, namely easy (0.9-1.0), relatively easy (0.8-0.9), moderate (0.5-0.7), relatively difficult (0.2-0.4) and difficult (0.1)]; then input the question stem content into the model, and the large model training and fine-tuning module obtains the question difficulty based on the training results and stores it in the database; in addition, the system calculates the average difficulty of all questions as the overall difficulty of the test paper uploaded by the user.
[0086] So far, a standard test question bank with seven indicators has been formed in the database, namely, question stem, answer, analysis, question type, subject, knowledge point and difficulty. The system analyzes the user's test paper composition intention based on the uploaded test paper data, including the question types and knowledge points that the user wants to practice, the number of each question type, and the overall difficulty of the test paper.
[0087] 3. Intelligent volume grouping layer
[0088] The main function of this layer is to use advanced artificial intelligence algorithms to complete the test paper generation and generate test papers that meet user needs and fit the actual situation of students. It mainly includes three modules, namely similar question generation module, genetic test paper generation module and large model test paper generation module. The specific process of the three-layer test paper generation method is as follows: Figure 4 As shown, the functions and implementations of each module are as follows:
[0089] Similar question generation module: First, set the prompt word template: [Suppose you are a teacher who sets questions. Your task is to change the original question by adjusting numbers, changing formulas, resetting assumptions, etc. according to the question stem {questionStem}, answer {answer}, and analysis {analyze} content given by the user, so as to generate similar but different difficulty and type of analogy questions]; then, input the question stem, answer, and analysis content obtained from the question parsing layer into the test paper language model, replace the parameters in the template, and generate similar questions of different types and difficulty of the main topic in real time; from multiple-choice questions to open-ended questions, from simple to complex, continuously expand the scope of questions, stimulate students' thinking, and flexibly meet the needs of different teaching objectives and student levels; in addition, similar analogy questions are different from the main topic, which solves the problem of students mechanically memorizing answers but ignoring the understanding of knowledge points, and cultivates students' innovative consciousness and problem-solving ability.
[0090] Genetic test paper composition module: Use genetic algorithms to simulate each test paper into a chromosome, and imagine each question as a gene on the chromosome. Through the crossover and mutation of chromosomes, that is, the exchange and mutation of questions, test questions that suit students are selected. Figure 5 As shown, the specific steps are as follows:
[0091] Step 1: Test paper initialization; set the test paper initial list I = {1, 2, ..., i}, the default size is 30, randomly extract questions from the database according to the number of questions set by the user to obtain a set of test papers, a total of 30 sets;
[0092] Step 2: Calculate the test paper adaptability; first calculate the knowledge point coverage C of each test paper i and the difficulty of the question D i The knowledge point coverage is the ratio of the number of knowledge points involved in the question to the number of questions in the whole test paper. The difficulty of the whole test paper is the average difficulty of all questions:
[0093]
[0094] Among them, p is the number of knowledge points involved in all questions in this test paper, q is the number of questions in the whole test paper, and d j is the difficulty of each question; and the adaptability of the entire test paper is obtained according to the following formula:
[0095] f(x i )=1-(1-C i )*α 1 -|D 0 -D i |*α 2
[0096] Among them, α 1 and α 2 The weights of knowledge point coverage and test difficulty are 0.5 by default, and can be adjusted dynamically according to user needs and the actual situation of test paper composition; D 0 It is the preset difficulty, the default value is 0.6;
[0097] Step 3: Select the appropriate test paper; first generate the selection probability and cumulative probability of the test paper; the selection probability is the ratio of the fitness of each test paper to the sum of the fitness of all test papers, and the cumulative probability represents the sum of the selection probabilities of all individuals before each individual;
[0098]
[0099] Among them, f(x i ) is the fitness of the i-th test paper, is the sum of the fitness of all test papers; then the roulette strategy is used to select m individuals, which can correct the problem of falling into the local optimum; if the selection is made according to the fitness level each time, the algorithm may fall into the trap of local optimum and fail to obtain the global optimal solution; randomly generate an array m of size 30, each element of which has a value range between 0 and 1, and sort them from small to large; if the cumulative probability q(x i ) is greater than the element m[i] in the array, then the test paper x i If it is selected and is less than m[i], the next one is compared until all test papers are selected;
[0100] Step 4: Test question exchange; randomly select two sets of test papers for pairing, generate a random number between [0, 1], and compare it with the crossover probability of 0.5. When the random number is less than the crossover probability, randomly select a crossover point and exchange the genes after the crossover point; check whether there are repeated elements, and if so, replace them with questions with the same configuration;
[0101] Step 5: Test question mutation: For each question in the test paper, generate a random number and compare it with the mutation probability 0.1. If it is less than the mutation probability, replace it with a question with the same configuration and calculate the fitness of the individual in the new test paper after mutation.
[0102] Step 6: Repeat the iteration until the maximum number of iterations is reached or the fitness converges, and obtain the test paper with the highest fitness.
[0103] Large model test module:
[0104] The user uploads a file, and the system analyzes the intention of the test paper, and tailors a set of test papers with the same knowledge points and appropriate difficulty for the user. First, the large model is trained and fine-tuned using a large amount of question data that has been parsed and stored, and a large language model for test papers dedicated to setting questions is obtained. Then, a prompt word template is set: [Assume that you are a teacher who sets questions. Your task is to generate corresponding questions as required based on the indicators provided by the user, including knowledge points {knowledge}, difficulty {difficulty} and question types {questionType}]. The specific process of setting the test paper with the large model is as follows:
[0105] Step 1: When using the system for the first time, users need to upload a test paper file containing various types of test questions. The test paper format can include various text formats such as Word, PDF, Markdown, etc. According to the test paper file uploaded by the user, the question stem, answer, analysis, question type, and subject are parsed from it;
[0106] Step 2: Input the question stem into the trained knowledge point and difficulty labeling model to obtain the knowledge point and difficulty of the question, and store all data in the database. The system analyzes the user's test paper composition intention based on the uploaded test paper data;
[0107] Step 3: Obtain similar questions based on the question stem, answer, and analysis content;
[0108] Step 4: Use genetic algorithm to obtain the test questions with the highest fitness in the test bank;
[0109] Step 5: According to the user's test paper composition intention, the corresponding parameters are replaced into the template and input into the test paper language model, and the test paper language model automatically generates the corresponding test questions according to the requirements;
[0110] Step 6: Finally, similar questions generated by analogy, questions generated by genetic algorithm and questions generated by the large language model of the test paper are combined and automatically typeset according to user needs; in addition, users can manually adjust the position of questions and select questions with the same configuration to replace them, so as to generate a new test paper; the format of the test paper can include various text forms such as Word, PDF, Markdown, etc. Users can download and use them through the link provided by the system; the process of large model test paper generation is as follows Figure 6 shown.
[0111] The traditional test paper composition method and system usually rely on the subjective judgment and teaching experience of teachers when generating test papers. This method is easily affected by personal preferences and limitations, resulting in a lack of objectivity and diversity in the design of test papers. In contrast, the present invention uses advanced artificial intelligence technology to automatically analyze files uploaded by users, deeply understand user needs and teaching content, and thus accurately customize a set of test papers that meet the requirements. Not only that, the present invention can also ensure that the knowledge points and difficulty of the test paper match the files uploaded by the user, effectively solving the subjectivity and limitations of traditional test paper composition methods, and providing a more objective and efficient solution for teaching evaluation.
[0112] The traditional test paper composition method and system rely on a fixed question bank, and the content of the generated test paper remains unchanged, which easily leads students to mechanically memorize the answers and ignore the importance of truly understanding the knowledge points. The present invention can generate similar questions that can be applied to the corresponding questions in real time, continuously expand the scope of questions, stimulate students' thinking, and promote the cultivation of deep understanding and application capabilities. Through the design of diverse and flexible questions, students are encouraged to think and explore, avoiding dependence on specific answers. This method cultivates students' innovative consciousness and problem-solving ability, thereby improving teaching quality and learning effects.
[0113] On the one hand, the traditional test paper composition method requires a lot of time and human resources, and on the other hand, the quality of the test papers generated varies greatly. The present invention uses a three-layer large model technology to generate test questions, which can greatly shorten the time for test question writing and reduce labor costs. At the same time, combined with the question bank composition and the question bank-free model generation method, it fully utilizes the massive data and language comprehension ability trained, automatically marks the knowledge points and difficulty of the test questions, and generates more accurate and effective test questions. Advanced artificial intelligence test paper composition technology promotes the innovation and reform of education and teaching methods, promotes the process of education informatization, and provides more possibilities and opportunities for education and teaching.
[0114] The above are only preferred embodiments of the present invention and are not intended to limit the present invention in any form. Any technician familiar with the profession, without departing from the scope of the technical solution of the present invention and based on the technical essence of the present invention, may make any simple modifications, equivalent substitutions and improvements to the above embodiments, which are still within the protection scope of the technical solution of the present invention.
Claims
1. An intelligent test paper composition method based on a large language model, characterized in that: The following steps are involved: Analyze test questions and form a preliminary standard test question bank; The questions in the preliminary standard question bank are labeled with knowledge points and difficulty according to the difficulty system architecture of each subject question. The large model training and fine-tuning technology is used to perform knowledge point and difficulty labeling training to form a large language model of the test paper. Customize the test paper according to user needs, obtain the knowledge points and difficulty of the test paper through large model training and fine-tuning technology, and analyze the user's test paper intention; The similar question recommendation method, genetic algorithm method and test paper large language model method are combined, and the question types, knowledge point coverage and difficulty factors are comprehensively considered to generate test papers that meet teaching needs and user customization needs.
2. The intelligent test paper composition method based on a large language model according to claim 1, characterized in that: The aforementioned analysis of test questions forms a preliminary standard test question bank by analyzing the test questions based on OSS storage, regular expression matching and OCR recognition technology, so that the test questions are decomposed and stored in the bank; the test question data is stored using OSS storage, and the test question title and question type are segmented using regular expression matching technology to obtain the test question subject and question type fields, and for each question type, regular expressions and OCR technology are used to analyze the question stem, answer and analysis, and the test question subject and question type field data are merged and stored with the analyzed question stem, answer and analysis data.
3. The intelligent test paper composition method based on a large language model according to claim 1, characterized in that: According to the corresponding textbooks of each subject test questions, standard graded knowledge points are formulated to form a graded difficulty system architecture, and a large amount of test paper data is used to train and fine-tune the knowledge points and difficulty annotations to form a large test paper language model; several question stems for this test paper are input into the trained test paper language model to obtain a standard test question bank containing corresponding knowledge points and difficulty, and the test paper intention is analyzed through question types, knowledge points and difficulty.
4. The intelligent test paper composition method based on a large language model according to claim 1, characterized in that: The method of recommending similar questions is to use the big model technology to adapt the original questions in the standard test question bank of this test, generate similar but different difficulty and type of analogy questions, and incorporate them into the standard test question bank.
5. The intelligent test paper composition method based on a large language model according to claim 1 is characterized in that: The genetic algorithm question-setting method is to use a genetic algorithm to obtain the best question matching the subject content and the student's ability. The specific steps are as follows: Step (1): Initialize the test paper, set the test paper initial list I = {1, 2, ..., i}, i is the number of test paper sets randomly selected from the standard test question bank according to the number of questions set by the user; Step (2): Calculate the test paper fitness. First, calculate the knowledge point coverage C of each test paper. i and the difficulty of the question D i The knowledge point coverage is the ratio of the number of knowledge points involved in the question to the number of questions in the whole test paper. The difficulty of the whole test paper is the average difficulty of all questions: Among them, p is the number of knowledge points involved in all questions in this test paper, q is the number of questions in the whole test paper, and d j is the difficulty of each question, and then the fitness of the i-th test paper f(x i ): f(x i )=1-(1-C i )*α1-|D0-D i |*α2 Among them, α1 and α2 are the weights of knowledge point coverage and test paper difficulty, which are dynamically adjusted according to user needs and the actual situation of test paper composition; D0 is the preset difficulty; Step (3): Select the appropriate test paper. First, generate the probability of selecting the test paper p(x i ) and the cumulative probability q(x i ), the selection probability is the ratio of the fitness of each test paper to the sum of the fitness of all test papers, and the cumulative probability represents the sum of the selection probabilities of all individuals before each individual: Among them, f(x i ) is the fitness of the i-th test paper, is the sum of the fitness of all test papers; then the roulette strategy is used to select m individuals, which can correct the problem of falling into the local optimum; randomly generate an array m, each element of which has a value range between 0 and 1, and sort them from small to large. If the cumulative probability q(x i ) is greater than the element m[i] in the array, then the test paper x i If it is selected and is less than m[i], the next one is compared until all test papers are selected; Step (4): Test question exchange: randomly select two sets of test papers for pairing, generate a random number between [0, 1], and compare it with the crossover probability of 0.
5. When the random number is less than the crossover probability, randomly select a crossover point and exchange the genes after the crossover point. Check whether there are repeated elements. If so, replace them with questions with the same configuration. Step (5): Test question mutation. For each question in the test paper, generate a random number and compare it with the mutation probability 0.
1. If it is less than the mutation probability, replace it with a question with the same configuration and calculate the fitness of the individual in the new test paper after mutation. Step (6): Repeat the iteration until the maximum number of iterations is reached or the fitness converges, and obtain the test paper with the highest fitness.
6. The intelligent test paper composition method based on a large language model according to claim 1, characterized in that: The method of combining the similar question recommendation method, the genetic algorithm method and the test paper large language model method, comprehensively considering the question type, knowledge point coverage and difficulty factors, and generating a test paper that meets the teaching needs and meets the user's customization needs is as follows: according to the test paper composition intention, the question type, knowledge point and difficulty parameters are input into the fine-tuned test paper large language model, combined with the similar question recommendation method and the genetic algorithm method, the corresponding test questions are generated, and a new test paper is generated according to the user's needs. The specific steps are as follows: Step (1): according to the test paper file uploaded by the user for setting test questions, the question stem, answer, analysis, question type and subject are parsed therefrom; Step (2): Input the question stem of the test paper file into the trained test paper language model to obtain the knowledge points and difficulty of the question, and analyze the user's test paper composition intention; Step (3): Obtain similar questions that can be applied to other situations based on the question stem, answer, and analysis content; Step (4): Use genetic algorithm to obtain the test question with the highest fitness in the test bank; Step (5): according to the user's test paper composition intention, the corresponding parameters are input into the test paper language model, and the corresponding test questions are generated by the test paper language model; Step (6): Format according to user requirements and generate a new test paper.
7. An intelligent test-taking system based on a large language model, characterized in that: include: The test question analysis layer includes a picture storage module and a test question analysis module. The picture storage module is used to store test question pictures, and the test question analysis module is used to analyze test questions to form a preliminary standard test question library. The knowledge point and difficulty annotation layer includes a large model training fine-tuning module, a knowledge point annotation module and a difficulty annotation module. The knowledge point annotation module and the difficulty annotation module are used to annotate the knowledge points and difficulty of the questions in the preliminary standard question bank according to the difficulty system architecture of each subject question. The large model training fine-tuning module is used to perform knowledge point and difficulty annotation training using the large model training fine-tuning technology to form a large language model of the test paper. The intelligent test-taking layer includes a similar question generation module, a genetic test-taking module and a large model test-taking module. The similar question generation module is used to adapt the original questions of the current test-taking question stem in the test-taking standard question bank to generate similar but different difficulty and type of analogy questions; the genetic test-taking module is used to obtain the questions that best match the subject content and student ability; The large model test-setting module is used to obtain the knowledge points and difficulty levels used for test-setting, analyze the user's test-setting intention, customize the test according to user needs, combine the similar question recommendation method, genetic algorithm question-setting method and the test paper large language model question-setting method, comprehensively consider the question type, knowledge point coverage and difficulty factors, and generate test papers that meet teaching needs and meet user customization needs.
8. The intelligent test paper composition method based on a large language model according to claim 7 is characterized in that: The test question parsing module includes a regular processing module, an OCR recognition module and a data storage module. The regular processing module is used to segment the test question title and question type to obtain the test question subject and question type fields. For each question type, the regular processing module and the OCR recognition module are used to parse the question stem, answer and analysis respectively. The test question subject and question type field data are merged with the parsed question stem, answer and analysis data and stored in the data storage module.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the intelligent test paper composition method based on a large language model as described in any one of claims 1 to 6 is implemented.
10. A computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the intelligent test paper composition method based on a large language model as described in any one of claims 1 to 6.
Citation Information
Cited By
Method and system for automatically labeling knowledge points of large language model
CN119357310A
Multi-round iteration mathematical question generation method, system and device and storage medium
CN122115169A
