Self-study examination-oriented large model automatic proposition method, system, device and medium
By using a large-scale model for automatic question generation, the problems of heavy workload for teachers and unstable question quality in traditional self-study examinations have been solved, achieving efficient and accurate self-study examination question generation that can meet the question generation needs of different subjects.
Patent Information
- Application Number
- CN202510473875.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2045-04-15
AI Technical Summary
Traditional self-study exam question-setting methods result in a heavy workload for teachers, poor stability in the quality of exam questions, and difficulty in adapting to the challenges of an increasing number of subjects.
The method of automatic question generation using a large model is adopted. By scanning and optical character recognition of self-study examination materials, a mapping relationship between textbooks, knowledge points and subject test questions is established, and the large model is used for training to output the basis for question generation.
It improves the efficiency and quality of question setting, enhances the adaptability and robustness of the model, and can be applied to the question setting needs of different disciplines.
Smart Images

Figure CN120045638B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence and educational technology, and specifically relates to a large-model automatic question setting method for self-study examinations, an automatic question setting system, a computer device, and a storable medium. Background Art
[0002] In the past, the self-study exam formulation process relied primarily on the experience and intuition of educational experts, as well as manual research to create questions. While this approach ensured professionalism and accuracy, its limitations became increasingly apparent with the development of the times and the expansion of the education system. The increasing number of self-study exam subjects has placed an increasingly daunting task on teachers, who not only need to master a broad range of knowledge but also design exam questions that both meet the requirements of the syllabus and effectively assess student learning outcomes.
[0003] Traditionally, teachers must devote significant time and energy to repetitive tasks, such as locating reference materials, determining the appropriate difficulty level, and ensuring that questions cover all necessary knowledge points. This high workload not only places a heavy workload on teachers, but can also affect the quality and fairness of question setting due to human factors.
[0004] Recent advances in artificial intelligence (AI), particularly large language models and other machine learning algorithms, have opened up new possibilities for addressing these challenges. These large models, trained on vast amounts of data, can understand complex language structures and demonstrate strong adaptability and innovation across diverse industries, potentially replacing manual and tedious human tasks. Therefore, applying large model-related technologies to self-study exams holds significant significance. Summary of the Invention
[0005] The main purpose of the present invention is to solve the problems of heavy workload for teachers and unstable test question quality in traditional self-study examination question setting methods. In order to improve the question setting efficiency of self-study examinations, a large-model automatic question setting method, automatic question setting system, computer equipment, and storable medium for self-study examinations are provided to adapt to the question setting of different subjects.
[0006] In order to achieve the first objective, the present invention discloses a large-scale automatic question setting method for self-study examinations, comprising the following steps:
[0007] S1. Scan different self-study examination subject papers, self-study examination exercises and self-study examination teaching materials, and pre-process them to obtain clear electronic document images;
[0008] S2. Electronically image document and archive text content through optical character recognition;
[0009] S3, establish the mapping relationship of teaching material document-knowledge point-subject test and knowledge point-cognitive level-subject test, obtain teaching material document-knowledge point-subject test data set and knowledge point-cognitive level-subject test data set;
[0010] S4, training the large model by using the teaching material document-knowledge point-subject test data set and the knowledge point-cognitive level-subject test data set;
[0011] S5, input the teaching material content and knowledge point to be set into the trained large model, and output the set test questions, answers and setting basis related to the teaching material content.
[0012] Further, the large model comprises a text encoding layer and a model main body connected in sequence; wherein in the text encoding layer, considering the factor that the self-study teaching material content is long in length, the original model structure is difficult to adapt to the long document, the rotation position coding is introduced, and the length and ability of the large model reasoning are improved; the model main body is a multi-layer network module, which fully extracts the global semantic features of the teaching material text, effectively understands the teaching material content, and improves the setting quality;
[0013] The text encoding layer uses byte pair encoding as a segmentation method, encodes the input text, encodes different teaching materials and test questions of different lengths into initial text vectors of the same dimension, and records the text encoding layer as G( ), The definition is as follows:
[0014]
[0015] Among them, The initial input teaching material document content has a length of , The initial text vector after the text encoding layer is represented by , which contains word embedding vectors with a dimension of ;
[0016] The rotation position coding is introduced on the basis of the initial text vector, and the definition is as follows:
[0017]
[0018] Among them, The frequency parameter used for rotation position coding is represented by The index number is represented by =1,2…,d-1, and The down rounding function is represented by Therefore, the rotation position coding And the final text vector The definition is as follows:
[0019]
[0020]
[0021] in, Represents the position index of each element in the input text, and Respectively The middle position is and The word embedding vector of and denote the cosine function and sine function respectively;
[0022] The model backbone includes 32 layers of network modules connected sequentially, where each layer of the network module includes a first root mean square layer, an attention layer, a second root mean square layer, and a multilayer perceptron. The first and second root mean square layers are used to scale the input vector. The scaling operation formula is defined as follows:
[0023]
[0024] in, is a text vector No. elements, It is with The learnable parameters corresponding to the elements are Indicates the number of elements in the input vector;
[0025] The attention layer uses a group query attention mechanism, where each group of queries shares the same key and value, defined as follows:
[0026]
[0027] in, Is the query matrix, the query matrix is divided into groups, Represents the index of the group, =1,2…,G, and Respectively represent The key matrix and value matrix of each group, multiple query matrices in the same group correspond to the same key matrix and value matrix, represents the normalized exponential function, Represents the dimension of the key, used to scale the dot product to stabilize the gradient;
[0028] The multilayer perceptron consists of three linear layers and an activation function. The activation function is used to capture the nonlinear relationship in the input data. The multilayer perceptron performs weighted processing on the information at different positions in the output sequence of the attention layer to form a more informative vector representation, which is defined as follows:
[0029]
[0030] in, represents the vector of the second RMS layer output, 、 and denote the weight matrices of the first, second and third linear layers respectively, 、 and denote the bias vectors of the first, second and third linear layers respectively, represents the output of the first linear layer, represents the output of the second linear layer, represents the SwiGLU activation function, which takes the output of the first linear layer as input. Represents element-wise multiplication between matrices.
[0031] Furthermore, the text encoding layer accepts the initial input textbook document content The model backbone is connected to the text vector output by the text encoding layer. In the first network module of the model backbone, the output of the first root mean square layer is connected to the input of the attention layer. The input passes through the query matrix and key matrix, dot multiplication, and normalized exponential function in the attention layer, and is matrix multiplied with the output of the value matrix. The output of the attention layer is connected to the second root mean square layer, and the output of the second root mean square layer is connected to the input of the multilayer perceptron. After passing through the first linear layer and activation function in the multilayer perceptron, the output of the dot multiplication operation with the input through the second linear layer is connected to the third linear layer to obtain the final output of the first network module; the input of the second network module is connected to the output of the first network module, and so on. After passing through 32 layers of network modules, the final output text is obtained.
[0032] Furthermore, the traditional manual mapping method is not only time-consuming and labor-intensive, but also difficult to establish when knowledge points are associated with multiple textbook documents across chapters. Therefore, we use the similarity information between documents and knowledge points, as well as the cognitive level information of subject questions in the exam syllabus, to establish mapping relationships. This greatly speeds up the processing time of a single textbook and improves the mapping accuracy.
[0033] The process of establishing the mapping relationship between textbook content, knowledge points and subject test questions, as well as knowledge points, cognitive levels and subject test questions in step S3 is as follows:
[0034] S301, extract the knowledge points corresponding to the teaching materials and the cognitive levels of the knowledge points from the examination syllabus of different subjects of self-study examinations, and establish the mapping of teaching materials and knowledge points and the mapping of knowledge points and cognitive levels;
[0035] S302, the mapping relationship of teaching material document-knowledge point-subject test and knowledge point-cognitive level-subject test is established by keyword matching operation and text similarity matching operation:
[0036] Keyword matching operation: divide the teaching materials into several documents according to the sections, preprocess the documents and true questions, including removing stop words, removing punctuation marks and special characters and word segmentation; extract keywords from the preprocessed documents and true questions to obtain document keyword vectors and true question keyword vectors, and calculate the keyword matching degree by similarity;
[0037] Text similarity matching operation: encode the document and the true question respectively, calculate the cosine similarity between the teaching material segment vector and the true question vector; weight the keyword matching degree and the cosine similarity, select the keyword matching degree weight and the cosine similarity weight, calculate the comprehensive score of each true question with all documents, and select the document with the highest comprehensive score as the mapping result;
[0038] S303, after obtaining the mapping relationship of teaching material document-knowledge point-subject test and knowledge point-cognitive level-subject test, according to the proposition type of self-study examination true question, the proposition type includes single choice question, multiple choice question, fill in the blank question, short answer question, name explanation question, case question; the above mapping relationship is constructed into the following four types of data formats to obtain the final teaching material document-knowledge point-subject test data set and knowledge point-cognitive level-subject test data set:
[0039] (1) input: please make test questions according to the following teaching material content {teaching material document}, output: {subject test question};
[0040] (2) input: please make test questions according to the following teaching material content and knowledge point {teaching material document} {knowledge point}, output: {subject test question};
[0041] (3) input: please make test questions according to the following knowledge point and cognitive level {knowledge point} {cognitive level}, output: {subject test question};
[0042] (4) input: please judge the corresponding cognitive level of the following subject test question {subject test question}, output: {cognitive level}.
[0043] Further, the specific process of training the large model by using the teaching material-test question document data set in step S4 is as follows:
[0044] S401, initialize the automatic proposition large model, set the training round, input the teaching material document and truncate according to the specified maximum length, select the AdamW optimizer, set the batch size, set the gradient accumulation step, and obtain the initial training setting;
[0045] S402, divide the teaching material-exam document dataset into several batches, randomly select a batch of teaching material-exam document label pairs from the divided dataset, and input the large model for forward propagation to obtain the predicted text;
[0046] S403, calculate the difference between the target text and the predicted text using the large model loss function, and update the large model parameters using the error back propagation algorithm;
[0047] S404, save the checkpoint every specified training step, and evaluate the performance of the current training number, if the performance does not improve and reaches the early stop threshold, stop training in advance;
[0048] S405, the learning rate is continuously updated according to the training situation, and the new learning rate is obtained according to the learning rate decay strategy.
[0049] Further, for the proposition mode in self-study examination, the four types of data sets constructed are used to train the large model, which effectively improves the proposition quality and proposition efficiency of the large model in self-study examination, and the large model loss function is defined as:
[0050]
[0051]
[0052]
[0053]
[0054]
[0055] wherein, represents the large model loss function, represents the large model parameter, , , and correspond to the four types of data sets described above, , , and represent the number of samples used for training in each data set, and the , 、 and a training sample input teaching material text segment, 、 、 and each data set 、 、 and subject questions corresponding to the training sample, and represent the knowledge points corresponding to the 、 training sample, and the cognitive level corresponding to the and training sample, is the conditional probability distribution, and given the condition , output probability.
[0056] The second object of the application is to provide a large model automatic test setting method and system for self-study examination, for executing the above-mentioned large model automatic test setting method for self-study examination, the large model automatic test setting system comprises:
[0057] a scanning preprocessing module, which scans different self-study examination subject papers, self-study examination exercises and self-study examination textbooks, and pre-processes to obtain clear electronic document images;
[0058] an optical character recognition module, which recognizes the electronic document images by optical character recognition and archives the text content;
[0059] a mapping relationship and data set construction module, which establishes the mapping relationship of teaching material document-knowledge point-subject question and knowledge point-cognitive level-subject question, and obtains the teaching material document-knowledge point-subject question data set and the knowledge point-cognitive level-subject question data set;
[0060] a large model training module, which trains the large model by using the teaching material document-knowledge point-subject question data set and the knowledge point-cognitive level-subject question data set;
[0061] a self-study examination test setting module, which inputs the teaching material content and knowledge points to be set into the trained large model, and outputs the set test questions, answers and test setting basis related to the teaching material content.
[0062] The third object of the application is to provide a computer device, comprising a processor and a memory for storing programs executable by the processor, when the processor executes the programs stored in the memory, the above-mentioned large model automatic test setting method for self-study examination is realized.
[0063] The fourth object of the present application is to provide a storage medium storing a program which, when executed by a processor, implements the above-mentioned large model automatic test paper setting method for self-study examinations.
[0064] Compared with the prior art, the present application has the following advantages and beneficial effects:
[0065] 1. The present application discloses a large model automatic test paper setting method and system for self-study examinations, and proposes a large model for fully automatic test paper setting of self-study examinations. The model is trained using the constructed textbook-test paper document dataset, so that the large model masters the test paper setting mode and characteristics of self-study examinations, ensuring the stability of the model test paper setting quality. At the same time, the model is deployed in a paging manner, effectively accelerating the inference speed of the model and enhancing the adaptability of the model in practical applications.
[0066] 2. Compared with the existing test paper setting method, the present application can continuously expand the capability of the model by continuously enriching the textbook-test paper document dataset in the face of the increasing subjects of self-study examinations, ensuring the robustness of the model. The technical solution of the present application has strong subject universality and can be applied to different subject education scenarios. BRIEF DESCRIPTION OF DRAWINGS
[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor
[0068] Figure 1 is a flowchart of a large model automatic test paper setting method and system for self-study examinations disclosed in embodiment 1 of the present application;
[0069] Figure 2 is a model structure diagram of a large model automatic test paper setting method for self-study examinations disclosed in the present application;
[0070] Figure 3 is a network structure diagram of a self-study examination test paper setting large model disclosed in the present application;
[0071] Figure 4 is a self-study examination test paper setting result schematic diagram disclosed in the present application;
[0072] Figure 5 is a structure block diagram of a large model automatic test paper setting system for self-study examinations disclosed in embodiment 3 of the present application;
[0073] Figure 6This is a structural block diagram of the computer device in Example 4 of the present invention. DETAILED DESCRIPTION
[0074] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0075] Example 1
[0076] Figure 1 This is a flowchart of a large-scale automatic question setting method for self-study examinations disclosed by the present invention. Figure 1 As shown, the present embodiment discloses a large-scale automatic question setting method for self-study examinations, including the following steps: scanning different self-study examination subject papers, self-study examination exercises, and self-study examination textbooks, and pre-processing to obtain clear electronic document images; using optical character recognition to identify the electronic document images and archive the text content; establishing a mapping relationship between textbook content and subject examination questions to obtain a textbook document-examination document data set; using the textbook document-examination document data set to train the automatic question setting large model; deploying the large model to achieve offline scenario availability; inputting the textbook content and knowledge points to be set into the automatic question setting large model trained with the document data set, and outputting the set test questions, answers, and question setting basis related to the textbook content, as follows:
[0077] T1. Scan different self-study examination subject papers, self-study examination exercises and self-study examination textbooks, and pre-process them to obtain clear electronic document images;
[0078] T2. Electronically image document and archive text content through optical character recognition;
[0079] T3. Establish the mapping relationships between textbook documents, knowledge points, and subject questions, and between knowledge points, cognitive levels, and subject questions, and obtain the textbook documents, knowledge points, and subject questions datasets, and the knowledge points, cognitive levels, and subject questions datasets.
[0080] In this embodiment, the mapping relationship established in T3 adopts the keyword matching and text similarity weighting method. Specifically, the teaching material is divided into several documents according to the section, and the documents and true questions are preprocessed, including removing stop words, removing punctuation and special characters, and segmenting words. Key words are extracted from the preprocessed documents and true questions to obtain document keyword vectors and true question keyword vectors. The keyword matching degree is obtained by using TF-IDF calculation and the like. The documents and true questions are encoded respectively, and the cosine similarity between the teaching material segment vector and the true question vector is calculated. The keyword matching degree and the cosine similarity are weighted and summed, the keyword matching degree weight and the cosine similarity weight are selected, the comprehensive score of each true question with all documents is calculated, and the document with the highest comprehensive score is selected as the mapping result. Taking the "hotel strategic management tutorial" in the self-examination discipline as an example, the teaching material is "hotel strategic management tutorial", which is divided into 51 documents according to the section, and the knowledge point is "requirements for hotel strategic target setting". The true question is a multiple choice question: "The requirements for hotel strategic target setting are: A. Specificity B. Measurability C. Achievability D. Irrelevance". The teaching material document and the true question are calculated by TF-IDF, the keyword matching degree weight is 0.4, the cosine similarity weight is 0.6, the third chapter hotel strategic mission and target of the teaching material document, the second section hotel strategic target has the highest score, the keyword matching degree is 0.95, the cosine similarity is 0.86, and the final score obtained by weighted summation is 0.896. Compared with the traditional manual mapping method, the similarity establishment method of the present application improves the mapping accuracy by 8%, reduces the single chapter processing time by 98%, and increases the cross-chapter association by 65%.
[0081] T4, training a large model using a teaching material document-knowledge point-discipline question data set and a knowledge point-cognitive level-discipline question data set;
[0082] In this embodiment, the training process in T4 is as follows:
[0083] T401, initializing the automatic proposition large model, setting the training round to 3, truncating the input teaching material document to a maximum length of 10000 characters, selecting the AdamW optimizer, setting the batch size to 8, setting the gradient accumulation step to 8, and obtaining the initial training setting;
[0084] T402, dividing the teaching material-question document data set into several batches, randomly selecting a batch of teaching material-question document label pairs from the divided data set, and inputting the large model for forward propagation to obtain the predicted text;
[0085] T403, calculating the difference between the target text and the predicted text using the large model loss function, and updating the parameters of the large model using the error back propagation algorithm;
[0086] T404, save the checkpoint every 2000 training steps, and evaluate the performance of the current training number, if the performance is not improved and reaches the early stop threshold, the training is stopped in advance;
[0087] T405, the training process continuously updates the learning rate according to the training situation, and obtains a new learning rate according to the learning rate decay strategy.
[0088] T5, input the teaching material content and knowledge points to be set into the trained large model, and output the setting test questions, answers and setting basis related to the teaching material content.
[0089] Table 1. The accuracy of the present application in 5 self-study disciplines is compared with the traditional manual mapping, single chapter processing time and cross chapter association.
[0090]
[0091] As shown in Table 1, the self-study examination-oriented large model automatic setting method disclosed in the embodiment is verified and compared with the traditional manual setting method. The artificial mapping accuracy, single chapter processing time and cross chapter association of the two setting methods are compared. The artificial mapping accuracy of the mapping model of the present application is 90%, the accuracy of the traditional artificial mapping is 82%, which is 8 percentage points higher than that of the traditional artificial mapping. The single chapter processing time of the mapping model of the present application is 8.2 seconds, and the single chapter processing time of the traditional artificial mapping is 7 minutes. The single chapter processing speed of the mapping model of the present application is improved by an order of magnitude. In addition, while the processing speed is improved, the test setting of the mapping model of the present application has 70 cross chapter associations, while the traditional artificial mapping has only 24 cross chapter associations. As shown in Table 1, the present application effectively improves the setting efficiency of the self-study examination test questions, and realizes accurate setting of different disciplines in the self-study examination.
[0092] Embodiment 2
[0093] Based on the self-study examination-oriented large model automatic setting method disclosed in embodiment 1, the present embodiment continues to refer to the steps T1 to T5 of the self-study examination-oriented large model automatic setting method disclosed in embodiment 1, as shown in Figure 1 The method comprises the following steps:
[0094] T1, scanning different self-study examination discipline test papers, self-study examination exercises and self-study examination textbooks, and preprocessing to obtain clear electronic document images;
[0095] T2, recognizing the electronic document image by optical character recognition and archiving the text content;
[0096] T3, establish the mapping relationship of the teaching material document-knowledge point-subject test and the knowledge point-cognitive level-subject test, obtain the teaching material document-knowledge point-subject test data set and the knowledge point-cognitive level-subject test data set;
[0097] T4, training the large model by using the teaching material document-knowledge point-subject test data set and the knowledge point-cognitive level-subject test data set;
[0098] T5, input the teaching material content and the knowledge point to be set into the trained large model, and output the set test questions, answers and setting basis related to the teaching material content.
[0099] In step T5, the setting takes the self-examination subject "education communication" as an example, the input teaching material is "education communication" chapter 6 education communication environment, section 2 function of education communication environment, the required knowledge point is "basic function of education communication environment", the teaching material document and the knowledge point are input into the model, and the setting result of the single choice question is: "the following is the basic function of the education communication environment ( ) A. Interactive function B. Environmental function C. Motivation function D. Control function", wherein the true question corresponding to the teaching material segment is a multiple choice question, which examines the five basic functions of the education communication environment: expansion function, motivation function, refinement function, wisdom function and enhancement function. The large model setting examines the knowledge point and the true question content is close, and the setting type is more diversified, and the setting quality is high.
[0100] In step T5, the experimental results and the comparison results of the existing model without training are shown in Table 2, the experiment is carried out on 5 self-examination subjects (education communication, hotel strategic mission and target, management foundation, human resource development and management and guide science overview), each model sets according to a teaching material and a knowledge point, and a complete test paper is formed, finally, the final knowledge point coverage rate and difficulty coefficient results are obtained by the education experts blind evaluation.
[0101] The self-examination setting large model is better than the model without training in the two evaluation indexes, and is close to the true question setting quality.
[0102] Table 2. Comparison of knowledge point coverage rate and difficulty coefficient of the present application and other methods in 5 self-examination subjects
[0103]
[0104] In summary, as shown in Table 2, the self-study examination-oriented large model automatic paper setting method disclosed in the embodiment is compared with the large model trained without the textbook document-knowledge point-subject test question data set and the knowledge point-cognitive level-subject test question data set under 5 self-study subjects, and the knowledge point coverage and difficulty coefficient, two core paper setting indicators, are analyzed. The knowledge point coverage of the model reaches 95.8%, which is 23.5-43.5 percentage points higher than that of the untrained model (such as Llama2-7B-Chat 52.3%, Baichuan-7B 75.6%), and approaches the 100% coverage of the real test paper. In terms of difficulty coefficient control, the difficulty of the test questions output by the model is stable at 0.61, which is highly consistent with the 0.6 of the real test paper, while the untrained model shows significant fluctuations (such as ChatGLM-6B 0.44, Qwen2-7B 0.64). The experiment shows that the model trained with the textbook-knowledge point-test question triadic data set significantly improves the matching accuracy of test question difficulty and syllabus while retaining the relevance of knowledge points, and its paper setting quality is 2-3 orders of magnitude higher than that of general large models, providing technical support for building a standardized and normalized self-study examination paper setting system.
[0105] Embodiment 3
[0106] As shown in Figure 5 , the embodiment provides a large model automatic paper setting system for self-study examinations, which comprises a scanning preprocessing module 501, an optical character recognition module 502, a mapping relationship and data set construction module 503, a large model training module 504 and a self-study examination test question setting module 505. The specific functions of each module are as follows:
[0107] The scanning preprocessing module 501 scans different self-study examination subject papers, self-study examination exercises and self-study examination textbooks, and pre-processes to obtain clear electronic document images;
[0108] The optical character recognition module 502 recognizes the electronic document images by optical character recognition and archives the text content;
[0109] The mapping relationship and data set construction module 503 establishes the mapping relationship of the textbook document-knowledge point-subject test question and the knowledge point-cognitive level-subject test question, and obtains the textbook document-knowledge point-subject test question data set and the knowledge point-cognitive level-subject test question data set;
[0110] The large model training module 504 trains the large model using the textbook document-knowledge point-subject test question data set and the knowledge point-cognitive level-subject test question data set;
[0111] The self-study examination question setting module 505 inputs the teaching material content and knowledge points to be set into the trained large model, and outputs the set questions, answers and setting basis related to the teaching material content.
[0112] Embodiment 4
[0113] The embodiment provides a computer device which can be a computer, such as Figure 6 As shown, the processor 602, the memory, the input device 603, the display 604 and the network interface 605 are connected through the system bus 601, the processor is used to provide computing and control capability, the memory includes a non-volatile storage medium 606 and an internal memory 607, the non-volatile storage medium 606 stores an operating system, a computer program and a database, the internal memory 607 provides an environment for the running of the operating system and the computer program in the non-volatile storage medium, and when the processor 602 executes the computer program stored in the memory, the above-mentioned self-study examination oriented large model automatic question setting method is realized, and the self-study examination oriented large model automatic question setting method comprises the following steps:
[0114] T1, scanning different self-study examination subject papers, self-study examination exercises and self-study examination textbooks, and preprocessing to obtain clear electronic document images;
[0115] T2, the optical character recognition electronic document image and the archived text content are archived;
[0116] T3, the mapping relationship of the teaching material document-knowledge point-subject question and the knowledge point-cognitive level-subject question is established, and the teaching material document-knowledge point-subject question data set and the knowledge point-cognitive level-subject question data set are obtained;
[0117] T4, the teaching material document-knowledge point-subject question data set and the knowledge point-cognitive level-subject question data set are used to train the large model;
[0118] T5, the teaching material content and knowledge points to be set are input into the trained large model, and the set questions, answers and setting basis related to the teaching material content are output.
[0119] Embodiment 5
[0120] The embodiment provides a storage medium which is a computer readable storage medium and stores a computer program, and when the computer program is executed by a processor, the above-mentioned self-study examination oriented large model automatic question setting method is realized, and the self-study examination oriented large model automatic question setting method comprises the following steps:
[0121] T1, scan different self-study examination subject papers, self-study examination questions and self-study examination textbooks, and preprocess to obtain clear electronic document images;
[0122] T2, recognize the electronic document images by optical character recognition and archive the text content;
[0123] T3, establish mapping relationships of textbook document-knowledge point-subject question and knowledge point-cognitive level-subject question, to obtain textbook document-knowledge point-subject question data set and knowledge point-cognitive level-subject question data set;
[0124] T4, train a large model by using the textbook document-knowledge point-subject question data set and the knowledge point-cognitive level-subject question data set;
[0125] T5, input the textbook content and knowledge points to be set questions into the trained large model, and output the set questions, answers and setting questions related to the textbook content.
[0126] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware. The program can be stored in a non-volatile computer readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments. Any reference to memory, storage, database or other medium used in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM) and memory bus dynamic RAM (RDRAM) and the like.
[0127] The technical features of the above embodiments can be combined in any way. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present disclosure.
[0128] The above embodiments are the preferred embodiments of the present application, but the embodiments of the present application are not limited to the above embodiments, and any changes, modifications, substitutions, combinations, simplifications, etc. made without departing from the spirit and principles of the present application should be equivalent replacement manners and should be included in the protection scope of the present application.
Claims
1. A self-learning examination-oriented large model automatic test paper setting method, characterized in that, The proposition method comprises the following steps: S1, scanning different self-study examination subject papers, self-study examination exercises and self-study examination textbooks, and preprocessing to obtain clear electronic document images; S2, recognizing the electronic document images by optical character and archiving the text content; S3, establishing the mapping relationship of textbook document-knowledge point-subject test and knowledge point-cognitive level-subject test, obtaining the textbook document-knowledge point-subject test data set and the knowledge point-cognitive level-subject test data set; S4, training the large model by using the textbook document-knowledge point-subject test data set and the knowledge point-cognitive level-subject test data set; S5, inputting the textbook content and knowledge points to be set into the trained large model, and outputting the set test questions, answers and proposition basis related to the textbook content; The large model comprises a text coding layer and a model main body connected in sequence, wherein The text coding layer uses byte pair encoding as a segmentation method, encodes the input text, encodes different textbooks and test questions of different lengths into initial text vectors of the same dimension, and records the text coding layer as G(·), which is defined as follows: X init = G(x) wherein x represents an initial input textbook document content, length N, X init represents an initial text vector after a text encoding layer, X init contains N word embedding vectors with dimension d. The rotation position coding is introduced on the basis of the initial text vector, which is defined as follows: where θ i denotes the frequency parameter for the rotation position encoding, i denotes the index number, i = 1, 2,..., d - 1, denotes the floor function, and thus the rotation position encoding R(pos, i) and the final text vector X are defined as follows: R(pos, i) = [[cos(θ i *pos)-sin(θ i *pos)],[sin(θ i *pos),cos(θ i *pos)]] Among them, pos represents the position index of each element in the input text, and Represents X init The word embedding vectors at positions 2i and 2i+1 in the image are represented by cos(·) and sin(·), which represent the cosine function and sine function respectively. The model main body comprises 32 network modules connected in sequence, wherein each network module comprises a first root mean square layer, an attention layer, a second root mean square layer and a multi-layer perceptron, the first root mean square layer and the second root mean square layer are used to scale the input vector, and the scaling operation formula is defined as follows: wherein x j is the jth element of the text vector X, g j is a learnable parameter corresponding to the jth element, and T represents the number of elements of the input vector; the attention layer adopts a grouped query attention mechanism, and each group of queries shares the same key and value, which is defined as follows: where Q is a query matrix, Q is divided into G groups, g represents the index of the group, g = 1, 2, …, G, K g and V g respectively represent the key matrix and the value matrix of the gth group, the plurality of query matrices in the same group correspond to the same key matrix and value matrix, softmax(·) represents a normalized exponential function, d k represents the dimension of the key, and is used to scale the dot product to stabilize the gradient; The multi-layer perceptron is composed of three linear layers and an activation function, the activation function is used to capture the nonlinear relationship in the input data, the multi-layer perceptron performs weighted processing on the information at different positions in the attention layer output sequence to form a more informative vector representation, which is defined as follows: MLP(h)=W3(σ(W1h+b1)☉(W2h+b2))+b3 Wherein, h represents the vector output by the second root mean square layer, W1, W2 and W3 represent the weight matrix of the first, second and third linear layers respectively, b1, b2 and b3 represent the bias vector of the first, second and third linear layers respectively, W1h+b1 represents the output of the first linear layer, W2h+b2 represents the output of the second linear layer, σ represents the SwiGLU activation function, the output of the first linear layer is taken as the input, and represents the element-wise multiplication between matrices.
2. The self-learning examination-oriented large model automatic test paper generation method according to claim 1, characterized in that, The working process of the large model is as follows: The text encoding layer accepts the initial input teaching material document content x, the model backbone connects the text vector output by the text encoding layer, in the first layer network module of the model backbone, the output of the first root mean square layer is connected to the input of the attention layer, the input is subjected to query matrix and key matrix, dot product operation, normalization exponential function, matrix multiplication with the output of the input through the value matrix, the output of the attention layer is connected to the second root mean square layer, the output of the second root mean square layer is connected to the input of the multilayer perceptron, and the output of the first linear layer and the activation function in the multilayer perceptron is connected to the output of the input through the second linear layer Dot product operation is connected to the third linear layer to obtain the final output of the first layer network module; the input of the second layer network module is connected to the output of the first layer network module, and so on, after passing through 32 layer network modules, the final output text is obtained.
3. The self-learning examination-oriented large model automatic test paper generation method of claim 1, wherein, The mapping relationship between the teaching material content, the knowledge point and the subject test question and the knowledge point, the cognitive level and the subject test question in the step S3 is as follows: S301, from the examination outline of different subjects of self-study examination, the corresponding knowledge points of the teaching material and the cognitive level of the knowledge points are extracted, and the mapping of the teaching material and the knowledge points and the mapping of the knowledge points and the cognitive level are established; S302, the mapping relationship of the teaching material document-knowledge point-subject test question and the knowledge point-cognitive level-subject test question is established through keyword matching operation and text similarity matching operation: Keyword matching operation: the teaching material is divided into several documents according to the section, the document and the true question are pretreated, including removing stop words, removing punctuation marks and special characters and dividing words; the keywords are extracted from the pretreated document and true question, and the document keyword vector and the true question keyword vector are obtained, and the keyword matching degree is obtained by similarity calculation; Text similarity matching operation: the document and the true question are encoded respectively, and the cosine similarity between the teaching material segment vector and the true question vector is calculated; the keyword matching degree and the cosine similarity are weighted and summed, the keyword matching degree weight and the cosine similarity weight are selected, and the comprehensive score of each true question with all documents is calculated, and the document with the highest comprehensive score is selected as the mapping result; S303, after obtaining the mapping relationship of the teaching material document-knowledge point-subject test question and the knowledge point-cognitive level-subject test question, according to the proposition type of the self-study examination true question, the proposition type includes single choice question, multiple choice question, fill in the blank question, short answer question, name explanation question and case question; the above mapping relationship is constructed into the following four types of data formats to obtain the final teaching material document-knowledge point-subject test question data set and knowledge point-cognitive level-subject test question data set: (1) input: please make test questions according to the following teaching material content {teaching material document}, output: {subject test question}; (2) input: please make test questions according to the following teaching material content and knowledge point {teaching material document} {knowledge point}, output: {subject test question}; (3) input: please make test questions according to the following knowledge point and cognitive level {knowledge point} {cognitive level}, output: {subject test question}; (4) input: please judge the corresponding cognitive level of the following subject test question {subject test question}, output: {cognitive level}.
4. The self-learning examination-oriented large model automatic test paper generation method according to claim 1, characterized in that, The step S4 adopts the textbook-question document dataset to train the large model, and the specific process is as follows: S401, initialize the automatic proposition large model, set the training round, input the textbook document and truncate according to the specified maximum length, select the AdamW optimizer, set the batch size, set the gradient accumulation step, and get the initial training setting; S402, divide the textbook-question document dataset into several batches, randomly select a batch of textbook-question document label pairs from the divided dataset, and input the large model for forward propagation to get the predicted text; S403, calculate the difference between the target text and the predicted text by using the large model loss function, and update the parameters of the large model by using the error back propagation algorithm; S404, save the checkpoint every specified training step, and evaluate the performance of the current training number, if the performance does not improve and reaches the early stop threshold, stop training in advance; S405, continuously update the learning rate according to the training condition, and get the new learning rate according to the learning rate decay strategy.
5. The self-learning examination-oriented large model automatic test paper generation method according to claim 4, characterized in that, The large model loss function L(θ) is defined as: L(θ)=L1(θ)+L2(θ)+L3(θ)+L4(θ) Among them, L(θ) represents the large model loss function, θ represents the large model parameters, L1(θ), L2(θ), L3(θ) and L4(θ) correspond to the above four types of data sets respectively, N1, N2, N3 and N4 represent the number of samples used for training in each data set, and The k1, k2, k3 and k4 training samples in each data set are input into the textbook text fragments. and The subject test questions corresponding to the k1, k2, k3 and k4 training samples in each data set, and Indicates the knowledge points corresponding to the k2th and k3th training samples, and The cognitive levels corresponding to the k3 and k4 training samples, P(a|b) is the conditional probability distribution, which is the probability of outputting a given condition b.
6. A self-learning examination-oriented large model automatic paper setting system for executing the self-learning examination-oriented large model automatic paper setting method according to any one of claims 1 to 5, characterized in that, The large model automatic proposition system comprises: A scanning preprocessing module scans different self-study examination subject papers, self-study examination questions and self-study examination textbooks, and preprocesses to obtain clear electronic document images; An optical character recognition module recognizes the electronic document images by optical character recognition and archives the text content; A mapping relationship and dataset construction module establishes the mapping relationship of textbook document-knowledge point-subject question and knowledge point-cognitive level-subject question, and obtains the textbook document-knowledge point-subject question dataset and knowledge point-cognitive level-subject question dataset; A large model training module trains the large model by using the textbook document-knowledge point-subject question dataset and the knowledge point-cognitive level-subject question dataset; A self-study examination question setting module inputs the textbook content and knowledge points to be set into the trained large model, and outputs the set questions, answers and proposition basis related to the textbook content.
7. A computer device comprising a processor and a memory for storing a processor executable program, characterized in that, The processor executes the program stored in the memory to realize the large model automatic proposition method for self-study examination of any one of claims 1-5.
8. A storage medium storing a program, characterized by comprising: The program is executed by the processor to realize the large model automatic proposition method for self-study examination of any one of claims 1-5.
Citation Information
Patent Citations
Exercise generation method and device based on language model and medium
CN116561260A
Automatic test paper generation method and system, electronic equipment and medium
CN117195867A