Extraction method of test paper information, computer program product, equipment and storage medium
By obtaining the segmentation identifier of the test paper and generating a tree structure, the problem of insufficient rule adaptability and model capability in the extraction of test paper information in the existing technology is solved, and higher accuracy and cross-platform compatibility are achieved.
Patent Information
- Application Number
- CN202510994150.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-11-11
AI Technical Summary
Existing technologies for extracting test paper information in the education field suffer from insufficient rule adaptability and limited capabilities of small-scale machine learning models. They are unable to cope with diverse changes in test paper formats and situations outside the distribution of training data, resulting in limited extraction efficiency and accuracy.
By obtaining the segmentation identifier of the target test paper, the paper is segmented based on the recognition model, and the extraction model is used to generate a tree structure, including node information of multiple nodes. The smallest unit of node information is a complete test question. By combining data distillation and model training optimization, the accuracy of information extraction and cross-platform compatibility are improved.
It effectively reduces the difficulty of extracting information from test papers, improves the accuracy and granularity of extraction, enhances cross-platform compatibility, and ensures the efficiency of information extraction.
Smart Images

Figure CN120930628A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information extraction technology, and in particular to methods, computer program products, devices and storage media for extracting information from test papers. Background Technology
[0002] In the process of extracting information from exam papers in the education field, rule-based methods and hybrid methods combining them with some machine learning features are widely used. However, these methods have several significant drawbacks. First, their rule adaptability is insufficient, making it difficult to effectively cope with the diverse formats of exam papers in the education field. Second, the capabilities of simple, small-scale machine learning models are limited, only able to handle situations present in the training data and unable to address situations outside the training data distribution. These inherent limitations severely weaken the efficiency and accuracy of rule-based methods in extracting exam paper information, substantially restricting their application value. Summary of the Invention
[0003] In view of the above, the purpose of this application is to provide a method, computer program product, device and storage medium for extracting test paper information.
[0004] On the one hand, embodiments of this application provide a method for extracting exam paper information, including:
[0005] Obtain the target test paper;
[0006] Determine the segmentation identifier for the target test paper;
[0007] The target test paper is segmented based on the segmentation identifier to obtain the text content corresponding to each segmentation identifier;
[0008] For each segmentation identifier, information is extracted from the text content corresponding to that segmentation identifier to generate a tree structure corresponding to that segmentation identifier; wherein, the tree structure includes multiple nodes and node information corresponding to each node, and the smallest unit corresponding to the node information is a complete test question.
[0009] In one possible implementation, determining the segmentation identifier of the target test paper includes:
[0010] The target test paper is input into the pre-trained recognition model;
[0011] The target test paper is identified and analyzed using the recognition model to obtain a segmentation identifier for the target test paper; wherein the segmentation identifier can divide the target test paper into N parts, and the value of N is greater than 2.
[0012] In one possible implementation, before inputting the target test paper into the pre-trained recognition model, the following steps are included:
[0013] Determine whether the target test paper is in text format;
[0014] If not, convert the target test paper file format to text format.
[0015] In one possible implementation, segmenting the target test paper based on the segmentation identifier to obtain the text content corresponding to each segmentation identifier includes:
[0016] Determine the position and order of the segmentation markers in the target test paper; wherein, the order is the order in which the segmentation markers appear in the target test paper;
[0017] The text content between two adjacent segmentation identifiers is determined as the text content corresponding to the target segmentation identifier; wherein, the target segmentation identifier is the segmentation identifier that comes first in the order of the two adjacent segmentation identifiers;
[0018] For the last segmentation identifier in the sequence, the text content following the last segmentation identifier is determined to be the text content corresponding to the last segmentation identifier.
[0019] In one possible implementation, the step of extracting information from the text content corresponding to each segmentation identifier and generating a tree structure corresponding to that segmentation identifier includes:
[0020] For each segmentation identifier, the segmentation identifier and its corresponding text content are input into the pre-trained extraction model;
[0021] The extraction model is used to identify the segmentation identifier and its corresponding text content to obtain the tree structure corresponding to the segmentation identifier.
[0022] In one possible implementation, the extraction method further includes a training step for the extraction model:
[0023] The initial dataset is obtained through data distillation;
[0024] Based on the data format and data content, the data in the initial dataset is filtered to obtain the training dataset;
[0025] Using the training dataset, the extraction model to be trained is trained to obtain a trained extraction model.
[0026] In one possible implementation, training the extraction model to be trained using the training dataset to obtain a trained extraction model includes:
[0027] Using the training dataset, the extraction model to be trained is fine-tuned with full parameter instructions to obtain an intermediate model;
[0028] The intermediate model is trained using a group-based relative strategy optimization to obtain a well-trained extraction model.
[0029] On the other hand, embodiments of this application propose a computer program product that stores a computer program, which, when executed by a processor, implements the steps of the above-described method.
[0030] On the other hand, embodiments of this application propose a computer device, including at least a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program in the memory.
[0031] On the other hand, embodiments of this application propose a storage medium carrying one or more computer programs that, when executed by a processor, implement the steps of the above-described method.
[0032] This application first determines the segmentation identifier of the target test paper, and then segments the target test paper based on the segmentation identifier to extract information from the text content corresponding to each segmentation identifier, thereby generating a corresponding data structure. Compared with directly extracting information from the target test paper, this application effectively reduces the extraction difficulty and improves the extraction accuracy, thus ensuring the efficiency of test paper information extraction. Furthermore, the tree structure includes multiple nodes and node information corresponding to each node, with the smallest unit corresponding to a node being a complete test question, effectively improving the granularity and precision of the analysis of the target test paper content and cross-platform compatibility.
[0033] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 A flowchart of a method for extracting exam paper information provided in this application is shown;
[0036] Figure 2 The flowchart illustrating the method for extracting test paper information provided in this application for determining the segmentation identifier of the target test paper is shown.
[0037] Figure 3The flowchart illustrates a method for extracting test paper information provided in this application, in which a target test paper is segmented based on segmentation identifiers to obtain the text content corresponding to each segmentation identifier.
[0038] Figure 4 A flowchart illustrating the training steps of the model extraction method provided in this application for extracting test paper information is shown.
[0039] Figure 5 This application provides a schematic diagram of the structure of a test paper information extraction device.
[0040] Figure 6 A schematic diagram of the structure of a computer device provided in this application is shown. Detailed Implementation
[0041] Various embodiments and features of this application are described herein with reference to the accompanying drawings.
[0042] It should be understood that various modifications can be made to the embodiments described herein. Therefore, the above description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this application will be apparent to those skilled in the art.
[0043] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0044] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.
[0045] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application, which have the features described in the claims and are therefore all within the scope of protection defined herein.
[0046] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.
[0047] Specific embodiments of this application are described thereafter with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in a variety of substantially any suitable detailed structures.
[0048] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.
[0049] Firstly, to facilitate understanding of this application, a method for extracting test paper information provided in this application will be described in detail.
[0050] Figure 1 The flowchart illustrates the method for extracting test paper information provided in this application embodiment. Figure 1 The method and steps shown can effectively reduce the difficulty of extraction and improve the accuracy of extraction. The specific steps include S101-S104.
[0051] S101, Obtain the target test paper.
[0052] In this embodiment of the application, the target test paper can be obtained through data transmission, such as when another communication terminal transmits the target test paper to the current communication terminal. At this time, the target test paper is an electronic test paper, and its format can be PDF, PPT, Word, etc.; the target test paper can also be obtained through image acquisition devices, such as scanning or photographing paper test papers using scanners, cameras, etc., and the resulting image is the target test paper.
[0053] S102, Determine the segmentation markers for the target test paper.
[0054] After obtaining the target exam paper, it is identified to obtain segmentation markers. These segmentation markers are text within the target exam paper, such as headings like "History Section" and "Moral Education and Law Section," or headings like "Volume I" and "Volume II."
[0055] As one example, Figure 2 A flowchart of a method for determining the segmentation identifier of a target test paper is shown, wherein specific steps include S201 and S202.
[0056] S201, input the target test paper into the pre-trained recognition model.
[0057] S202, the target test paper is identified and analyzed by the recognition model to obtain the segmentation identifier of the target test paper; wherein, the segmentation identifier can divide the target test paper into N parts, and the value of N is greater than 2.
[0058] Alternatively, the recognition model can be invoked through an Application Programming Interface (API). In other words, there is a pre-set association between the API and the recognition model, enabling the API to invoke the recognition model.
[0059] Furthermore, the target test paper is input into a pre-trained recognition model to perform recognition and analysis, such as recognizing text, to obtain segmentation identifiers for the target test paper. These segmentation identifiers can divide the target test paper into N parts, where N is greater than 2. If the target test paper has multiple layers, the segmentation identifiers are identified level by level from top to bottom until the identified segmentation identifiers can divide the target test paper into N parts.
[0060] For example, if there is only one segmentation marker at the first level of the target test paper, since this single segmentation marker can only divide the target test paper into two parts—the text portion before the segmentation marker and the text portion after the segmentation marker—the condition that N is greater than 2 is not met. Therefore, the second-level segmentation marker is identified. If there are two segmentation markers at the second level, since these two markers can divide the target test paper into three parts—the text portion before the segmentation marker, the text portion between the two segmentation markers, and the text portion after the last segmentation marker—the condition that N is greater than 2 is met. Therefore, the two second-level segmentation markers are determined as the segmentation markers used to divide the target test paper.
[0061] Considering that the target test paper can be in the format of PDF, PPT, Word, or images (such as JPEG, PNG, GIF, etc.), in this embodiment of the application, before inputting the target test paper into the pre-trained recognition model, it can be determined whether the file format of the target test paper is text format; if not, such as the target test paper being in the format of PDF, PPT, or an image, then Optical Character Recognition (OCR) can be used to recognize the text in the target test paper, so as to convert the file format of the target test paper into text format, and then input the text format target test paper into the recognition model.
[0062] As another example, considering that the target test paper may contain formulas, the formulas in the target test paper are converted into LaTeX format before being input into the recognition model. Furthermore, this conversion process can also correct erroneous formulas. Optionally, through a predefined LaTeX template library and error correction algorithms (such as syntax tree node replacement and missing symbol inference), intermediate formulas are mapped to a standardized LaTeX format. Simultaneously, dynamic correction strategies are implemented for typical errors (such as mismatched parentheses and misaligned superscripts / subscripts). Therefore, not only is the accuracy of the target test paper input into the recognition model guaranteed, but the accuracy of the recognition model's results (i.e., segmentation identifiers) is also improved.
[0063] S103, the target test paper is segmented based on the segmentation identifier to obtain the text content corresponding to each segmentation identifier.
[0064] After determining the segmentation markers of the target test paper, the test paper is segmented based on the segmentation markers to obtain the text content corresponding to each segmentation marker. In other words, the complex and large target test paper is segmented into several relatively simple and smaller text contents, which effectively reduces the difficulty of subsequent information extraction from the target test paper and improves accuracy.
[0065] As one example, Figure 3 The flowchart shows a method for segmenting a target test paper based on segmentation identifiers to obtain the text content corresponding to each segmentation identifier, wherein the specific steps include S301-S303.
[0066] S301, determine the position and order of the segmentation markers in the target test paper; where the order is the order in which the segmentation markers appear in the target test paper.
[0067] S302, determine the text content between two adjacent segmentation identifiers as the text content corresponding to the target segmentation identifier; wherein, the target segmentation identifier is the segmentation identifier that comes first in the order of the two adjacent segmentation identifiers.
[0068] S303, for the last segmentation identifier in the sequence, determine the text content following the last segmentation identifier as the text content corresponding to the last segmentation identifier.
[0069] After identifying the segmentation markers of the target exam paper, the segmentation markers can be located within the target exam paper based on a designed matching rule with a fault-tolerant mechanism to determine their position and order. This order refers to the sequence in which the segmentation markers appear within the target exam paper. The aforementioned matching rule allows for a certain degree of textual variation to address potential issues such as formatting irregularities or differences in wording within the exam paper.
[0070] When determining the text content corresponding to each segmentation identifier, the text content between two adjacent segmentation identifiers is determined as the text content corresponding to the target segmentation identifier; wherein, the target segmentation identifier is the segmentation identifier that comes first in the order of the two adjacent segmentation identifiers. Furthermore, for the last segmentation identifier, the text content following the last segmentation identifier is determined as the text content corresponding to the last segmentation identifier.
[0071] For example, the target exam paper is identified by two segments: "History" and "Moral and Legal Education." Since "History" precedes "Moral and Legal Education," the text content between these segments is considered part of the "History" section, and the text content following "Moral and Legal Education" is also considered part of that section. Of course, the text content preceding "History" is also classified as part of the target exam paper.
[0072] S104. For each segmentation identifier, extract information from the text content corresponding to the segmentation identifier and generate a tree structure corresponding to the segmentation identifier; wherein, the tree structure includes multiple nodes and node information corresponding to each node, and the smallest unit corresponding to the node information is a complete test question.
[0073] After obtaining the text content corresponding to each segmentation identifier in the target test paper, information extraction is performed on the text content corresponding to each segmentation identifier to generate the tree structure corresponding to that segmentation identifier. As an example, for each segmentation identifier, the segmentation identifier and its corresponding text content are input into a pre-trained extraction model. The extraction model identifies the segmentation identifier and its corresponding text content to obtain the tree structure corresponding to that segmentation identifier.
[0074] The tree structure includes multiple nodes and node information corresponding to each node. The smallest unit corresponding to the node information is a complete test question.
[0075] Through the above steps, all text information in the target exam paper can be categorized into nodes within the tree structure corresponding to each segmentation identifier, thus achieving the goal of structuring the entire target exam paper without omissions or duplicate summaries. Furthermore, utilizing the numerical structure of the target exam paper allows users to quickly and accurately find the information they wish to access. Since the smallest unit corresponding to each node is a complete question, the retrieved information is complete and independent, avoiding interference between adjacent questions and effectively improving the granularity and cross-platform compatibility of the target exam paper content analysis.
[0076] In the extraction method of this application embodiment, the segmentation identifier of the target test paper is first determined, and the target test paper is segmented based on the segmentation identifier. Information is extracted from the text content corresponding to each segmentation identifier, thereby generating the corresponding number structure. Furthermore, before determining the segmentation identifier of the target test paper, the formulas included in the target test paper are transformed. Compared with directly extracting information from the target test paper, this application embodiment effectively reduces the extraction difficulty and improves the extraction accuracy, thus ensuring the efficiency of test paper information extraction. In addition, the tree structure includes multiple nodes and node information corresponding to each node. The smallest unit corresponding to the node information is a complete test question, which effectively improves the granularity accuracy and cross-platform compatibility of parsing the target test paper content.
[0077] This application also provides training methods for the recognition model and the extraction model.
[0078] The training method for the recognition model is as follows:
[0079] Optionally, multiple test papers in test paper format are selected as the first dataset. The recognition model to be trained is then trained using the test paper samples from the first dataset to obtain a recognition model capable of accurately identifying segmentation markers in the test paper. The recognition model can include the Qwen-max model; alternatively, it can include the Kimi model or the Chatgpt model, etc. This embodiment does not specifically limit the specific model used; the Qwen-max model will be used as an example for detailed explanation later.
[0080] Optionally, when training the recognition model to be trained, corresponding prompt words can be set and input into the recognition model including the Qwen-max model. The recognition model then identifies the corresponding segmentation marker samples from the test paper sample text according to the prompt words. As an example, the prompt words can be as follows:
[0081] shell
[0082] "#You are a test paper structure analysis expert, and your function is:"
[0083] #Based on the following test paper content, please split the test paper content and extract some hierarchical content, extracting the segmentation identifiers that can divide the test paper into the minimum number of blocks that are greater than one.
[0084] #Hierarchical extraction output requirements:
[0085] The test paper is output according to its hierarchical structure. A test paper consists of multiple levels.
[0086] ##During the extraction of levels, following the principle of top-down, level-by-level identification, we first find the first level of the entire exam paper. The content of the first level is the top-level question structure excluding the exam paper title.
[0087] After finding the content corresponding to the first level, we first need to determine how many items there are in the first level. If it is greater than 1, then output the result directly. The output requirements are as follows:
[0088] ##Preserve the original text order. Categorize content according to its order of appearance and place it into the corresponding level.
[0089] ## Eliminating interference from non-test text. The extracted content does not include: test paper name, instructions, multiple-choice options, page numbers, etc., but only includes: test type, test score, and test content other than multiple-choice options.
[0090] The output format is as follows. The first-level content is organized into the following form, and the corresponding field is the test paper separator, where "****" represents the specific content:
[0091] ``` [
[0093] Exam paper splitting mark
[0094] "**************"
[0095] "****************",
[0096] …………,
[0097] "*****************", ]
[0099] ```
[0100] If there is only one item in the first level, continue extracting content until you find the level with multiple items closest to the first level. Then output the content in the following format:
[0101] ``` [
[0103] The levels preceding the levels corresponding to the test paper splitting marker
[0104] "**************"
[0105] "****************",
[0106] …………,
[0107] "*****************",
[0108] …………
[0109] Exam paper splitting mark
[0110] "**************"
[0111] "****************",
[0112] …………,
[0113] "*****************", ]
[0115] ```
[0116] ## Exception Handling: 1. When ambiguous structures are found, maintain the highest level of attribution. 2. Titles with unclear levels are assigned to the nearest identifiable level. 3. When encountering formatting errors, make logical inferences, including at least correcting punctuation and language logic.
[0117] #Exam Content:
[0118] "'
[0119] The above process involves training the recognition model until its accuracy reaches a preset threshold, at which point a well-trained recognition model is obtained.
[0120] The training method for the extraction model is as follows:
[0121] Figure 4 A flowchart of the training steps for extracting the model is shown, wherein the specific steps include S401-S403.
[0122] S401, the initial dataset is obtained through data distillation.
[0123] S402, based on the data format and data content, filters the data in the initial dataset to obtain the training dataset.
[0124] S403 uses the training dataset to train the extraction model to obtain a trained extraction model.
[0125] Optionally, before training the extraction model, a training dataset for training the extraction model needs to be obtained first. In this embodiment, the Qwen-qwq-32B model can be called via API to perform a data distillation task using the Qwen-qwq-32B model, and the distilled data is determined as the data in the initial dataset. It is worth noting that other models such as the Deepseek-R1 model can also be called to perform the data distillation task. This embodiment does not specifically limit this; this embodiment will use the Qwen-qwq-32B model as an example for detailed explanation.
[0126] Similarly, when training the extraction model, corresponding prompt words can be set and input into the Qwen-qwq-32B model, so that the Qwen-qwq-32B model generates and outputs data for training the extraction model. As an example, the prompt words can be as follows:
[0127] Python
[0128] As an assistant, your role is to thoroughly explore the problem through a systematic, deep thinking process, and then provide a final, precise, and detailed solution. This requires a complete thinking cycle, including analysis, summarization, exploration, reassessment, reflection, backtracking, and iteration, to form a well-thought-out thought process. Please divide your answer into two main parts: thought and answer.
[0129] In the thinking section, record your reasoning process in detail, in the following format:
[0130] <think_start>
[0131] {Detailed thought process, specific problem-solving path, and verification of the correctness of the conclusion}
[0132] <think_end>
[0133] Each step should include detailed considerations, such as analyzing the problem, summarizing relevant findings, proposing new ideas, verifying the accuracy of the current step, correcting errors, and reviewing previous steps.
[0134] In the answer section, based on the various attempts, explorations, and reflections in the thinking section, systematically present what you believe to be the correct final answer, in the following format:
[0135] <answer_start>
[0136] {Final, accurate, and clear answer that meets the format requirements}
[0137] <answer_end>
[0138] #You are a test paper structure analysis expert, and your function is:
[0139] #Based on the following test paper, please break down the test paper content and extract the hierarchical content. Output the extracted hierarchical content according to the hierarchy. For non-English test papers, the hierarchical content must be the non-option parts of the questions; for English test papers, the options may be hierarchical content.
[0140] #Hierarchical extraction output requirements:
[0141] The test paper is output according to its hierarchical structure. A test paper consists of multiple levels.
[0142] The extraction of levels follows the principle of top-down, level-by-level identification.
[0143] The first level of content is the top-level structure other than the exam paper title. It may be the content of the questions or non-question content, such as "I. Fill in the blanks with words, non-multiple choice questions, Paper II, Paper I", etc. However, usually the highest level of exam papers that include Paper II and Paper I is Paper II and Paper I.
[0144] ## Find the subordinate second level based on each first level, find the subordinate third level based on the second level, and so on until the lowest level structure is found. The lowest level structure of all data can be up to the fifth level at most, and may only have the first and second levels at the minimum.
[0145] ##Merge content at the same level. Content at the same level should be entered into the corresponding level field. For example, content belonging to the first level should be entered into the "First Level" field.
[0146] ##Preserve the original text order. Categorize content according to its order of appearance and place it into the corresponding level.
[0147] ## Eliminating interference from non-test text. The extracted content does not include: test paper name, instructions, multiple-choice options, page numbers, etc., but only includes: test type, test score, and test content other than multiple-choice options.
[0148] The output format is as follows. The content of each level is organized into the following form, with each level having corresponding fields. "****" represents the specific content:
[0149] ``` [
[0151] Level 1
[0152] "**************"
[0153] "****************"
[0154] …………
[0155] "*****************"
[0156] Second level
[0157] "**************"
[0158] "****************"
[0159] …………
[0160] "*****************"
[0161] Third level
[0162] "**************"
[0163] "****************"
[0164] …………
[0165] "*****************"
[0166] ...(remaining levels and their contents) ]
[0168] ```
[0169] ## Handling Special Format Questions:
[0170] ###Non-multiple choice questions:
[0171] In non-multiple-choice questions, content that includes question numbers at the beginning, end, or middle of a line is generally considered hierarchical content, or content in the form of "Answer the following questions" or "Answer questions xx-xx (where xx represents the question number)". Content that does not begin with a question number or is not in the form of "Answer the following questions" or "Answer questions xx-xx (where xx represents the question number)" is not considered hierarchical content. For example, in the following example:
[0172]
[96] (II) My Record of Neighborhood Feelings
[0173]
[98] Material 1:
[0174]
[100] The Poor (Excerpt)
[0175]
[102] Sanna wrapped the sleeping children in a headscarf and carried them home. Her heart was pounding, and she didn't know why she was doing it, but she felt she had to. She put the two sleeping children on the bed so they could sleep with her own children, and quickly drew the curtains.
[0176]
[104] Sanna was pale and agitated. She thought anxiously, "What will he say? Is this a joke? His own five children are already enough for him to handle... Is he coming?... No, not yet!... Why did I bring them here?... He'll replace me! Well, I deserve it, I brought it on myself... Hmm, a beating would be good!"
[0177]
[106] Material 2:
[0178]
[108] Bridge (excerpt)
[0179]
[110] Death approached amidst the raucous laughter of the flood. People stumbled and thronged towards the wooden bridge. Before the bridge, in knee-deep water, stood their Party Secretary, the old man revered by the entire village. Rain streamed down the old man's thin face. He remained silent, staring at the chaotic crowd. He was like a mountain. People stopped and looked at the old man.
[0180]
[112] The old man shouted hoarsely, "The bridge is narrow! Line up in one line, don't push!"
[0181]
[114] The old man said coldly, “Come and register here.” No one else shouted. More than a hundred people quickly lined up and ran past the old man onto the wooden bridge.
[0182]
[116] 1. The two reading materials use different writing styles to portray different character traits. Please summarize them and fill in the diagram below. (2 points)
[0183]
[118] _Table_66
[0184]
[120] 2. Paying attention to a character's language, actions, and inner thoughts can help us understand the character more deeply. Based on the reading material, please choose one such description, appreciate the character, and analyze his / her characteristics. (2 points)
[0185]
[122] 3. Who in your life does Sanna or the old man remind you of? What words or actions of his / her left a deep impression on you? Please write down two or three sentences focusing on the character's language, actions, etc. (3 points)
[0186] ###The following are considered hierarchical content:
[0187] ``` [
[0189] Level 1
[0190] (II) My Record of Neighborhood Feelings
[0191] Second level
[0192] 1. The two reading materials use different writing styles to portray different character traits. Please summarize them and fill in the diagram below. (2 points)
[0193] 2. Paying attention to a character's language, actions, and inner thoughts can help us understand their character more deeply. Based on the reading material, please choose one such description, appreciate the character, and analyze their traits. (2 points)
[0194] 3. Who in your life does Sanna or the old man remind you of? What words or actions of theirs left a deep impression on you? Please describe them in two or three sentences, focusing on their language and actions. (3 points) ]
[0196] ```
[0197] ### Multiple Choice Questions:
[0198] In multiple-choice questions, lines that do not begin with a question number and contain phrases like "Answer the following sub-questions" or "Answer questions xx-xx (where xx represents the question number)" are considered hierarchical content. Lines that do not contain question numbers and do not contain phrases like "Answer the following sub-questions" or "Answer questions xx-xx (where xx represents the question number)" are not considered hierarchical content. For example...
[0199]
[50] Section 2 (15 questions in total; 1.5 points each, 22.5 points in total)
[0200]
[52] 6.Who
[0201] takes the dog for a walk every Sunday?
[0202]
[54] A.The
[0203] man.
[0204]
[56] B.The
[0205] man's father.
[0206]
[58] C.The
[0207] man's mother.
[0208]
[60] 7. What
[0209] does the man do on Saturday?
[0210]
[62] A.He
[0211] does the housework.
[0212]
[64] B.He
[0213] Prepares meals.
[0214]
[66] C.He
[0215] They go to the park.
[0216]
[68] Listen to the following long dialogue and answer the following questions.
[0217]
[70] 8. What
[0218] Is it the man?
[0219]
[72] AA
[0220] student.
[0221]
[74] BA
[0222] manager.
[0223]
[76] CA
[0224] professor.
[0225]
[78] 9. What
[0226] does the man think of his life?
[0227]
[80] A. Exciting.
[0228]
[82] B. Interesting.
[0229]
[84] C. Boring.
[0230] ###The following are considered hierarchical content:
[0231] ``` [
[0233] Level 1
[0234] Section 2 (15 questions in total; 1.5 points each, 22.5 points in total)
[0235] Second level
[0236] 6. Who takes the dog for a
[0237] Walk every Sunday?
[0238] 7. What does the man do on
[0239] Saturday?
[0240] Listen to the following relatively long dialogue and answer the questions below.
[0241] Third level
[0242] 8. What is the man?
[0243] 9. What does the man think of?
[0244] His life? ]
[0246] ```
[0247] ## Anomaly Handling: 1. Some levels of content have missing question numbers, which need to be checked. 2. Content at the same level with different formats needs to be checked to ensure the correctness of the result. For example, if the result is: [
[0249] Level 1
[0250] Part II (Non-multiple choice questions, 43 points in total)
[0251] II. (This section contains only one question, totaling 8 points)
[0252] III. (This section contains only one question, totaling 10 points)
[0253] "IV. (This section contains 2 questions, totaling 15 points)"
[0254] V. (This section has only one question, totaling 10 points)
[0255] Second level
[0256] 15. (8 points) The "self-heating hot pot," which brings convenience to people's lives, is mainly composed of food packs, seasoning packs, and heating packs. The figure shows the components of a "self-heating hot pot."
[0257] 16. (10 points) Answer the following questions based on the experiment shown in the diagram:
[0258] 17. (8 points) The figure shows a common laboratory apparatus for producing gases. Answer the following questions.
[0259] 18. (7 points) In his *Dream Pool Essays*, Shen Kuo of the Northern Song Dynasty recorded: "In Qianshan, Xinzhou, there is a bitter spring that flows into a stream. Boiling this water produces copper sulfate, which, when cooked, becomes copper. Boiling copper sulfate in an iron pot for a long time will also turn it into copper." The diagram shows the main production process for producing copper from "bitter spring water." Answer the following questions.
[0260] 19. (10 points) Ethanol is a common fuel, commonly known as alcohol. An interest group designed the following experiment to investigate the elemental composition of ethanol. ]
[0262] Regarding the results in the above example, the first level contains "Part II (Non-multiple choice questions, 43 points in total)" and "II. (This question has only 1 sub-question, 8 points in total)", which are different types of content appearing at the same level. In reality, the true first level only contains "Part II (Non-multiple choice questions, 43 points in total)". "II. (This question has only 1 sub-question, 8 points in total)", "III. (This question has only 1 sub-question, 10 points in total)", "IV. (This question includes 2 sub-questions, 15 points in total)" and "V. (This question has only 1 sub-question, 10 points in total)" should all belong to the next level.
[0263] ##Notes: For longer content extracted from the hierarchy, the complete content must be retained; ellipses or other methods of shortening it are not allowed.
[0264] #Exam Content:
[0265] As can be seen from the above, the Qwen-qwq-32B model, during the data distillation task, simultaneously includes its thought chain content, that is...<think_start> to<think_end> The content between and<answer_start> to<answer_end> The content between.
[0266] The data distillation task described above mainly focuses on the key information necessary to construct the tree structure of the entire test paper, such as clarifying and obtaining the hierarchical relationships between various headings, questions, and headings and questions in the test paper, such as determining which heading a certain question belongs to, and what kind of hierarchical relationship exists between headings at different levels.
[0267] After completing the data distillation process and obtaining the corresponding distilled data, i.e., after obtaining the initial dataset, the data in the initial dataset can be filtered based on the data format and data content to obtain the training dataset.
[0268] As an example, when filtering the data in the initial dataset, a rejection sampling operation is performed on the data in the initial dataset. Here, considering the instability of obtaining the initial dataset by calling the Qwen-qwq-32B model via API, which leads to the inability to stably output thought indicators (such as...)<think_start> and<think_end> ) and / or answer markers (such as<answer_start> and<answer_end> Therefore, the data in the initial dataset can be filtered based on the format. Also, considering that there may be situations in the initial dataset where the data content cannot accurately reflect the true attribution relationship, such as a fill-in-the-blank question belonging to a second-level heading under a first-level heading, the data in the initial dataset can be filtered based on the data content to determine whether the data in the initial dataset can accurately reflect the true attribution relationship.
[0269] Based on the data format and content, a rejection sampling operation is performed on the data in the initial dataset. This effectively filters out data that does not meet the quality standards in the initial dataset, thereby ensuring that the data retained in the end has high quality. This provides a reliable guarantee for the training of the subsequent extraction model, enabling the extraction model to learn and optimize based on high-quality data during the training phase, and ensuring the accuracy of the trained extraction model.
[0270] After obtaining the training dataset, the extraction model to be trained is trained using the training dataset to obtain a trained extraction model. Optionally, the extraction model to be trained is fine-tuned with full parameters using the training dataset to obtain an intermediate model. Then, the intermediate model is trained with group-relative policy optimization to obtain a trained extraction model.
[0271] In this embodiment, the extraction model can include the Qwen2.5-7B-Instruct model; of course, it can also include the GLM4-Chat-9B model, etc. This embodiment does not specifically limit the model. Furthermore, this embodiment uses the Qwen2.5-7B-Instruct model for detailed explanation.
[0272] Optionally, after obtaining the training dataset, the extracted model, such as the Qwen2.5-7B-Instruct model, can be trained using full-parameter instruction fine-tuning with the data in the training dataset. The principle of full-parameter instruction fine-tuning is to comprehensively update all trainable parameters of the model using new data, enabling the model to better adapt to the characteristics and requirements of a specific task set by the user, and ensuring that the updated model meets the user's requirements.
[0273] During the full-parameter instruction fine-tuning training process, the loss function is mainly used to measure the difference between the model's predicted results and the true labels. The gradient is calculated through the backpropagation algorithm, and then the parameters are adjusted using optimization algorithms (such as SGD, Adam, etc.). The general form of the loss function can be expressed as the following formula (1).
[0274]
[0275] Where N represents the number of samples in the training dataset, T i y represents the length of the target sequence for the i-th sample. i,t P(y) represents the correct label of the target sequence of the i-th sample at the t-th position. i,t |y i,1:t―1 ,x i ;θ) represents the model under given parameters θ and input sequence x i and the previous target sequence y i,1:t―1 In the case of predicting y i,t The probability of.
[0276] By minimizing the above loss function, the accuracy of the extraction model can be effectively improved.
[0277] After completing the training with full parameter fine-tuning, an intermediate model is obtained. Further, the intermediate model is trained using Group Relative Policy Optimization (GRPO) to obtain a trained extraction model. GRPO achieves efficient optimization by dividing the policy parameters or state-action space into multiple groups, combining a relative advantage function with trust region constraints. The core role of GRPO training on a Large Language Model (LLM) is to achieve efficient and stable policy optimization by dividing the LLM's policy parameters or functional modules (such as generation, dialogue, and logical reasoning) into multiple groups, dynamically evaluating the improvement potential of each group's policy using a relative advantage function, and introducing trust region constraints. This grouping mechanism reduces the optimization difficulty in high-dimensional policy spaces, balances the learning progress of different sub-tasks (such as simultaneously optimizing language generation and security), and improves the adaptability and robustness of policies in complex interaction scenarios (such as long-term dialogue and code generation). Ultimately, this allows the LLM to reliably meet the multi-objective and dynamic real-world application requirements while maintaining performance. Its core formula is the gradient update of the grouping strategy, specifically refer to the following formula (2).
[0278]
[0279] Where, θ i,k+1 θ represents the updated policy parameters.i,k This represents the policy parameters before the update, α. i This represents the learning rate, which controls the step size for each update. Represents the policy gradient, π θi (a|s) represents the current policy. Let represent the relative advantage function of group i, defined as the traditional advantage function weighted by the ratio of the current policy to the old policy. Please refer to the following formula (3) for details.
[0280]
[0281] Where, π θold,i (a|s) represents the old strategy. This represents the relative advantage function under the old strategy.
[0282] In summary, by performing full-parameter instruction fine-tuning training and GRPO training on the extraction model to be trained, such as LLM, high-precision structured data extraction and dynamic strategy optimization can be achieved. Full-parameter instruction fine-tuning training builds the foundational capabilities for test paper parsing; by labeling the test paper data in the training dataset (e.g., labeling segmentation samples), the full parameters of the extraction model to be trained are fine-tuned to adapt to the complex structure of the test paper, ensuring accurate extraction of tree-like content; GRPO optimizes complex interactions and scoring strategies: based on the full-parameter instruction fine-tuning, GRPO dynamically balances the processing priorities of different structures through grouping strategies, optimizes the model's inference path in complex test paper structures using relative advantage functions, and ensures the stability of the scoring strategy through trust region constraints, avoiding performance fluctuations caused by differences in question complexity (e.g., subjective and objective questions). In other words, by performing full-parameter instruction fine-tuning training and group relative strategy optimization training on the extraction model to be trained, the efficiency and stability of the trained extraction model in processing diverse test papers and adapting to new information are ensured.
[0283] Next, we will demonstrate an example of using the trained extraction model to identify segmentation markers and their corresponding text content, and obtaining the tree structure corresponding to the segmentation marker:
[0284] Python
[0285] <think_start>
[0286] First, I need to analyze the test paper content provided by the user to determine its structure and hierarchical relationship. The test paper begins with "I. Multiple Choice Questions," which is the top-level heading and therefore belongs to the first level.
[0287] Next, observe the subsequent entries. Each question stem (e.g., "The opposite number of 1.2 1 0 2 is") includes a question number and a question description, but the options (e.g., A, B, C, D) are excluded. Since there are no other major categories (e.g., "II. Fill in the blanks"), the first level only contains "Multiple choice questions".
[0288] Check for any further subdivisions. Although some questions are followed by image tags (e.g., #image:...), these are non-textual content and are excluded according to the rules. Furthermore, all questions are independent sub-questions with no sub-questions or nested structures, therefore no further layering is necessary.
[0289] Regarding special handling, all questions have clear question numbers, so there is no need to process interspersed content without question numbers. At the same time, ensure that no question stem content is omitted, even if some questions have abnormal line ending symbols due to formatting reasons (such as the parentheses on line 30), they are still considered valid question stems.
[0290] Finally, confirm the completeness and correct categorization of all levels of content. The first level contains only the main headings for multiple-choice questions, the second level contains the stems of each question, and the remaining levels are empty.
[0291] <think_end>
[0292] <answer_start> [
[0294] Level 1
[0295] I. Multiple Choice Questions (4 points each, 40 points in total)
[0296] Second level
[0297] The opposite of 1.2 1 0 2 is ().
[0298] 2. Given $2x
[0299] If 3y = 3y, then which of the following proportions is true?
[0300] )",
[0301] 3. Which of the following equations must be true?
[0302] 4. Parabola $y =
[0303] The coordinates of the vertex of x^{2}-6x+4 are ().
[0304] 5. Four identical cards are drawn with a circle, an isosceles triangle, a right triangle, and a rhombus, respectively. If one card is randomly drawn, what is the probability that the figure on the card is a centrally symmetric figure?
[0305] 6. As shown in the figure, $AB
[0306] PCD$, $AE$ are equally divided.
[0307] \angle CAB intersects ① at point E, if $
[0308] If \angle C = 9 0^{\circ}$, then $\angle D = $()".
[0309] 7. Given that the radius of the base of a cone is $
[0310] Given that the height of the cone is 4m, the lateral surface area of the cone is ().
[0311] 8. As shown in the figure, place i in a grid with a side length of 1 for each small square. Points A, B, and C are all on grid points. Then $
[0312] The value of \tan A$ is ().
[0313] 9. Given the diameter of e O, $CD
[0314] =1 0cm$, $AB$ is the chord of e O, $AB
[0315] Let CD be perpendicular to CD, with foot M, and $AB$.
[0316] =8c m, then the length of AC is ().
[0317] 10. The figure shown is composed of 7 equilateral triangles. To find the area of the shaded region, we only need to know () ]
[0319] <answer_end>
[0320] <think_start>
[0321] First, I need to analyze the test paper content provided by the user to determine its structure and hierarchical division rules. The test paper content contains numbered entries, such as
[30] to
[38] , where
[30] is the main title "II. Fill in the blanks", and the subsequent questions are specific questions.
[0322] Based on the user's requirements, the first level should be the main category of the test paper, namely "II. Fill-in-the-Blank Questions". Next, each question with a question number (e.g., 11, 12, etc.) belongs to the second level, as they directly belong to the main category. Image tags (e.g., #image:...) are excluded because they are not part of the question content. Descriptions or conditions within the questions are considered part of the question itself and do not require further stratification.
[0323] Check if there are deeper levels: There are no sub-questions or nested structures in the questions, so there are no levels below the third level. Additionally, all questions have clear question numbers, which conforms to the processing method of Case 1, and there is no need to handle content without question numbers separately.
[0324] Finally, ensure that non-question content (such as picture markings) is excluded. In summary, the hierarchical structure only includes the main headings at the first level and each question at the second level.
[0325] <think_end>
[0326] <answer_start>
[0328] First level
[0329] "II. Fill in the blanks (5 points for each sub-question, a total of 30 points)",
[0330] Second level
[0331] "11. Factorize: $
[0332] \dot{恽}^{2}-3=$________.",
[0333] "12. The land area of China is about $9 8
[0334] 0 0 0 0k m^{2}$, and express 9600000 in scientific notation as ________$
[0335] k m^{2}$.",
[0336] "13. For the quadratic equation of one variable $x^
[0337] {2}-2x+m=0$ with two real roots, the range of $\pi$ is ________.",
[0338] "14. As shown in the figure, in the square $A B
[0339] C D$, $A B=6$, and point $Q$ is a moving point on side $A B
[0340] $(point $Q$ does not coincide with point $B$), and points $M$, $N$ are the midpoints of $O Q
[0341] $ and $B$ respectively, then the length of line segment $M=
[0342] $________.",
[0343] 15. Golf is a sport with unique charm. Players use different golf clubs to hit golf balls into holes, thus exercising their bodies and cultivating their minds in a beautiful natural environment. As shown in the figure, when a player hits a golf ball in a certain direction, the ball's flight path is a parabola. Ignoring factors such as air resistance, the ball's flight height $h$ (in meters) and flight time t (in seconds) satisfy a functional relationship $h = \frac{\pi}{\pi}$.
[0344] The time required for the ball to travel from launch to landing is ________ seconds.
[0345] 16. As shown in the figure, in rectangle $AB
[0346] In CD$, point E lies on edge AD, $E
[0347] AC intersects at point F, and AD intersects at point F.
[0348] =2$, $AB=CF$, then $gn$
[0349] The value of \angle ADE$ is ________. ]
[0351] <answer_end>
[0352] <think_start>
[0353] First, I need to determine the overall structure and hierarchical rules of the exam paper. Based on the user's instructions, the first level of the exam paper is usually the main heading, such as "III. Problem Solving". Next, each major question (such as questions 17 and 18) belongs to the second level, and its sub-questions (such as (1) and (2)) belong to the third level. Image markers (such as #image:...) and non-question content are excluded.
[0354] 1. **First Level**:
[0355] The only top-level section is the main title of the major questions: "III. Problem Solving (Questions 17-19 are worth 8 points each, Questions 20-22 are worth 10 points each, Question 23 is worth 12 points, Question 24 is worth 14 points, for a total of 80 points)".
[0356] 2. **Second Level**:
[0357] This includes descriptions of all individual major questions, i.e., the core content of questions 17 to 24. For example, the description of question 17 includes the total score and question description in parentheses, so it is considered as a whole as the second level.
[0358] 3. **Third Level**:
[0359] Sub-problems under each major question (such as (1) and (2)). For example, (1) and (2) of question 17 are listed separately, and (1), (2), and (3) of question 24 are also listed as entries.
[0360] 4. **Fourth / Fifth Level**:
[0361] No further subdivisions were found; the content of all sub-problems has reached the lowest level.
[0362] Special handling aspects:
[0363] Image tags (such as #image:...) are excluded.
[0364] - All mathematical expressions and symbols in the problem are retained and do not need to be simplified or deleted.
[0365] - Unnumbered interstitial content (such as case 2) does not exist in this example because all sub-problems have explicit numbers.
[0366] Verify the correctness of the hierarchical structure:
[0367] - Ensure that content at the same level is arranged in order, without omissions or repetitions.
[0368] - Check whether non-test content, such as page numbers or instructions, has been excluded.
[0369] - It was confirmed that all levels did not exceed the fifth level, but only the third level was actually used.
[0370] After confirming that the hierarchical structure was correct, I began writing the answer section.
[0371] <think_end>
[0372] <answer_start>
[0373] json [
[0375] Level 1
[0376] III. Problem Solving (Questions 17-19: 8 points each; Questions 20-22: 10 points each; Question 23: 12 points; Question 24: 14 points; Total: 80 points)
[0377] Second level
[0378] 17. (This question is worth 8 points)
[0379] (1) Simplify first, then evaluate: $(x
[0380] +1)^{2}-x(x+1)$, where $x=3$.",
[0381] "(2) Solve the equation: \(x -
[0382] 2+\frac{x}{2 - x}=4\).",
[0383] "18. (This question is worth 8 points) The education administrative department stipulates that the average daily outdoor activity time of students should be no less than 1 hour. To understand the situation of students' participation in outdoor activities, the outdoor activity time of some middle school students was sampled and investigated, and the survey results were drawn into the following two incomplete statistical charts. Please answer the following questions according to the information in the figure:",
[0384] "(1) How many students were surveyed in this survey?",
[0385] "(2) Complete the frequency distribution histogram",
[0386] "(3) There are approximately 50,000 ninth - grade students in our city. Please calculate the number of people who participate in outdoor activities for no less than 1.5 hours.",
[0387] "19. (This question is worth 8 points) As shown in the figure, both \(\triangle AOB\) and \(\triangle ECD\) are isosceles right - angled triangles,
[0388] \(\angle AOB=\angle ECD = 90^{\circ}\). Points \(A\), \(C\), \(D\) are on the same straight line. Connect \(BE\), \(AE\)
[0389] $, and extend \(AE\) to intersect \(BE\) at \(F\).",
[0390] "(1) Prove:
[0391] "(2) Are the straight line \(AE\)
[0392] $ perpendicular to \(BE\)? Please prove your conclusion.",
[0393] "20. (This question is worth 10 points) As shown in the figure, it is known that \(A(
[0394] -4,n)\), \(B(2,-4)\) are two intersection points of the graph of the linear function \(y =
[0395] kx + b\) and the graph of the inverse - proportional function \(y=\frac{m}{x}\).",
[0396] "(1) Find the analytical formulas of the inverse - proportional function and the linear function;",
[0397] "(2) Find the area of \(\triangle AOB\);",
[0398] "(3) Please directly write the inequality \(kx
[0399] The solution set of +b-\frac{m}{x}<0$.
[0400] 21. (10 points) As shown in the figure, i is inscribed in circle O, and P is a point outside the circle.
[0401] $ is the tangent to e O, and $PA
[0402] =PB$, connect OP, line segment $AB
[0403] The line segment OP intersects at point D.
[0404] "(1) Prove that: Let e be the tangent to O;",
[0405] (2) If $
[0406] Given that tan\angle BCA = \frac{4}{3}$, and the radius of line O is 5, find the length of line segment yang.
[0407] 22. (10 points) During the pandemic, a supermarket purchased a batch of face masks for sale. It is known that purchasing 4 boxes of mask A and 6 boxes of mask B costs 260 yuan, and purchasing 5 boxes of mask A and 4 boxes of mask B costs 220 yuan. Both types of masks are sold at the same price. The sales volume of mask A is $x_
[0408] The relationship between {1}$(box) and the selling price $x$(yuan) is $y_
[0409] {1} = 400 - 8x$; When the selling price is 40 yuan, 100 boxes of mask B can be sold. For every 1 yuan increase in the selling price, 5 fewer boxes will be sold.
[0410] "(1) What is the purchase price of each box of masks A and B respectively?"
[0411] "(2) At what price will mask B maximize its total sales profit? What is the sum of the sales profits of both types of masks at this price?"
[0412] (3) Given that the sales volume of mask A is not less than the sales volume of mask B.
[0413] Given $\frac{n}{6}$, what should the price be to maximize the total profit of both types of masks?
[0414] 23. (12 points) Definition: If a vertex of a quadrilateral is equidistant from the other three vertices, then the quadrilateral is called an equidistant quadrilateral, and this vertex is called an equidistant point of the quadrilateral.
[0415] (1) Determine: A rhombus with an interior angle of 120° is ________ an equidistant quadrilateral. (Fill in "yes" or "no")
[0416] "(2) As shown in the figure, there are two points A and B in the 5x5 grid. Please find two grid points C and D on each of the two grids provided on the answer sheet, so that the quadrilaterals with vertices A, B, C, and D are all non-congruent 'equidistant quadrilaterals'. Draw the corresponding 'equidistant quadrilaterals' and write down the length of the diagonal of the equidistant quadrilateral whose endpoints are all non-equidistant points."
[0417] "(3) i and iO are both isosceles right triangles, $
[0418] \angle AB = \angle DEC = 90^{\circ}$, connect AD and $AC$.
[0419] $, BC, if quadrilateral $AB
[0420] CD is an equidistant quadrilateral with points A at equal intervals. Find $
[0421] The degree of BOD$.
[0422] 24. (14 points) As shown in the figure, a parabola passes through the origin and point c(B).
[0423] Let A and B be two points on the parabola, $AB$.
[0424] P is on the x-axis, point A has coordinates (x), and point E is on line segment y.
[0425] Point F lies on line segment BC and satisfies $\alpha$.
[0426] BE = \angle AOC$.",
[0427] (1) Find the equation of the parabola;
[0428] (2) If the area of quadrilateral ① is 14, find $S_
[0429] {n}$;",
[0430] (3) Does there exist a point E such that i is an isosceles triangle? If so, find the coordinates of point E; if not, explain why. ]
[0432] Third level
[0433] / / All subproblems (such as (1) and (2)) are already included in the second level. Leaving this blank indicates that there is no further subdivision. ]
[0435] ```
[0436] <answer_end>
[0437] It should be noted that,<think_start> to<think_end> The content between these elements represents the thought processes extracted from the model, and is not visible to the user.<answer_start> to<answer_end> The content between these elements is a tree structure derived from the extraction of information from the text.
[0438] This application first determines the segmentation identifier of the target test paper, and then segments the target test paper based on the segmentation identifier to extract information from the text content corresponding to each segmentation identifier, thereby generating a corresponding tree structure. Compared with directly extracting information from the target test paper, this application effectively reduces the extraction difficulty and improves the extraction accuracy, thus ensuring the efficiency of test paper information extraction. Furthermore, the tree structure includes multiple nodes and node information corresponding to each node. The smallest unit corresponding to the node information is a complete test question, which effectively improves the granularity and cross-platform compatibility of parsing the target test paper content.
[0439] Furthermore, this application embodiment sets up full parameter instruction fine-tuning training and group relative strategy optimization training for the extraction model to be trained, so as to enhance the model's ability to perform fine-grained parsing and output given formats, and enhance the model's generalization ability to extract information from test paper types and question types that have not been seen in the training data. The group strategy optimization mechanism in the group relative strategy optimization training (such as optimizing information extraction strategy by question type and dynamically adjusting confidence threshold by answer type) is used to improve the robustness of handling complex question types (such as multi-layer nested material analysis questions and formula derivation questions).
[0440] Secondly, this application also provides a test paper information extraction device corresponding to the test paper information extraction method. Since the principle of the test paper information extraction device in this application is similar to the above-mentioned message test paper information extraction method in this application, the implementation of the test paper information extraction device can refer to the implementation of the method, and the repeated parts will not be described again.
[0441] Figure 5 A schematic diagram of the test paper information extraction device provided in the embodiments of this application is shown, specifically including:
[0442] Module 501 is configured to acquire the target test paper.
[0443] The module 502 is configured to determine the segmentation identifier of the target test paper;
[0444] The segmentation module 503 is configured to segment the target test paper based on the segmentation identifier to obtain the text content corresponding to each segmentation identifier;
[0445] The generation module 504 is configured to extract information from the text content corresponding to each segmentation identifier and generate a tree structure corresponding to the segmentation identifier; wherein, the tree structure includes multiple nodes and node information corresponding to each node, and the smallest unit corresponding to the node information is a complete test question.
[0446] In yet another embodiment, the determining module 502 is specifically configured as follows:
[0447] The target test paper is input into the pre-trained recognition model;
[0448] The target test paper is identified and analyzed using the recognition model to obtain a segmentation identifier for the target test paper; wherein the segmentation identifier can divide the target test paper into N parts, and the value of N is greater than 2.
[0449] In yet another embodiment, the extraction device further includes a conversion module 505, configured as follows:
[0450] Determine whether the target test paper is in text format;
[0451] If not, convert the target test paper file format to text format.
[0452] In another embodiment, the segmentation module 503 is specifically configured as follows:
[0453] Determine the position and order of the segmentation markers in the target test paper; wherein, the order is the order in which the segmentation markers appear in the target test paper;
[0454] The text content between two adjacent segmentation identifiers is determined as the text content corresponding to the target segmentation identifier; wherein, the target segmentation identifier is the segmentation identifier that comes first in the order of the two adjacent segmentation identifiers;
[0455] For the last segmentation identifier in the sequence, the text content following the last segmentation identifier is determined to be the text content corresponding to the last segmentation identifier.
[0456] In yet another embodiment, the generation module 504 is specifically configured as follows:
[0457] For each segmentation identifier, the segmentation identifier and its corresponding text content are input into the pre-trained extraction model;
[0458] The extraction model is used to identify the segmentation identifier and its corresponding text content to obtain the tree structure corresponding to the segmentation identifier.
[0459] In yet another embodiment, the extraction device further includes a training module 506, configured as follows:
[0460] The initial dataset is obtained through data distillation;
[0461] Based on the data format and data content, the data in the initial dataset is filtered to obtain the training dataset;
[0462] Using the training dataset, the extraction model to be trained is trained to obtain a trained extraction model.
[0463] In yet another embodiment, the training module 506 is further configured as follows:
[0464] Using the training dataset, the extraction model to be trained is fine-tuned with full parameter instructions to obtain an intermediate model;
[0465] The intermediate model is trained using a group-based relative strategy optimization to obtain a well-trained extraction model.
[0466] This application first determines the segmentation identifier of the target test paper, and then segments the target test paper based on the segmentation identifier to extract information from the text content corresponding to each segmentation identifier, thereby generating a corresponding data structure. Compared with directly extracting information from the target test paper, this application effectively reduces the extraction difficulty and improves the extraction accuracy, thus ensuring the efficiency of test paper information extraction. Furthermore, the tree structure includes multiple nodes and node information corresponding to each node, with the smallest unit corresponding to a node being a complete test question, effectively improving the granularity and precision of the analysis of the target test paper content and cross-platform compatibility.
[0467] Thirdly, embodiments of this application also provide a computer program product, which is a computer-readable medium storing a computer program. When executed by a processor, the computer program implements the method provided in any embodiment of the present invention, including the following steps S11 to S14:
[0468] S11, Obtain the target test paper;
[0469] S12, determine the segmentation identifier of the target test paper;
[0470] S13, the target test paper is segmented based on the segmentation identifier to obtain the text content corresponding to each segmentation identifier;
[0471] S14, for each segmentation identifier, extract information from the text content corresponding to the segmentation identifier and generate a tree structure corresponding to the segmentation identifier; wherein, the tree structure includes multiple nodes and node information corresponding to each node, and the smallest unit corresponding to the node information is a complete test question.
[0472] Fourthly, embodiments of this application also provide a computer device, the structural schematic diagram of which can be shown as follows: Figure 6 As shown, the system includes at least a memory 601 and a processor 602. The memory 601 stores a computer program, and the processor 602 implements the method provided in any embodiment of the present invention when executing the computer program in the memory 601. Exemplarily, the computer program steps of the computer device are as follows: S21 to S24:
[0473] S21, Obtain the target test paper;
[0474] S22, determine the segmentation identifier of the target test paper;
[0475] S23, the target test paper is segmented based on the segmentation identifier to obtain the text content corresponding to each segmentation identifier;
[0476] S24, for each segmentation identifier, extract information from the text content corresponding to the segmentation identifier and generate a tree structure corresponding to the segmentation identifier; wherein, the tree structure includes multiple nodes and node information corresponding to each node, and the smallest unit corresponding to the node information is a complete test question.
[0477] Fifthly, embodiments of this application also provide a storage medium carrying one or more computer programs, which, when executed by a processor, implement the method provided in any embodiment of the present invention, including the following steps S31 to S34:
[0478] S31, Obtain the target test paper;
[0479] S32, determine the segmentation identifier of the target test paper;
[0480] S33, the target test paper is segmented based on the segmentation identifier to obtain the text content corresponding to each segmentation identifier;
[0481] S34, for each segmentation identifier, extract information from the text content corresponding to the segmentation identifier and generate a tree structure corresponding to the segmentation identifier; wherein, the tree structure includes multiple nodes and node information corresponding to each node, and the smallest unit corresponding to the node information is a complete test question.
[0482] This application first determines the segmentation identifier of the target test paper, and then segments the target test paper based on the segmentation identifier to extract information from the text content corresponding to each segmentation identifier, thereby generating a corresponding data structure. Compared with directly extracting information from the target test paper, this application effectively reduces the extraction difficulty and improves the extraction accuracy, thus ensuring the efficiency of test paper information extraction. Furthermore, the tree structure includes multiple nodes and node information corresponding to each node, with the smallest unit corresponding to a node being a complete test question, effectively improving the granularity and precision of the analysis of the target test paper content and cross-platform compatibility.
[0483] Optionally, in this embodiment, the computer program product and storage medium may include, but are not limited to, various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk. Optionally, in this embodiment, the processor executes the method steps described in the above embodiments according to the program code stored in the computer program product. Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, which will not be repeated here. Obviously, those skilled in the art should understand that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed on a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be executed in a different order than those described here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any specific hardware and software combination.
[0484] Furthermore, although exemplary embodiments have been described herein, their scope includes any and all embodiments based on this application that have equivalent elements, modifications, omissions, combinations (e.g., schemes involving intersections of various embodiments), adaptations, or alterations. Elements in the claims will be interpreted broadly based on the language used in the claims and are not limited to the examples described in this specification or during the implementation of this application, which will be interpreted as non-exclusive. Therefore, this specification and examples are intended to be considered illustrative only, and the true scope and spirit are indicated by the full scope of the following claims and their equivalents.
[0485] The above description is intended to be illustrative and not restrictive. For example, the above examples (or one or more of them) can be used in combination with each other. Other embodiments can be used by those skilled in the art when reading the above description. Furthermore, in the above detailed description, various features may be grouped together to simplify the application. This should not be construed as an intention that a disclosed feature not claimed is necessary for any claim. Rather, the subject matter of the application may be less than all the features of a particular disclosed embodiment. Thus, the following claims are incorporated herein by reference as examples or embodiments, wherein each claim is an independent, separate embodiment, and these embodiments are contemplated to be combined with each other in various combinations or arrangements. The scope of this application should be determined by reference to the appended claims and the full scope of their equivalents.
[0486] The foregoing has described in detail several embodiments of this application, but this application is not limited to these specific embodiments. Those skilled in the art can make various variations and modifications based on the concept of this application, and all such variations and modifications should fall within the scope of protection claimed in this application.
Claims
1. A method for extracting information from exam papers, characterized in that, include: Obtain the target test paper; Determine the segmentation identifier for the target test paper; The target test paper is segmented based on the segmentation identifier to obtain the text content corresponding to each segmentation identifier; For each segmentation identifier, information is extracted from the text content corresponding to that segmentation identifier to generate a tree structure corresponding to that segmentation identifier; wherein, the tree structure includes multiple nodes and node information corresponding to each node, and the smallest unit corresponding to the node information is a complete test question.
2. The extraction method according to claim 1, characterized in that, The step of determining the segmentation identifier of the target test paper includes: The target test paper is input into the pre-trained recognition model; The target test paper is identified and analyzed using the recognition model to obtain a segmentation identifier for the target test paper; wherein the segmentation identifier can divide the target test paper into N parts, and the value of N is greater than 2.
3. The extraction method according to claim 2, characterized in that, Before inputting the target test paper into the pre-trained recognition model, the process includes: Determine whether the target test paper is in text format; If not, convert the target test paper file format to text format.
4. The extraction method according to claim 1, characterized in that, The step of segmenting the target test paper based on the segmentation identifier to obtain the text content corresponding to each segmentation identifier includes: Determine the position and order of the segmentation markers in the target test paper; wherein, the order is the order in which the segmentation markers appear in the target test paper; The text content between two adjacent segmentation identifiers is determined to be the text content corresponding to the target segmentation identifier; wherein, the target segmentation identifier is the segmentation identifier that comes first in the order of the two adjacent segmentation identifiers; For the last segmentation identifier in the sequence, the text content following the last segmentation identifier is determined to be the text content corresponding to the last segmentation identifier.
5. The extraction method according to claim 1, characterized in that, For each segmentation identifier, information extraction is performed on the text content corresponding to that segmentation identifier to generate a tree structure corresponding to that segmentation identifier, including: For each segmentation identifier, the segmentation identifier and its corresponding text content are input into the pre-trained extraction model; The extraction model is used to identify the segmentation identifier and its corresponding text content to obtain the tree structure corresponding to the segmentation identifier.
6. The extraction method according to claim 5, characterized in that, It also includes extracting the training steps of the model: The initial dataset is obtained through data distillation; Based on the data format and data content, the data in the initial dataset is filtered to obtain the training dataset; Using the training dataset, the extraction model to be trained is trained to obtain a trained extraction model.
7. The extraction method according to claim 6, characterized in that, The step of training the extraction model to be trained using the training dataset to obtain the trained extraction model includes: Using the training dataset, the extraction model to be trained is fine-tuned with full parameter instructions to obtain an intermediate model; The intermediate model is trained using a group-based relative strategy optimization to obtain a well-trained extraction model.
8. A computer program product storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
9. A computer device, comprising at least a memory and a processor, wherein the memory stores a computer program, characterized in that, The processor implements the steps of the method according to any one of claims 1 to 7 when executing a computer program on the memory.
10. A storage medium, characterized in that, The storage medium carries one or more computer programs, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Test question segmentation method and system and readable storage medium
CN111680669A
Test paper analysis method and device, storage medium and electronic equipment
CN113177435A
Document-based intelligent question and answer method and device, electronic equipment and storage medium
CN119917615A