Examination question similarity calculation method, medium and equipment
Through pre-training and quadratic training of deep learning models, combined with vector coding calculation, the problem of poor similarity of the existing technical middle school entrance examination questions is solved, and the accurate similarity analysis of the test questions and the deep understanding of the knowledge points is achieved, and the Repeat investigation.
Patent Information
- Application Number
- CN202411614954.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-11-13
AI Technical Summary
The existing test questions have low accuracy, cannot understand the differences in semantics, cannot quickly update newly added questions, and traditional methods cannot deeply understand the context semantics and logical relationships in the text, resulting in the inability to accurately and efficiently determine similarity.
Using the test questions similarity calculation method based on deep learning model, the deep learning model is pre-trained and quadratic training, the language analysis and label labeling capabilities are optimized, the similarity between test questions is calculated using vector encoding, and the pre-processing and labeling are combined. Information, improve the understanding of semantic relationships and characteristics.
The accurate similarity analysis of the test questions is achieved, similar knowledge points are avoided repeatedly examined, the accuracy of the test questions feature extraction and labeling is improved, and the ability to understand the semantics of the test questions is enhanced.
Smart Images

Figure CN119129608A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of text information processing, and in particular to a method, medium and device for calculating test question similarity. Background Art
[0002] In the prior art, the similarity comparison method for test questions is mainly based on simple technologies such as keyword matching and text edit distance, which have problems such as low accuracy and inability to understand semantics. For example, questions with similar semantics but different expressions may be misjudged as dissimilar only through keyword matching, and the method based on edit distance is difficult to handle differences at the semantic level. It is impossible to process diversified information sources, and it is impossible to deeply understand the contextual semantics and logical relationships in the text. For the ever-increasing question bank, traditional methods cannot quickly update the newly added questions to the similarity comparison rules and parameters. Therefore, the above limitations make the existing test question similarity comparison method unable to accurately and efficiently judge the similarity. Summary of the invention
[0003] The present application mainly provides a method for solving the problem of poor accuracy in comparison of test question similarity.
[0004] To solve the above technical problems, a technical solution adopted in the present application is: to provide a method for calculating the similarity of test questions based on a deep learning model, including: selecting different types of test questions from a test question database, and preprocessing the selected test questions to construct a training database; pre-training the deep learning model through general text to optimize the language analysis ability of the deep learning model; re-training the pre-trained deep learning model through the training database to optimize the labeling ability of the deep learning model; using the test questions in the test question database as the input of the deep learning model after the second training to obtain the vector code corresponding to each test question in the test question database, and the vector code contains the labeling information of each test question; and calculating the similarity between the test questions in the test question database based on the vector code.
[0005] By pre-training and fine-tuning the deep learning model, we first pre-trained it on large-scale general text data to allow the deep learning model to learn general language knowledge and semantic understanding capabilities; then, we fine-tune the deep learning model again based on the training database to make the model better suited to the task of comparing the similarity of test questions. The vector encoding corresponding to each test question is obtained through the trained model to compare the similarity between the test questions.
[0006] In some embodiments, the formula for calculating the similarity between the test questions in the test question database is:
[0007] Among them, A is the vector encoding of the first test question involved in the similarity calculation, B is the vector encoding of the second test question involved in the similarity calculation, and cosine_similarity is the similarity between the first test question and the second test question.
[0008] In some embodiments, the training database includes a training test question set, a training label set and a model test set; the selecting different types of test questions from the test question database and preprocessing the selected test questions to construct the training database includes: selecting different types of test questions from the test question database according to a preset selection ratio, and splitting the selected test questions into a training test question set, a training label set and a model test set at a preset split ratio, wherein each test question in the training database contains a corresponding pre-labeled label.
[0009] The training database is divided into a training question set, a training label set, and a model test set, which are used for model training, parameter adjustment, and model performance verification, respectively.
[0010] In some embodiments, the pre-trained deep learning model is retrained through the training database to optimize the label annotation capability of the deep learning model, including: taking the training test question set and the test questions in the training label set as inputs of the pre-trained deep learning model to obtain classification labels output by the pre-trained deep learning model; calculating the loss function between the classification labels and the corresponding pre-annotated labels in the training label set, and optimizing the parameters of the pre-trained deep learning model with preset training parameters based on the loss function; in response to the labeling accuracy of the pre-trained deep learning model on the model test set being less than a preset accuracy threshold, stopping the training of the pre-trained deep learning model.
[0011] The loss function is used to quantify the difference between the classification label and the corresponding label in the training label set, and the difference is used to know the training direction of the deep learning model. According to the preset training parameters such as learning rate, training rounds, etc., the deep learning model is trained until the loss function converges, that is, the labeling accuracy of the trained deep learning model on the model test set is less than the preset accuracy threshold.
[0012] In some embodiments, the preprocessing of the selected test questions includes: performing data cleaning on the selected test questions to remove noise, erroneous information and irrelevant information in the test questions; and converting the format of the test questions after data cleaning into a preset standard format.
[0013] Preprocess the data to ensure data quality and convert the test questions into a format that can be processed by large models in order to extract effective features.
[0014] In some embodiments, the step of selecting different types of test questions from the test question database and preprocessing the selected test questions to construct a training database also includes: constructing the test question database based on the acquired real test question data, wherein the test question database is updated based on the newly acquired real test question data.
[0015] In some embodiments, after calculating the similarity between the test questions in the test question database based on the vector encoding, it also includes: judging whether the similarity is greater than a preset similarity threshold; if the similarity is greater than the preset similarity threshold, the two test questions involved in the similarity calculation are similar; if the similarity is not greater than the preset similarity threshold, the two test questions involved in the similarity calculation are not similar.
[0016] By comparing the calculated similarity with the preset similarity threshold, it can be determined whether the similarity between the current two test questions meets the requirements.
[0017] In some embodiments, after calculating the similarity between each test question in the test question database based on the vector encoding, it also includes: selecting test questions in the test question database whose similarity and label annotation information meet the preset test paper requirements to compose a test paper.
[0018] By selecting the test questions whose label information and similarity meet the test paper composition requirements, a test paper with low similarity between questions can be formed to avoid repeated examination of the same knowledge point.
[0019] In order to solve the above technical problems, another technical solution adopted by the present application is: providing a storage medium on which program data is stored, and when the program data is executed by a processor, the steps of the test question similarity calculation method as described above are implemented.
[0020] The beneficial effects of the storage medium refer to the beneficial effects of the above-mentioned test question similarity calculation method, which will not be repeated here.
[0021] The present application also provides a computer device, including a processor and a memory connected to each other, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the test question similarity calculation method as described above are implemented.
[0022] The beneficial effects of the computer device refer to the beneficial effects of the above-mentioned test question similarity calculation method, which will not be repeated here.
[0023] The beneficial effects of the present application are as follows: Different from the prior art, the present application discloses a method, medium and device for calculating the similarity of test questions. Different types of test questions are selected from the test question database, and the selected test questions are preprocessed to construct a training database; the deep learning model is pretrained through general text to optimize the language analysis ability of the deep learning model; the pre-trained deep learning model is retrained through the training database to optimize the labeling ability of the pre-trained deep learning model; the test questions in the test question database are used as the input of the deep learning model after the second training, and the vector encoding corresponding to each test question in the test question database is obtained, and the vector encoding contains the labeling information of each test question; the similarity between each test question in the test question database is calculated based on the vector encoding. By combining pre-training with secondary training, the deep learning model can effectively improve its understanding of the semantic relationship and characteristics of the test questions, so as to better extract the features in the test questions, complete the labeling, and understand the knowledge points tested by the test questions. The vector encoding output after labeling is used for similarity calculation, and the similarity between various test questions is accurately analyzed to avoid repeated examination of similar knowledge points. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work, among which: Figure 1 It is a flowchart of an embodiment of a method for calculating test question similarity based on a deep learning model provided by the present application; Figure 2 Yes Figure 1 The flowchart of the embodiment of step 10 of the method shown is as follows; Figure 3 Yes Figure 1 The flowchart of the embodiment of step 30 of the method is shown; Figure 4 It is a flowchart of another embodiment of the method for calculating the similarity of test questions based on the deep learning model provided in the embodiment of the present application; Figure 5 It is a structural schematic diagram of an embodiment of a storage medium provided by the present application; Figure 6 It is a structural diagram of an embodiment of a computer device provided by the present application. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0026] The terms "first", "second", "third" in the embodiments of the present application are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first", "second", "third" can expressly or implicitly include at least one of the features. In the description of the present application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.
[0027] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0028] Embodiment 1 See also Figure 1 , Figure 1 1 is a flow chart of an embodiment of a method for calculating the similarity of test questions based on a deep learning model provided by the present application. The method for calculating the similarity of test questions includes: Step 10: Select different types of test questions from the test question database and pre-process the selected test questions to build a training database.
[0029] The test question database is constructed based on the acquired real test question data, wherein the test question database is updated based on the newly acquired real test question data.
[0030] A certain number of different types of test questions of different subjects, different difficulty levels, different knowledge points, etc. are extracted from the test question database according to certain extraction rules, and the selected test questions are pre-processed such as cleaning, and the pre-processed test questions are constructed into a training database.
[0031] Specifically, the types of test questions include but are not limited to: subjects such as Chinese, mathematics, history, etc., question types such as multiple-choice questions, fill-in-the-blank questions, short-answer questions, etc., difficulty levels such as easy, medium, difficult, etc., grades such as grade one, grade two, grade seven, etc., units such as unit one, unit two, unit three, etc., knowledge points such as "Climbing the High Mountain", "Diary of a Madman", "Short Song", etc.
[0032] Specifically, see Figure 2 In step 10, the selected test questions are preprocessed, including: Step 11: Perform data cleaning on the selected test questions to remove noise, erroneous information and irrelevant information in the test questions.
[0033] Perform data cleaning on the selected test questions to remove duplicate or invalid data in the test questions, such as deleting duplicate, incomplete or invalid test questions, ensuring the consistency of the test question format, such as unifying the format of multiple-choice questions into A, B, C, D, removing or replacing special characters in the test questions, and ensuring the cleanliness of text data.
[0034] Data cleaning can more effectively remove noise and erroneous information in test questions and improve the quality of test data.
[0035] Step 12: Convert the format of the test questions after data cleaning into a preset standard format.
[0036] Convert the test text after data cleaning into the same data encoding format, remove the formatting codes or labels contained in the cotton and linen, and ensure that the separators or special characters between the test texts use the same separator, such as space, and uniformly convert the data encoding into a preset standard format, such as plain text format.
[0037] Convert the test data into a format that is easy for the deep learning model to process and learn, so as to accurately extract effective features from the test data.
[0038] Among them, the training database specifically includes a training question set, a training label set and a model test set.
[0039] Different types of test questions are selected from the test question database, and the selected test questions are preprocessed to construct a training database, including: Different types of test questions in the test question database are selected according to a preset selection ratio, and the selected test questions are divided into a training test question set, a training label set and a model test set according to a preset segmentation ratio, wherein each test question in the training database contains a corresponding pre-labeled label.
[0040] Test questions are extracted from the test question database at a preset selection ratio to construct a training database. The training database is randomly divided into training test question sets, training label sets and model test sets at a preset segmentation ratio. Professional teachers or experts label the test question data in the training label set and the model test set so that the test questions in the training label set and the model test set have pre-labeled labels such as subject, question type, difficulty, grade, unit and knowledge point.
[0041] Among them, the training test question set is used for the pre-trained deep learning model to initially learn the structure and semantics of the test questions, so that the deep learning model can learn and understand the text information in the form of test questions through a large amount of data and perform labeling.
[0042] The training label set is used to slightly adjust the parameters of the deep learning model so that the deep learning model can more accurately label the test questions.
[0043] The model test set is used to test the performance of the deep learning model after secondary training and to verify whether the model meets the training requirements.
[0044] For example, there are 700 questions in the question database, and the preset selection ratio is set to 30%. Then 210 questions are selected from the question database according to extraction rules such as average distribution and completely random. Set the preset split ratio to 7:2:1, then there are 147 questions in the training question set, 42 questions in the training label set, and 21 questions in the model test set. And the questions in the training question set, training label set, and model test set are randomly selected.
[0045] For example, the test question: "Read the following classical Chinese text and complete the questions: The conduct of a gentleman is to cultivate one's character in quietness and to nurture one's virtue in frugality… It is too late to stay in this poor house with sorrow! (Zhuge Liang's "Admonitions to My Son") 1. Explain the underlined words in the following sentences.
[0046] (1) Without tranquility, one cannot achieve far-reaching goals. The labels for this question are “Chinese”, “junior high school”, “unified edition”, “grade seven”, “Unit 4”, “Family Admonitions”, “Zhuge Liang”, “Classical Chinese”, “Reading”, and “Word Definition”.
[0047] Preprocess the data to ensure data quality and convert the test questions into a format that can be processed by large models in order to extract effective features.
[0048] Step 20: Pre-train the deep learning model with general text to optimize the language analysis capability of the deep learning model.
[0049] Collect a large amount of text data from various sources such as web pages, books, news articles, social media, etc. This data should be as diverse as possible to cover a wide range of vocabulary, grammatical structures, and topics. Choose an appropriate deep learning model architecture based on the training requirements and data size. Process the general text data according to the needs of the pre-training task to generate training samples. For example, for the MLM task, some words can be randomly masked in the text and the model is required to predict these masked words. Set model training parameters including learning rate, batch size, number of training rounds, etc. These parameters need to be adjusted based on the model architecture, data size, and computing resources. Train the deep learning model using general text as input and monitor the changes in the loss function and the performance of the model on the validation set during the training process to adjust the training strategy.
[0050] Pre-training deep learning models with common texts optimizes their language analysis capabilities. This approach not only improves the generalization capabilities of deep learning models, but also provides a strong foundation for subsequent downstream tasks.
[0051] Step 30: Perform secondary training on the pre-trained deep learning model through the training database to optimize the labeling capability of the pre-trained deep learning model.
[0052] The test data in the training database and a small amount of general text data in pre-training are input into the pre-trained deep learning model, and the deep learning model is trained again, the parameters of the model are slightly adjusted, and the labeling ability of the pre-trained deep learning model is optimized.
[0053] Further, see Figure 3 , step 30 further comprises: Step 31: Use the test questions in the training test question set and the training label set as the input of the pre-trained deep learning model to obtain the classification label output by the pre-trained deep learning model.
[0054] The test text data in the training test set and the training label set is used as the input of the pre-trained deep learning model, and the labels corresponding to the test questions are used as the output targets of the pre-trained deep learning model for training. This enables the model to learn the mapping relationship between the question text and the annotation information, so as to better understand the semantics and features of the questions.
[0055] Step 32: Calculate the loss function between the classification label and the corresponding pre-labeled label in the training label set, and optimize the parameters of the pre-trained deep learning model with preset training parameters based on the loss function.
[0056] Load a pre-trained deep learning model. This model can be a pre-trained convolutional neural network (CNN), recurrent neural network (RNN), or any other type of neural network. When compiling the model, you need to specify the loss function, optimizer, and evaluation metric. During training, the model automatically calculates the loss function between the classification label and the corresponding pre-labeled label in the training label set. Train the model using the training data. During training, the optimizer (such as Adam) automatically updates the model's parameters based on the gradient of the loss function. Experimentally adjust training parameters such as learning rate, batch size, or number of iterations to obtain better model performance.
[0057] The learning rate determines the step size of the model parameter update. A learning rate that is too large may cause the model to fail to converge, while a learning rate that is too small will make the training process too slow. The batch size refers to the number of samples input into the model during each training, and needs to be reasonably selected based on computing resources and data size. The number of training rounds refers to the number of times the model traverses the entire training set, which is usually determined based on the model's convergence and performance evaluation results.
[0058] Step 33: In response to the labeling accuracy of the pre-trained deep learning model on the model test set being less than a preset accuracy threshold, stop the secondary training of the pre-trained deep learning model.
[0059] The test data in the model test set is used as the input of the deep learning model after secondary training, and the performance of the deep learning model after secondary training is verified according to a certain period. According to the evaluation results, the parameters of the model are adjusted, such as the learning rate decay strategy, regularization parameters, etc., to improve the performance and generalization ability of the model.
[0060] When the classification labels output by the deep learning model after secondary training are less accurate than the preset accuracy threshold compared with the pre-labeled labels of each test question in the model test set, the secondary training of the deep learning model is completed, the model meets the training requirements, and the secondary training of the pre-trained deep learning model is stopped, and the model parameters at this time are saved as the final training model.
[0061] The loss function is used to quantify the difference between the classification label and the corresponding label in the training label set, and the difference is used to know the training direction of the deep learning model. According to the preset training parameters such as learning rate, training rounds, etc., the deep learning model is trained until the loss function converges, that is, the labeling accuracy of the trained deep learning model on the model test set is less than the preset accuracy threshold.
[0062] Step 40: Use the test questions in the test question database as the input of the deep learning model after secondary training to obtain the vector code corresponding to each test question in the test question database, where the vector code includes the label annotation information of each test question.
[0063] For two questions whose similarity is to be compared, they are respectively input into the deep learning model after secondary training, and the vector output by the last layer of the model is obtained as the encoding vector of the question.
[0064] The encoded vector contains the feature representation in the semantic space learned by the deep learning model corresponding to the test question, such as label annotation information, which can be used more conveniently for similarity calculation.
[0065] Step 50: Calculate the similarity between each test question in the test question database based on the vector encoding.
[0066] By comparing the information encoded in the vectors of two test questions, the similarity between the two test questions can be calculated.
[0067] The similarity can be expressed by cosine similarity or Euclidean distance.
[0068] Specifically, the formula for calculating the similarity between each test question in the test question database is:
[0069] Among them, A is the vector encoding of the first test question involved in the similarity calculation, B is the vector encoding of the second test question involved in the similarity calculation, and cosine_similarity is the similarity between the first test question and the second test question.
[0070] For the first and second test questions that need similarity calculation, the vector code A of the first test question and the vector code B of the second test question are obtained through the deep learning model after secondary training. The dot product of A and B: A·B and the modular product: |A|×|B| are calculated respectively, and the ratio of the dot product to the modular product is used as the cosine similarity between the first and second test questions, expressed as cosine_similarity, and the calculated results are presented to the user in a visual way.
[0071] Among them, the value range of cosine_similarity is between [-1, 1]. The closer the value is to 1, the more similar the two test questions are; the closer the value is to -1, the less similar the two test questions are; and a value of 0 means that the two test questions are orthogonal, that is, unrelated.
[0072] By pre-training and fine-tuning the deep learning model, we first pre-trained it on large-scale general text data to allow the deep learning model to learn general language knowledge and semantic understanding capabilities; then, we fine-tune the deep learning model again based on the training database to make the model better suited to the task of comparing the similarity of test questions. The vector encoding corresponding to each test question is obtained through the trained model to compare the similarity between the test questions.
[0073] Embodiment 2 See also Figure 4 , Figure 4 1 is a flow chart of another embodiment of a method for calculating test question similarity based on a deep learning model provided in an embodiment of the present application, and the embodiment includes: Step 60: Determine whether the similarity is greater than a preset similarity threshold.
[0074] Before step 60, the following steps are also included: Figure 1 Steps 10 to 50 are shown.
[0075] In the case where it is necessary to determine whether the similarity between test questions meets the requirements, a similarity threshold is set, and the similarity threshold is compared with the similarity calculated in step 50 to determine whether the similarity is greater than the preset similarity threshold. The relationship between the similarity and the similarity threshold is used as the basis for determining whether the test questions are similar.
[0076] Specifically, the similarity threshold may be 0.5, 0.7, 0.8, 0.85, 0.89, 0.9, 0.93 or 0.95, etc.
[0077] Step 70: If the similarity is greater than a preset similarity threshold, the two test questions involved in the similarity calculation are similar.
[0078] When the similarity is greater than the preset similarity threshold, it means that in this similarity comparison requirement, the similarity between the two test questions meets the "similar" condition, and the two test questions can be determined to be similar.
[0079] Step 80: If the similarity is not greater than the preset similarity threshold, the two test questions involved in the similarity calculation are not similar.
[0080] When the similarity is not greater than the preset similarity threshold, it means that in this similarity comparison requirement, the similarity between the two test questions meets the "dissimilar" condition, and it can be determined that the two test questions are dissimilar.
[0081] Embodiment 3 like Figure 1 After steps 10 to 50 shown, the method for calculating the similarity of test questions based on the deep learning model further includes: The test questions whose similarity and labeling information meet the preset test paper requirements are selected from the test question database to compose the test paper.
[0082] According to the preset test paper requirements, test questions with label information that meet the test paper requirements are selected from the test question database. Similarity calculations are performed between the selected test questions to ensure that each test question has a similarity value with other test questions. According to the similarity requirements in the test paper requirements, one of the two test questions whose similarity does not meet the requirements is selected for test paper composition.
[0083] By selecting the test questions whose label information and similarity meet the test paper composition requirements, a test paper with low similarity between questions can be formed to avoid repeated examination of the same knowledge point.
[0084] See also Figure 5 , Figure 5 It is a structural diagram of an embodiment of the storage medium provided by the present application.
[0085] The storage medium 300 stores program data 301. When the program data 301 is executed by the processor, the following is achieved: Figure 1 The steps of the described test question similarity method.
[0086] The program data 301 is stored in a storage medium 300, and includes a number of instructions for enabling a network device (such as a router, a personal computer, a server, or other network device) or a processor to execute all or part of the steps of the method described in each embodiment of the present application.
[0087] Optionally, the storage medium 300 may be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, an optical disk, or other medium that can store program data.
[0088] See also Figure 6 , Figure 6 It is a structural schematic diagram of an embodiment of a computer device provided by the present application.
[0089] The computer device 400 includes a processor 420 and a memory 410 which are connected to each other. The memory 410 stores a computer program. When the processor 420 executes the computer program, the steps of the above-mentioned test question similarity calculation method are implemented.
[0090] Different from the prior art, the present application provides a method, medium and device for calculating the similarity of test questions. By collecting a large number of test questions and preprocessing the test question data, the data quality is improved while making the data easier for the deep learning model to understand and learn. The deep learning model is pre-trained using general text so that the model can initially learn the semantic structure and language logic in the text, which is more conducive to the deep learning model's reading of the text information in the test questions and improves the language analysis ability of the deep learning model. A large number of test questions extracted from the test question database are input into the pre-trained deep learning model for secondary training, so that the deep learning model can further deepen the understanding and learning ability of the test question text according to the form and characteristics of the test questions, thereby extracting the feature information in the test questions and labeling them. A small number of test questions extracted from the test question database are used to verify the performance of the deep learning model after secondary training to ensure that the deep learning model can accurately extract the test question features and mark the label information after secondary training. The similarity between the test questions is calculated according to the test question vector encoding output by the bottom layer of the deep learning model to accurately and efficiently obtain the similarity between the test questions for test paper composition or similarity screening.
[0091] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the storage medium embodiment and the computer device embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0092] The present application can be used in many general or special computing system environments or configurations, such as personal computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, network PCs, minicomputers, and distributed computing environments including any of the above systems or devices.
[0093] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not performed.
[0094] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0095] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0096] The above descriptions are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for calculating test question similarity based on a deep learning model, characterized in that: include: Selecting different types of test questions from the test question database, and preprocessing the selected test questions to construct a training database; Pre-training a deep learning model with common text to optimize the language analysis capability of the deep learning model; Performing secondary training on the pre-trained deep learning model through the training database to optimize the labeling capability of the pre-trained deep learning model; Taking the test questions in the test question database as the input of the deep learning model after the secondary training, obtaining the vector code corresponding to each test question in the test question database, wherein the vector code includes the label annotation information of each test question; The similarity between each test question in the test question database is calculated based on the vector encoding.
2. The method for calculating test question similarity according to claim 1, characterized in that: The formula for calculating the similarity between the test questions in the test question database is: Among them, A is the vector encoding of the first test question involved in the similarity calculation, B is the vector encoding of the second test question involved in the similarity calculation, and cosine_similarity is the similarity between the first test question and the second test question.
3. The method for calculating test question similarity according to claim 1, characterized in that: The training database includes a training test set, a training label set and a model test set; The step of selecting different types of test questions from the test question database and preprocessing the selected test questions to construct a training database includes: Different types of test questions in the test question database are selected according to a preset selection ratio, and the selected test questions are divided into a training test question set, a training label set and a model test set according to a preset segmentation ratio, wherein each test question in the training database contains a corresponding pre-labeled label.
4. The method for calculating test question similarity according to claim 3, characterized in that: The second training of the pre-trained deep learning model by using the training database to optimize the labeling capability of the deep learning model includes: Using the training test question set and the test questions in the training label set as inputs to the pre-trained deep learning model, and obtaining classification labels output by the pre-trained deep learning model; Calculating a loss function between the classification label and the corresponding pre-labeled label in the training label set, and optimizing the parameters of the pre-trained deep learning model with preset training parameters based on the loss function; In response to the labeling accuracy of the pre-trained deep learning model on the model test set being less than a preset accuracy threshold, the secondary training of the pre-trained deep learning model is stopped.
5. The method for calculating test question similarity according to claim 1, characterized in that: The preprocessing of the selected test questions includes: Performing data cleaning on the selected test questions to remove noise, erroneous information and irrelevant information in the test questions; Convert the format of the test questions after data cleaning into the preset standard format.
6. The method for calculating test question similarity according to claim 1, characterized in that: Before selecting different types of test questions from the test question database and preprocessing the selected test questions to construct a training database, the method further includes: The test question database is constructed based on the acquired real test question data, wherein the test question database is updated based on the newly acquired real test question data.
7. The method for calculating test question similarity according to claim 1, characterized in that: After calculating the similarity between the test questions in the test question database based on the vector coding, the method further includes: Determining whether the similarity is greater than a preset similarity threshold; If the similarity is greater than a preset similarity threshold, the two test questions involved in the similarity calculation are similar; If the similarity is not greater than a preset similarity threshold, the two test questions involved in the similarity calculation are not similar.
8. The method for calculating test question similarity according to claim 1, characterized in that: After calculating the similarity between the test questions in the test question database based on the vector coding, the method further includes: The test questions whose similarity and label information meet the preset test paper composition requirements are selected from the test question database to compose the test paper.
9. A storage medium having program data stored thereon, characterized in that: When the program data is executed by a processor, the steps of the method for calculating the similarity of test questions as described in any one of claims 1 to 8 are implemented.
10. A computer device, characterized in that: It comprises a processor and a memory connected to each other, the memory stores a computer program, and when the processor executes the computer program, the steps of the method for calculating the similarity of test questions as described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Document similarity measurement method based on part-of-speech tagging
CN109062899A
Text feature extraction model training method, text data processing method and related equipment
CN118132979A
Exercise solving method and electronic equipment
CN118569238A
Examination test question generation method based on large model
CN118839003A
