Physical calculation question correcting method and device, related equipment and computer program product
Through the proposed method of correcting physics calculation questions, the problem that the existing technology cannot effectively deal with physical calculation questions is solved. Through steps such as information extraction and symbol formula restoration, more accurate correction results are achieved, which are suitable for correcting physics calculation questions.
Patent Information
- Application Number
- CN202411542056.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-21
AI Technical Summary
Existing text classification techniques cannot effectively solve specific problems in the correction tasks of physical calculation questions, such as dealing with texts containing a large number of formulas and values, performing semantic inference, and processing divergent answers.
A method for correcting physical calculation questions is proposed. By obtaining the question, standard answers and answer text, formulas are extracted and restored separately, formula types are determined, and the correction results are determined based on the question and standard answers. This method includes steps of information extraction, symbol formula restoration and correction result determination.
This method can handle physical calculation questions more accurately, improve the accuracy of correction results, is suitable for physical calculation questions correction tasks, and can conform to the correction standards of real teachers.
Smart Images

Figure CN119493859A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of natural language processing technology, and more specifically, to a method, device, related equipment and computer program product for correcting physical calculation problems. Background Art
[0002] The existing technologies that can be applied to the task of grading physics calculation problems mainly include text classification technology. Among them, the text classification task is the process of assigning input text to predefined labels. In different tasks, the label categories that need to be assigned are different. In the task of grading physics calculation problems, the model is required to judge whether the student's answer is correct or directly predict the grading score of the student's answer based on the question and the standard answer.
[0003] Compared with general natural language processing tasks, the task of grading physics calculation questions is different from others. For example: 1) The text contains a large number of formulas and numbers; 2) The grading task not only needs to look at the similarity at the text string level, but also requires more semantic reasoning processes; 3) In the physics grading task scenario, the teacher mainly scores based on the formulas and answers in the answers, and the redundant explanatory text has little effect on the score; 4) In the physics grading task scenario, the answers are divergent, and there are large differences between the student answers and the standard answers at the text level. The traditional method of making equivalence judgments based on ordinary text similarity is not suitable for the grading task of physics calculation questions.
[0004] In view of the characteristics of the above-mentioned physical calculation problem correction task, the existing text classification technology cannot be directly applied to the physical calculation problem correction task. In view of this, the existing technology urgently needs a physical calculation problem correction solution. Summary of the invention
[0005] In view of the above problems, this application is proposed to provide a method, device, related equipment and computer program product for grading physical calculation problems that are suitable for the characteristics of grading physical calculation problems. The specific scheme is as follows:
[0006] In a first aspect, a method for correcting physics calculation problems is provided, comprising:
[0007] Get questions, standard answers and answer texts;
[0008] Extracting formulas in the standard answer and the answer text and the answers corresponding to the formulas respectively, and determining the types of the formulas, which at least include pure symbolic formulas and pure numerical formulas;
[0009] Based on the question, respectively, the standard answer and the pure numerical formula type formulas contained in the answer text are reduced to physical quantities to be reduced to symbolic formulas;
[0010] Based on the question, the standard answer and the symbolic formulas contained in the answer text and their corresponding answers, the correction result of the answer text is determined.
[0011] In a possible design, in another implementation of the first aspect of the embodiment of the present application, before determining the correction result of the answer text, it also includes:
[0012] Retrieve the standard formula corresponding to each symbolic formula in the standard answer and the answer text from the configured standard formula library;
[0013] The process of determining the correction result of the answer text based on the question, the standard answer and the symbolic formulas contained in the answer text and their corresponding answers includes:
[0014] Based on the question, the standard answer and the standard formulas contained in the answer text and their corresponding answers, the correction result of the answer text is determined.
[0015] In a possible design, in another implementation of the first aspect of the embodiment of the present application, before the physical quantity reduction of the pure numerical formula type formula contained in the standard answer and the answer text is performed, it also includes:
[0016] Dividing the standard answer and the answer text into steps respectively to obtain a number of steps corresponding to the standard answer and a number of steps corresponding to the answer text;
[0017] The type of each step is determined according to whether each step contains a formula and the type of the formula contained. The step types include: non-formula steps and formula steps. The formula steps at least include pure symbolic formula steps and pure numerical formula steps.
[0018] In a possible design, in another implementation of the first aspect of the embodiment of the present application, based on the question, the process of restoring the physical quantity of the formula of the pure numerical formula type contained in the standard answer and the answer text respectively includes:
[0019] Based on the question, each step of the target answer and the type of each step, the physical quantity of the pure numerical formula type formula in each step of the target answer is restored, wherein the target answer includes the standard answer and the answer text.
[0020] In a possible design, in another implementation of the first aspect of the embodiment of the present application, based on the question, the standard answer, and the standard formulas and their corresponding answers respectively included in the answer text, a process of determining a correction result of the answer text includes:
[0021] Determining a correction result of the answer text based on the structure information of the question, the standard answer and the answer text;
[0022] The structural information of the standard answer and the answer text includes each step, the type of each step, the answer corresponding to the formula in each step, and the standard formula corresponding to each step.
[0023] In a possible design, in another implementation of the first aspect of the embodiment of the present application, based on the question, each step of the target answer and the type of each step, a process of restoring the physical quantity of a formula of a pure numerical formula type in each step of the target answer includes:
[0024] The standard answer and the answer text are used as target answers respectively. For the target answers:
[0025] Obtain a first prompt instruction Prompt format template, the template including a first task instruction, a question slot and a target answer slot, the first task instruction is used to instruct the large model to restore the physical quantity of the pure numerical formula type formula in each step of the target answer in combination with the given question and target answer information, and output the restored symbolic formula in the order of steps;
[0026] Fill the question into the question slot, fill the target answer information into the target answer slot, and obtain a first prompt instruction Prompt, wherein the target answer information includes each step of the target answer and the type of each step;
[0027] The first prompt instruction Prompt is sent to the large model to obtain the symbolic formula output by the large model after restoring the pure numerical formula in each step.
[0028] In a possible design, in another implementation of the first aspect of the embodiment of the present application, the process of determining the correction result of the answer text based on the structural information of the question, the standard answer and the answer text includes:
[0029] Obtain a second prompt instruction Prompt format template, the template including a second task instruction, a question slot, a standard answer slot and an answer text slot, the second task instruction is used to instruct the large model to refer to the given question, the standard answer and the structural information of the answer text, and give a correction result of the answer text;
[0030] Fill the question into the question slot, fill the structural information of the standard answer into the standard answer slot, and fill the structural information of the answer text into the answer text slot to obtain a second prompt instruction Prompt;
[0031] The second prompt instruction Prompt is sent to the large model to obtain the correction result of the answer text output by the large model.
[0032] In one possible design, in another implementation of the first aspect of the embodiment of the present application, the second task instruction includes a step alignment judgment instruction and an overall correction instruction. The step alignment judgment instruction is used to instruct the large model to align and match the steps in the standard answer and the answer text, and output whether the formula and answer in each step in the answer text are correct. The overall correction instruction is used to instruct the large model to output the overall correction score of the answer text based on the input information and the step alignment judgment result.
[0033] In a possible design, in another implementation of the first aspect of the embodiment of the present application, the process of respectively retrieving the standard answer and the standard formula corresponding to each symbolic formula in the answer text in the configured standard formula library includes:
[0034] For each symbolic formula in the standard answer and the answer text:
[0035] Concatenate the question with the current symbolic formula to obtain a concatenated text;
[0036] Determine the feature vector of the concatenated text, and calculate the vector similarity with the feature vector of each standard formula in the standard formula library, wherein the vector encoding method of each standard formula in the standard formula library and the concatenated text is consistent;
[0037] A standard formula whose vector similarity meets the set requirements is selected as the standard formula corresponding to the current symbolic formula.
[0038] In a possible design, in another implementation of the first aspect of the embodiment of the present application, the process of respectively extracting the standard answer and the formula in the answer text and the answer corresponding to the formula includes:
[0039] Using the configured formula and answer extraction model, the standard answer and the answer text are processed respectively to obtain the formulas contained in the standard answer and the answer text and the answers corresponding to the formulas;
[0040] The formula and answer extraction model is trained using training texts annotated with formula labels and answer labels as training data.
[0041] In a second aspect, a device for correcting physics calculation problems is provided, comprising:
[0042] A data acquisition unit, used to acquire questions, standard answers and answer texts;
[0043] An information extraction unit, used to extract the formulas in the standard answer and the answer text and the answers corresponding to the formulas, and determine the types of the formulas, which at least include pure symbolic formulas and pure numerical formulas;
[0044] A symbolic formula restoration unit, used for restoring the physical quantities of the pure numerical formula type formulas contained in the standard answer and the answer text respectively based on the question, so as to restore them into symbolic formulas;
[0045] The correction result determination unit is used to determine the correction result of the answer text based on the question, the standard answer and the symbolic formulas contained in the answer text and their corresponding answers.
[0046] In a third aspect, an electronic device is provided, comprising: a memory and a processor;
[0047] The memory is used to store programs;
[0048] The processor is used to execute the program to implement the method for correcting physical calculation problems described in any one of the first aspects of the present application.
[0049] In a fourth aspect, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for correcting physical calculation problems described in any one of the first aspects of the present application is implemented.
[0050] In a fifth aspect, a computer program product is provided, including a computer program, which, when executed by a processor, implements the method for correcting physical calculation problems described in any one of the first aspects of the present application.
[0051] By means of the above technical scheme, the present application takes into account the characteristics of the task of grading physical calculation questions, respectively extracts the formulas in the standard answers and the answer text and the answers corresponding to the formulas, and determines the type of formula, such as pure symbolic formulas and pure numerical formulas. For pure symbolic formulas, the symbolic formulas therein can be directly obtained. For pure numerical formulas, in order to eliminate the influence of numbers on the comparison of formulas, the present application restores the pure numerical formulas to physical quantities, that is, restores the numbers in the formulas to corresponding physical variables, and obtains the restored symbolic formulas, so that the standard answers and the symbolic formulas in the answer text and the corresponding answers can be obtained. In view of the fact that in the task of grading physical calculation questions, more attention is paid to the correctness of the formulas and answers, and the redundant text explanation has little effect on the final grading results. In the present application, the grading results of the answer text can be determined based on the symbolic formulas and their corresponding answers contained in the questions, standard answers and answer texts. Obviously, the method provided by the present application is more suitable for the task of grading physical calculation questions, and the grading results obtained are also more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0053] Figure 1 A schematic diagram of an implementation system architecture of a method for correcting physics calculation problems provided in an embodiment of the present application;
[0054] Figure 2 A schematic diagram of a terminal structure provided in an embodiment of the present application;
[0055] Figure 3 A schematic diagram of a server structure provided in an embodiment of the present application;
[0056] Figure 4 A schematic diagram of a process flow of a method for correcting physics calculation problems provided in an embodiment of the present application;
[0057] Figure 5 Another schematic diagram of the process of correcting physics calculation problems provided in an embodiment of the present application;
[0058] Figure 6 Another schematic diagram of a process for correcting physics calculation problems provided in an embodiment of the present application;
[0059] Figure 7 A schematic diagram of the structure of a device for correcting physics calculation problems provided in an embodiment of the present application;
[0060] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] Before introducing this application solution, the relevant concepts involved in this article are first explained:
[0062] Prompt: Instructions. When interacting with AI (such as an artificial intelligence model), you need to send instructions to AI. It can be a text description, such as "Please recommend me a pop song" when you interact with AI, or it can be a parameter description in a certain format, such as asking AI to draw in a certain format, which requires describing the relevant drawing parameters.
[0063] Large models: In the field of artificial intelligence, large models usually refer to large-scale pre-trained models. Such models are called "large" because they can be pre-trained on a large amount of data and can be transferred to a variety of downstream tasks. Their full English name is Large Pre-Trained Models or Large-Scale Pre-Training Models. Large models are characterized by their large scale and contain billions or even more parameters, which help them learn complex patterns in the data. The emerging capabilities of large models include but are not limited to: contextual learning, instruction following, code generation, step-by-step reasoning capabilities, etc. Large models can include large language models (LLM) and multimodal large models. Large language models are mainly used to process text modal data. Multimodal large models further integrate multimodal capabilities on the basis of large language models and can process information in multiple modalities, such as images, text, audio, etc.
[0064] 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.
[0065] This application provides a method for correcting physical calculation problems, which can be applied to Figure 1 The system architecture shown in FIG. 1 may include a terminal 100 and a server 200. The server 200 may include one or more servers ( Figure 1 A server is included as an example for explanation).
[0066] The terminal 100 or the server 200 can be used alone to execute the method for correcting physical calculation problems provided in the embodiment of the present application. In addition, the terminal 100 and the server 200 can also be used in collaboration to execute the method for correcting physical calculation problems provided in the embodiment of the present application.
[0067] Next describe Figure 1 The product form of the mid-terminal 100;
[0068] The terminal 100 in the embodiment of the present application can be a mobile phone, a tablet computer, a learning machine, a teaching screen, a wearable device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the embodiment of the present application does not impose any restrictions on this.
[0069] Figure 2 An optional hardware structure diagram of the terminal 100 is shown.
[0070] refer to Figure 2 As shown, the terminal 100 may include a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160, a speaker 161, a microphone 162, an earphone jack 163 (optional), a processor 170, an external interface 180, a power supply 190 and other components. Those skilled in the art will appreciate that Figure 2 These are merely examples of terminals or multi-function devices and do not constitute limitations on the terminals or multi-function devices, which may include more or fewer components than those shown in the figures, or combinations of certain components, or different components.
[0071] The input unit 130 can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the portable multifunctional device. Specifically, the input unit 130 may include a touch screen 131 and / or other input devices 132. The touch screen 131 can collect the user's touch operations on or near it (such as the user's operation on or near the touch screen using any suitable object such as fingers, joints, stylus, etc.), and drive the corresponding connection device according to a pre-set program. The touch screen can detect the user's touch action on the touch screen, convert the touch action into a touch signal and send it to the processor 170, and can receive and execute the command sent by the processor 170; the touch signal at least includes the touch point coordinate information. The touch screen 131 can provide an input interface and an output interface between the terminal 100 and the user. In addition, the touch screen can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic wave. In addition to the touch screen 131, the input unit 130 can also include other input devices. Specifically, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0072] Among them, other input devices 132 can receive input data and so on.
[0073] The display unit 140 can be used to display information input by the user or information provided to the user, various menus of the terminal 100, interactive interfaces, file display and / or playback of any multimedia file. In the embodiment of the present application, the display unit 140 can be used to display various interactive interfaces, processing results, etc. in the method for correcting physical calculation problems.
[0074] The memory 120 can be used to store instructions and data. The memory 120 can mainly include an instruction storage area and a data storage area. The data storage area can store various data, such as multimedia files, texts, etc.; the instruction storage area can store software units such as operating systems, applications, instructions required for at least one function, or their subsets and extensions. It can also include a non-volatile random access memory; provide the processor 170 with hardware, software and data resources including management of computing and processing equipment, and support control software and applications. It is also used for the storage of multimedia files, and the storage of running programs and applications.
[0075] The processor 170 is the control center of the terminal 100. It uses various interfaces and lines to connect various parts of the entire terminal 100. By running or executing instructions stored in the memory 120 and calling data stored in the memory 120, it executes various functions of the terminal 100 and processes data, thereby controlling the terminal device as a whole. Optionally, the processor 170 may include one or more processing units; preferably, the processor 170 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application program, and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 170. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be implemented separately on separate chips. The processor 170 may also be used to generate corresponding operation control signals, send them to corresponding components of the computing and processing device, read and process data in the software, especially read and process data and programs in the memory 120, so that each functional module therein performs corresponding functions, thereby controlling the corresponding components to act according to the requirements of the instructions.
[0076] Among them, the memory 120 can be used to store software codes related to the method for correcting physics calculation problems, the processor 170 can execute the steps of the method for correcting physics calculation problems, and can also schedule other units (such as the above-mentioned input unit 130 and display unit 140) to realize corresponding functions.
[0077] The radio frequency unit 110 (optional) can be used for receiving and sending information or receiving and sending signals during a call, for example, after receiving the downlink information of the base station, it is sent to the processor 170 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the radio frequency unit 110 can also communicate with network devices and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.
[0078] In the embodiment of the present application, the RF unit 110 can send data to the server 200 and receive the processing result sent by the server 200. Exemplarily, the RF unit 110 sends the question, the standard answer and the user's answer text to the server 200, and the server 200 completes the correction processing of the answer text, obtains the correction result of the answer text, and returns the correction result to the terminal 100.
[0079] It should be understood that the radio frequency unit 110 is optional and can be replaced by other communication interfaces, such as a network port.
[0080] The terminal 100 also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.
[0081] The terminal 100 further includes an external interface 180 , which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the terminal 100 to communicate with other devices, or to connect a charger to charge the terminal 100 .
[0082] Although not shown, the terminal 100 may also include a flashlight, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with different functions, etc., which are not described in detail here. Some or all of the methods described below may be applied in the following embodiments. Figure 2 In the terminal 100 shown.
[0083] Next describe Figure 1 The product form of the server 200;
[0084] Figure 3 A structural diagram of a server 200 is provided, such as Figure 3 As shown, the server 200 includes a bus 201, a processor 202, a communication interface 203, and a memory 204. The processor 202, the memory 204, and the communication interface 203 communicate with each other via the bus 201.
[0085] The bus 201 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0086] The processor 202 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0087] The memory 204 may include a volatile memory, such as a random access memory (RAM). The memory 204 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0088] The memory 204 may be used to store software codes related to the method for correcting physics calculation problems, and the processor 202 may execute the steps of the method for correcting physics calculation problems, and may also schedule other units to implement corresponding functions.
[0089] It should be understood that the above-mentioned terminal 100 and server 200 can be centralized or distributed devices, and the processors in the above-mentioned terminal 100 and server 200 (such as processor 170 and processor 202) can be hardware circuits (such as application specific integrated circuit (ASIC), field-programmable gate array (FPGA), general-purpose processor, digital signal processor (DSP), microprocessor or microcontroller, etc.), or a combination of these hardware circuits. For example, the processor can be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.
[0090] The existing technologies that can be applied to the task of grading physics calculation questions mainly include text classification technology. The goal of this technology in the current task scenario is to determine the degree of match between the input student answer and the standard answer based on the current question, and finally obtain a probability value of 0 to 1, which can then be divided into two categories based on the probability threshold: correct or wrong. Alternatively, the probability value of 0 to 1 is directly used to represent the normalized grading score of the student's answer in the question.
[0091] Traditional text classification technology focuses more on the similarity between two input data at the text level, which is very different from the task of grading physical calculation problems. If the existing text classification technology is directly used for the task of grading physical calculation problems, there will be many problems.
[0092] First, conventional classification tasks are based on text-level similarity for equivalence judgment, while in the task of grading physical calculation questions, it is necessary to focus on whether the formula is used correctly and whether the answer is calculated correctly; secondly, there is a large divergence in students' answers, which is specifically manifested in the divergence of answer ideas: the problem-solving ideas used may be different from the standard answers, and there are large differences at the text level. In addition, due to the standardization of grading physical calculation questions, non-critical information such as standard answers and some explanatory texts in students' answers will cause certain interference to the model grading.
[0093] In view of the characteristics of the task of grading physical calculation problems, this application creatively proposes a method for grading physical calculation problems based on formula and answer extraction, so as to realize the automated execution of the task of grading physical calculation problems in accordance with the standards and methods of grading and scoring by real teachers, and improve the accuracy of the grading results.
[0094] The present application embodiment provides a method for correcting physical calculation problems. Figure 1 Taking the computer device in the example as an example, the computer device can be Figure 1 The terminal 100 or the system consisting of the terminal 100 and the server 200. Figure 4 The physical calculation problem correction method specifically includes the following steps:
[0095] Step S100, obtain the question, standard answer and answer text.
[0096] Specifically, in the task of grading physical calculation questions, firstly, the question information of the physical calculation question, the standard answer corresponding to the question, and the answer text completed by the student for the question are obtained.
[0097] Step S110: extract the formulas in the standard answer and the answer text and the answers corresponding to the formulas respectively, and determine the type of the formula.
[0098] This application takes into account that in the task of correcting physical calculation questions, more attention is paid to whether the formulas and answers are correct. For this reason, in this step, the formulas contained in the standard answers and answer texts and the answers corresponding to the formulas are extracted respectively.
[0099] In physics calculation problems, the formula types include at least: purely symbolic formulas and purely numerical formulas.
[0100] Among them, a purely symbolic formula refers to a formula that is composed solely of physical quantity symbols and does not contain the numerical value corresponding to the physical quantity. For example: P = ρ 水 gh, ρ = m / v, etc.
[0101] A pure numerical formula is a formula that consists solely of numerical values and does not contain physical quantity symbols. For example:
[0102] P = 1.0 × 10 3 kg / m×10N / kg×20×10 -2 m, etc.
[0103] Further optionally, in some physics calculation questions, the formula type may also include symbolic and numerical formulas.
[0104] As the name implies, the symbol and value formula contains both the symbol and value of the physical quantity. For example:
[0105] P=ρ水 gh=1.0×10 3 kg / m×10N / kg×20×10 -2 m, etc.
[0106] In this step, for the standard answer and the answer text, the formulas and the answers corresponding to the formulas are extracted respectively. Take the following answering steps as an example to illustrate:
[0107] Step 2: P = ρ 水 gh=1.0×10 3 kg / m×10N / kg×20×10 -2 m=2000Pa.
[0108] The formula extracted from the above answering steps is: P = ρ 水 gh=1.0×10 3 kg / m×10N / kg×20×10 -2 m, this formula belongs to the symbolic and numerical formula type. Further, the answer corresponding to the formula extracted from the above answering steps is: 2000Pa.
[0109] In this step, the process of extracting formulas and answers corresponding to the formulas from the text can be implemented using a preconfigured model. The model can use a formula and answer extraction model, which is pre-trained using training texts labeled with formula labels and answer labels as training data. On this basis, the formula and answer extraction model can be used to process the standard answer and the answer text respectively to obtain the formulas and answers corresponding to the formulas contained in the standard answer and the answer text respectively.
[0110] The formula and answer extraction model may adopt a model of various structures, and this embodiment takes a sequence labeling model as an example for explanation. The formula and answer extraction model may include an encoder, a formula extraction classifier, and an answer extraction classifier.
[0111] The encoder example adopts the BERT-Encoder structure, which performs feature encoding on the input standard answer and answer text respectively, and obtains the feature encoding of each token position in the standard answer and answer text: and
[0112] Among them, S represents the feature coding of the standard answer, and U represents the feature coding of the answer text.
[0113] Then, the feature code S is mapped to the corresponding formula label using the formula extraction classifier, and the feature code U is mapped to the corresponding answer label using the answer extraction classifier. In this embodiment, the label can be a BIO label or other types of labels. Taking the BIO label as an example, B indicates the starting position of the formula / answer; I indicates that the current position is in the previous formula / answer; O indicates that the current position does not belong to the formula / answer.
[0114] Step S120: Based on the question, the standard answer and the answer text are respectively reduced to physical quantities of the pure numerical formula type formulas to reduce them to symbolic formulas.
[0115] Specifically, taking into account the divergence of students' answers, in order to better align the formulas in the answer text and the standard answer, in this step, for the standard answer and the answer text, the pure numerical formula type formulas contained in them are restored to physical quantities, that is, the numerical values are restored to the corresponding physical quantity symbols, thereby restoring the pure numerical formulas to symbolic formulas.
[0116] For the standard answers and answer texts, pure symbolic formulas do not need to be restored and can be directly retained. For the symbolic and numerical formulas in the standard answers and answer texts, the symbolic formulas can be directly extracted from them, and there is no need to restore the physical quantities.
[0117] After processing in this step, the standard answer and the symbolic formula in the answer text, as well as the answer corresponding to the symbolic formula, can be obtained, which can be used for subsequent processing.
[0118] Step S130: Determine the correction result of the answer text based on the question, the standard answer and the symbolic formulas contained in the answer text and their corresponding answers.
[0119] In this step, in order to be closer to the way real teachers mark physics calculation questions, you can refer to the question information and the symbolic formulas contained in the standard answer and the answer text and their corresponding answers to determine the marking result of the answer text.
[0120] Since the purely numerical formulas in the standard answers and answer texts have been restored to symbolic formulas, it is easier to align and compare the formulas, which in turn helps to improve the accuracy of the answer text correction results.
[0121] The method provided in the embodiment of the present application, taking into account the characteristics of the physical calculation problem correction task, extracts the formulas in the standard answer and the answer text and the answers corresponding to the formulas, and determines the type of formula, such as pure symbolic formula, pure numerical formula, etc. For pure symbolic formulas, the symbolic formulas therein can be directly obtained. For pure numerical formulas, in order to eliminate the influence of numbers on the formula comparison, the present application restores the pure numerical formula to physical quantities, that is, restores the numbers in the formula to corresponding physical variables, and obtains the restored symbolic formula, so that the standard answer and each symbolic formula in the answer text and the corresponding answer can be obtained. In view of the fact that in the physical calculation problem correction task, more attention is paid to the correctness of the formula and the answer, and the redundant text explanation has little effect on the final correction result, in the present application, the symbolic formulas and their corresponding answers contained in the question, standard answer and answer text can be determined to correct the answer text. Obviously, the method provided by the present application is more suitable for the physical calculation problem correction task, and the correction result obtained is also more accurate.
[0122] In some embodiments of the present application, it is taken into account that the divergence of students' answers may also be reflected in the divergence of formula application, that is, when using the same standard formula to solve problems, there are differences in usage, such as: not listing the original formula, and directly using the converted formula (a deformed formula of the original formula) for calculation and solution, etc., which may lead to differences in the use of formulas, which may in turn affect the final grading results.
[0123] To this end, this embodiment provides another method for correcting physical calculation questions to improve the impact of divergent answers on formula alignment and equivalence judgment. Figure 5 As shown, the method for correcting physics calculation problems in this embodiment may include the following steps:
[0124] Step S200, obtain the question, standard answer and answer text.
[0125] Step S210: extract the formulas in the standard answer and the answer text and the answers corresponding to the formulas respectively, and determine the type of the formula.
[0126] Step S220: Based on the question, the standard answer and the pure numerical formula type formulas contained in the answer text are respectively reduced to physical quantities to be reduced to symbolic formulas.
[0127] Steps S200-S220 in this embodiment correspond one-to-one to steps S100-S120 in the aforementioned embodiment, and are described in detail above and will not be repeated here.
[0128] Step S230: In the configured standard formula library, the standard formula corresponding to each symbolic formula in the standard answer and the answer text is retrieved respectively.
[0129] Specifically, in order to avoid the difficulty of formula alignment when the same formula is used in different expressions, or even the problem of affecting the judgment of formula equivalence and the final correction results, a standard formula library can be pre-configured in this step, which includes various standard formulas used in physics courses. Then, for each symbolic formula contained in the standard answer and answer text, the matching standard formula can be retrieved in the standard formula library to obtain the standard formula corresponding to each symbolic formula.
[0130] What needs to be explained here is that if a symbolic formula fails to match a corresponding standard formula in the standard formula library, the standard formula corresponding to the symbolic formula can be set to a null value, or the symbolic formula can be directly used as the standard formula.
[0131] Taking a certain symbolic formula "m=G / g" in the answer text as an example, the corresponding standard formula retrieved in the standard formula library is "G=mg", which is the gravity formula.
[0132] In a possible implementation, the present application may pre-encode each standard formula in the standard formula library to obtain a feature vector for each standard formula. Then, for the symbolic formula to be retrieved, the same encoding method is used to encode the symbolic formula to be retrieved to obtain the encoded feature vector. Exemplarily, the same formula feature encoder is used to encode each standard formula in the standard formula library and the symbolic formula to be retrieved. Among them, the formula feature encoder can adopt a variety of types of encoders, including but not limited to encoders based on self-attention.
[0133] After obtaining the feature vector of the symbolic formula to be retrieved, the similarity between the feature vector of the symbolic formula to be retrieved and the feature vectors of each standard formula can be calculated, and the standard formula whose vector similarity meets the set requirements is selected as the standard formula corresponding to the symbolic formula to be retrieved. For example, the top K standard formulas with the highest similarity exceeding the set threshold are selected. The set threshold is, for example, 0.8 or other values. The value of K can be set to 1, 2 or other values.
[0134] In another possible implementation, considering that in a physical scenario, the same symbol in a formula may have different meanings in different fields, the information of the title may be further combined when searching for a standard formula. Therefore, in this embodiment, for each symbolic formula to be searched, the title and the current symbolic formula may be concatenated, for example, by using [SEP] or other set concatenation symbols to obtain a concatenated text, which is represented as P f Then determine the feature vector of the concatenated text, such as using a formula feature encoder to encode the concatenated text to obtain its feature vector H fThen, the vector similarity is calculated with the characteristic vector of each standard formula in the standard formula library. The standard formula whose vector similarity meets the set requirements is selected as the standard formula corresponding to the current symbolic formula.
[0135] The vector similarity calculation process can calculate the cosine similarity of two feature vectors. The setting requirements of the similarity can refer to the above introduction.
[0136] Step S240: Determine the correction result of the answer text based on the question, the standard answer and the standard formulas contained in the answer text and their corresponding answers.
[0137] Specifically, by searching the above-mentioned standard formulas, the standard formulas corresponding to the standard answers and the symbolic formulas in the answer text can be obtained. Therefore, the correction results of the answer text can be determined by referring to the information of the questions, the standard answers and the standard formulas and their answers contained in the answer text.
[0138] In this step, since the standard formula corresponding to the symbolic formula is obtained, the standard answer and the standard formula in the answer text can be aligned and judged to be equivalent when determining the correction result of the answer text. This can improve the impact of the divergence of students' answers on formula alignment and equivalence judgment, thereby improving the accuracy of the correction results.
[0139] Of course, optionally, in this step, in the process of determining the correction result of the answer text, in addition to referring to the standard answer and the respective standard formulas in the answer text, you can further add symbolic formulas, that is, refer to the standard answer and the symbolic formula in the answer text, the standard formula corresponding to the symbolic formula and the answer, to determine the correction result of the answer text, which can improve the accuracy of the correction result.
[0140] In the method provided in this embodiment, the difficulty of formula alignment and equivalence judgment is greatly reduced through the extraction of formulas and answers, formula restoration, and retrieval of standard formulas, so that the grading process of physical calculation problems is more in line with the standards and methods of grading and marking by real teachers, thereby improving the accuracy of the grading results.
[0141] In some embodiments of the present application, in order to compare the standard answer and the student's answer text in a more fine-grained manner, before the aforementioned step S220, based on the question, respectively, the standard answer and the answer text, the pure numerical formula type formulas are restored to physical quantities, and the following processing steps may be added:
[0142] The standard answer and the answer text are divided into steps respectively, to obtain a number of steps corresponding to the standard answer and a number of steps corresponding to the answer text.
[0143] It is understandable that if the standard answer or the answer text itself has been divided into steps, then in this embodiment, there is no need to divide the steps again, and the steps corresponding to the standard answer or the answer text can be directly obtained.
[0144] Further, the type of each step is determined according to whether each step contains a formula and the type of the contained formula.
[0145] Depending on whether the step contains a formula, the step type can be divided into non-formula steps and formula steps. Among them, the formula step can be divided into pure symbolic formula steps and pure numerical formula steps according to the type of formula it contains. In some possible solutions, when the formula contained in the step is a symbolic and numerical formula, the step type can further include a symbolic and numerical formula step.
[0146] Therefore, in an optional implementation, the step types may include: non-formula steps, pure symbolic formula steps, pure numerical formula steps, and symbolic and numerical formula steps.
[0147] When dividing the standard answer and the answer text into steps in this embodiment, a variety of division strategies can be adopted, for example, each line in the text (standard answer and answer text) is regarded as a step. On this basis, if the length of a line of text is greater than the set length threshold, the line of text can be further divided into two steps. When dividing, the formula in the line of text can be referred to, such as taking the text before the formula as one step and the text after the formula as another step.
[0148] Of course, the above only illustrates one optional step splitting method. In addition, other step splitting methods can also be used.
[0149] On this basis, step S220, based on the question, the process of restoring the physical quantity of the formulas of the pure numerical formula type contained in the standard answer and the answer text respectively may include:
[0150] Use the standard answer and answer text as the target answer respectively, and answer according to the target:
[0151] Based on the question, each step of the target answer and the type of each step, the physical quantity of the pure numerical formula type formula in each step of the target answer is restored.
[0152] In step S210, the formula steps in the target answer are extracted. The formula steps include: 1) pure numerical formula steps, 2) pure numerical formula steps, and 3) symbolic and numerical formula steps. For the formulas in 1) and 3), it is only necessary to extract the original symbolic formula in the formula, and there is no need to restore the numerical value. For the pure numerical formula in 2), this type of formula is an intermediate process after numerical substitution, and there are large differences between different questions and different students' answers. Therefore, in this step, each numerical value in this type of formula is restored to the corresponding physical quantity, so as to facilitate the subsequent standard formula retrieval and formula alignment.
[0153] In this embodiment, in the process of restoring the physical quantity of the pure numerical formula in each step of the target answer, reference can be made to the information of the question, the various steps of the target answer and the type information of each step, to assist in more accurately restoring the pure numerical formula to a pure symbolic formula.
[0154] The above-mentioned pure numerical formula restoration process mainly involves the semantic understanding of the question and the target answer. In this embodiment, considering that the large model is more adept at such tasks, a solution for pure numerical formula restoration using a large model is provided.
[0155] Specifically, the input of the large model is: (question, target answer information), where the target answer information is the standard answer and the relevant information of the student's answer text, which can be in the form of a step list, where each step is a list, such as: [step text, step type, answer]. Alternatively, each step list can also be: [step text, step type, answer].
[0156] The step types are divided into four types: non-formula steps, pure numerical formula steps, pure symbolic formula steps, and symbolic and numerical formula steps. Concatenate the (question, target answer information) text with the designed first task instruction to obtain the first prompt instruction PromptF, input it into the large model, and restore the pure numerical formula steps therein to physical quantities. The first task instruction can be used to instruct the large model to combine the given question and target answer information, restore the physical quantities of the pure numerical formula type formulas in each step of the target answer, and output the restored symbolic formulas in the order of steps. An optional example of the first task instruction is provided below:
[0157] "Given a question, a standard answer and a student's answer text, please restore the pure numerical formulas of each step in the standard answer and the student's answer text according to the question and the answer context, restore each numerical value back to the corresponding physical quantity, and output the restored expressions one by one according to the step number."
[0158] F S =LLM(PromptF(P,S))
[0159] F U =LLM(PromptF(P,U))
[0160] Where P, S and U represent the question, the standard answer and the student's answer text respectively, and F S and F U They are the pure symbolic formulas after the pure numerical formulas in the standard answers and the students' answer texts are restored.
[0161] In some embodiments of the present application, an optional implementation method for restoring the physical quantity of the pure numerical formula type in each step of the target answer is provided, based on the question, each step of the target answer and the type of each step, including the following steps:
[0162] Use the standard answer and answer text as the target answer respectively. For the target answer:
[0163] S1. Obtain a first prompt instruction Prompt format template, wherein the template includes a first task instruction, a question slot and a target answer slot. The first task instruction is used to instruct the large model to combine the given question and target answer information, restore the physical quantity of the pure numerical formula type formula in each step of the target answer, and output the restored symbolic formula in the order of steps.
[0164] S2. Fill the question into the question slot, fill the target answer information into the target answer slot, and obtain a first prompt instruction Prompt, wherein the target answer information includes each step of the target answer and the type of each step.
[0165] S3. Send the first prompt instruction Prompt to the large model to obtain the symbolic formula output by the large model after restoring the pure numerical formula in each step.
[0166] In this embodiment, by calling the capabilities of the big model, referring to the questions, the various steps of the target answer and the type information of each step, the pure numerical formulas in each step of the target answer are restored to physical quantities. With the help of the semantic understanding ability of the big model, the physical quantity restoration process of the pure numerical formula can be completed more accurately.
[0167] In some embodiments of the present application, based on the step division of the standard answer and the answer text introduced in the above embodiments, step S240, based on the standard formulas and their corresponding answers respectively included in the question, the standard answer and the answer text, determines the correction result of the answer text, which may include:
[0168] Based on the structural information of the question, the standard answer and the answer text, the correction result of the answer text is determined.
[0169] Among them, the structural information of the standard answer and the answer text includes each step, the type of each step, the answer corresponding to the formula in each step, and the standard formula corresponding to each step. Exemplarily, the structural information can be: [step text, step type, step answer, standard formula corresponding to the step]. Among them, "step text" is the original text information of each step in the standard answer and the answer text. "Step type" as introduced above, can include 4 types: non-formula step, pure numerical formula step, pure symbolic formula step, symbolic and numerical formula step. "Step answer" is the answer obtained in the current step. "Standard formula corresponding to the step" is the corresponding standard formula retrieved from the standard formula library for the formula in the current step.
[0170] It should be noted that if there is no answer or standard formula in the current step, the value of the corresponding position in the structure information can be empty.
[0171] The correction result of the answer text determined in this embodiment may be to provide only the scoring result of the answer text as a whole. In addition, the correction result of each step in the answer text may be further provided, such as whether the formula and answer in each step are correct.
[0172] The above process of determining the correction result of the answer text involves the process of understanding the question, the standard answer and the answer text. Therefore, in this embodiment, the correction task of the answer text can be completed by calling the capabilities of the large model. Based on this, step S240, based on the structural information of the question, the standard answer and the answer text, the process of determining the correction result of the answer text can include:
[0173] S1. Obtain a second prompt instruction Prompt format template, wherein the template includes a second task instruction, a question slot, a standard answer slot and an answer text slot. The second task instruction is used to instruct the large model to refer to the given question, the standard answer and the structural information of the answer text, and give a correction result of the answer text.
[0174] S2. Fill the question into the question slot, fill the structural information of the standard answer into the standard answer slot, and fill the structural information of the answer text into the answer text slot to obtain the second prompt instruction Prompt, defined as PromptR.
[0175] S3. Send the second prompt instruction Prompt to the large model to obtain the correction result of the answer text output by the large model.
[0176] R=LLM(PromptR(P,S,U))
[0177] Among them, R represents the correction result output by the large model, and the meanings of P, S, and U refer to the previous introduction.
[0178] In this embodiment, by calling the capabilities of the big model, referring to the structural information of the questions, standard answers and answer texts, the correction results of the answer texts are determined, and the semantic understanding capabilities of the big model can be used to complete the correction tasks more accurately.
[0179] For the second task instruction in the second prompt instruction PromptR, this embodiment provides a task instruction design method based on thought chain, which instructs the large model to first align the standard answer with the formula in the answer text and judge whether it is right or wrong, and then output the overall correction score of the answer text based on the input information and the above alignment judgment result. Through the task instruction design of thought chain, the large model can be guided to gradually output the results, thereby improving the accuracy of the correction results.
[0180] Corresponding to the above-mentioned thought chain task instruction design, the second task instruction may include step alignment judgment instructions and overall correction instructions.
[0181] Among them, the step alignment judgment instruction is used to instruct the large model to align and match the standard answer and the steps in the answer text, and output the results of whether the formula and answer in each step in the answer text are correct.
[0182] Exemplarily, the step alignment judgment instruction may include:
[0183] "Please first understand the requirements of the question, the standard answers, and the structural information of the student's answer text, match each step in the student's answer text with the steps of the standard answer, and determine whether the formulas and answers are correct, and output the results of each step according to the student's answer steps. The output format of the results is: [matched standard answer step number, step formula correct or incorrect, step answer correct or incorrect], where "matched standard answer step number" outputs -1 if there is no match to the specific standard answer step; if the current step does not have a formula, "step formula correct or incorrect" outputs -1, otherwise outputs 1 or 0, indicating correct or incorrect respectively; if the current step does not have an answer, "answer" outputs -1, otherwise outputs 1 or 0, indicating correct or incorrect respectively."
[0184] As can be seen from the above, the step alignment judgment instruction may further include format requirements for the output results.
[0185] The overall correction instruction in the second task instruction is used to instruct the large model to output the overall correction score of the answer text based on the input information and step alignment judgment results.
[0186] Exemplarily, the overall correction instructions may include:
[0187] "Combining the input information with the previously obtained information, output the overall correction score of the student's answer text, where the score is out of 10 points, 0 points means that none of the student's answer steps are correct; 10 points means that the student's answer steps are all correct. Please output a score between 0 and 10."
[0188] Reference Figure 6 , which illustrates a schematic diagram of the overall process of a method for correcting physics calculation problems. Figure 6 As shown, the present application proposes a method for correcting physical calculation questions based on formula extraction and retrieval alignment. Specifically, given a question, a standard answer (referred to as the standard answer) and a student's answer text (referred to as the student answer), first extract the formulas and answers in the standard answer and the student's answer; then, based on the contextual information of the question and the answer, restore the physical variables of the pure numerical formulas in the standard answer and the student's answer to a pure symbolic formula, eliminating the interference of numbers on formula retrieval; then retrieve the TopK standard formulas most relevant to the pure symbolic formula in the configured standard formula library to assist the subsequent large model in formula alignment and correction; finally, integrate the question, standard answer and student's answer and the corresponding extracted and retrieved standard formulas, and input them into the final large model, so that the model combines the original answer and the extracted standard formula information, and uses the thinking chain method to instruct the large model to first align the formulas in the standard answer and the student's answer text and judge whether they are right or wrong, and then output the final correction score based on the input information and the previously generated information.
[0189] In the grading method proposed in the embodiment of the present application, the difficulty of formula alignment and equivalence judgment is greatly reduced through formula extraction, restoration and retrieval of standard formulas, making the model grading more in line with the standards and methods of grading by real teachers.
[0190] In the following example, an actual physics calculation problem is used to introduce the correction method of the present application. In order to simplify the description, the following example only provides a specific example of the standard answer, and no specific example is given for the student's answer text, and most of its processing methods are the same as the standard answer.
[0191] Example of topic:
[0192] As shown in the figure, the volume is 500cm 3 A rectangular wooden block is immersed in a cylindrical container filled with water. The tension of the thin wire on the wooden block is 2N. The depth of the water is 20cm. (Take g = 10N / kg), find
[0193] (1) The bottom of the container is subjected to water pressure;
[0194] (2) The block of wood is subject to the buoyancy of water;
[0195] (3) Density of the wood block.
[0196] Example of a standard answer:
[0197] Step 1: Solution: (1) The pressure of water on the bottom of the container:
[0198] Step 2: P = ρ 水 gh=1.0×10 3 kg / m×10N / kg×20×10 -2 m=2000Pa
[0199] Step 3: (2) In a cylindrical container filled with water, it is known that: V 排 =0.0005m 3
[0200] Step 4: Then F 浮 =1.0×10 3 kg / m×10N / kg×0.0005m 3 =5N
[0201] Step 5: (3) Downward gravity G = F 浮 -F 拉 =5N-2N=3N
[0202] Step 6: The mass of the wood block is: m = G / g = 0.3 kg
[0203] Step 7: So density: ρ = m / v = 600 kg / m 3
[0204] The student's answer text is omitted here.
[0205] First, the formulas and answers in the standard answers and students' answer texts are extracted.
[0206] Taking the above standard answer as an example, the process of extracting formulas and answers is introduced. After extracting formulas and answers, the following information can be obtained:
[0207] [step text, step type, answer]
[0208] Step 1: ["Solution: (1) Pressure of water on the bottom of the container:","Non-formula steps",""]
[0209] Step 2: ["P = ρ 水 gh=1.0×10 3 kg / m×10N / kg×20×10 -2 m=2000Pa",,"Symbols and numerical formula steps","2000Pa"]
[0210] Step 3: ["(2) In a cylindrical container filled with water, it is known that: V 排 =0.0005m3 ","Non-formula steps",""]
[0211] Step 4: ["Then F 浮 =1.0×10 3 kg / m×10N / kg×0.0005m 3 =5N","Pure numerical formula steps","5N"]
[0212] Step 5: ["(3) Downward gravity G = F 浮 -F 拉 =5N-2N=3N","Symbols and numerical formula steps","3N"]
[0213] Step 6: ["The mass of the wood block is: m = G / g = 0.3kg", "Pure symbolic formula steps", "0.3kg"]
[0214] Step 7: ["So density: ρ = m / v = 600 kg / m 3 ","Pure symbolic formula steps","600kg / m 3 "]
[0215] Furthermore, the pure numerical formulas in the standard answers and students' answer texts are restored.
[0216] For steps with purely symbolic formulas, the purely symbolic formulas can be directly extracted. For purely numerical formulas, the original physical quantities can be restored to obtain the restored purely symbolic formulas.
[0217] Taking the standard answer as an example, the formula results for each step are as follows:
[0218] Step 1: [ ]
[0219] Step 2: ["P = ρ 水 gh"]
[0220] Step 3: [ ]
[0221] Step 4: ["F 浮 =ρ 水 g 排 "]
[0222] Step 5: ["G=F 浮 -F 拉 "]
[0223] Step 6: ["m=G / g"]
[0224] Step 7: ["ρ=m / v"]
[0225] Next, the standard formula is retrieved for each step in the standard answer and the student's answer text.
[0226] Extract the formula in each step and then search for the standard formula.
[0227] Taking the standard answer as an example, the standard formula for the formula in each step is as follows:
[0228] Step 1: [ ]
[0229] Step 2: ["P=ρgh"] # Note: Liquid pressure formula
[0230] Step 3: [ ]
[0231] Step 4: ["F 浮 =G 排 =ρ 液 g 排 "]#Note: Archimedean principle
[0232] Step 5: ["G=F 浮 -F 拉 "]# Note: There is no standard formula, so use the original symbolic formula.
[0233] Step 6: ["G=mg"] # Note: Gravity formula
[0234] Step 7: ["ρ=m / v"] # Note: Density formula
[0235] Finally, the students' answer texts are corrected and the correction results are obtained.
[0236] In the above example, only the processing flow of the standard answer is given. The processing flow of the student's answer text is the same. Finally, the structural information of the standard answer and the student's answer text can be obtained. The format is: [step text, step type, step answer, standard formula corresponding to the step].
[0237] Taking the standard answer as an example, the structural information of each step is as follows:
[0238] Step 1: ["Solution: (1) The pressure of water on the bottom of the container:","Non-formula steps","",""]
[0239] Step 2: ["P = ρ 水 gh=1.0×10 3 kg / m×10N / kg×20×10 -2 m=2000Pa",,"Symbols and numerical formula steps","2000Pa","P=ρgh"]
[0240] Step 3: ["(2) In a cylindrical container filled with water, it is known that: V 排 =0.0005m 3","Non-formula steps","",""]
[0241] Step 4: ["Then F 浮 =1.0×10 3 kg / m×10N / kg×0.0005m 3 =5N","Pure numerical formula steps","5N","F 浮 =G 排 =ρ 液 g 排 "]
[0242] Step 5: ["(3) Downward gravity G = F 浮 -F 拉 =5N-2N=3N","Symbols and numerical formula steps","3N","G=F 浮 -F 拉 "]
[0243] Step 6: ["The mass of the wood block is: m = G / g = 0.3 kg", "Pure symbolic formula steps", "0.3 kg", "G = mg"]
[0244] Step 7: ["So density: ρ = m / v = 600 kg / m 3 ","Pure symbolic formula steps","600kg / m 3 ","ρ=m / v"]
[0245] Finally, the structural information of the questions, standard answers and students’ answer texts is integrated, and the second task instructions are spliced together to obtain the second prompt instruction Prompt, which is sent to the large model LLM to obtain the final output of the large model.
[0246] The following is a description of a physical calculation problem grading device provided in an embodiment of the present application. The physical calculation problem grading device described below and the physical calculation problem grading method described above can refer to each other.
[0247] See also Figure 7 , Figure 7 This is a schematic diagram of the structure of a device for correcting physics calculation problems disclosed in an embodiment of the present application.
[0248] like Figure 7 As shown, the device may include:
[0249] The data acquisition unit 11 is used to acquire questions, standard answers and answer texts;
[0250] An information extraction unit 12 is used to extract the formulas in the standard answer and the answer text and the answers corresponding to the formulas, and determine the types of the formulas, which at least include pure symbolic formulas and pure numerical formulas;
[0251] A symbolic formula restoration unit 13 is used to restore the physical quantity of the pure numerical formula type formulas contained in the standard answer and the answer text based on the question, so as to restore them into symbolic formulas;
[0252] The marking result determining unit 14 is used to determine the marking result of the answer text based on the question, the standard answer and the symbolic formulas contained in the answer text and their corresponding answers.
[0253] In a possible implementation, the device of the present application may further include:
[0254] A standard formula retrieval unit, used to retrieve the standard formula corresponding to each symbolic formula in the standard answer and the answer text in a configured standard formula library;
[0255] The process of determining the correction result of the answer text by the correction result determination unit based on the question, the standard answer and the symbolic formulas respectively contained in the answer text and their corresponding answers includes:
[0256] Based on the question, the standard answer and the standard formulas contained in the answer text and their corresponding answers, the correction result of the answer text is determined.
[0257] In a possible implementation, the device of the present application may further include:
[0258] A step division unit is used to divide the standard answer and the answer text into steps before the symbolic formula restoration unit processes them, so as to obtain a number of steps corresponding to the standard answer and a number of steps corresponding to the answer text;
[0259] The step type determination unit is used to determine the type of each step according to whether each step contains a formula and the type of the formula contained in it. The step types include: non-formula steps and formula steps. The formula steps include at least pure symbolic formula steps and pure numerical formula steps.
[0260] In a possible implementation, the symbolic formula restoration unit restores the physical quantity of the pure numerical formula type formulas contained in the standard answer and the answer text based on the question, including:
[0261] Based on the question, each step of the target answer and the type of each step, the physical quantity of the pure numerical formula type formula in each step of the target answer is restored, wherein the target answer includes the standard answer and the answer text.
[0262] In a possible implementation, the process of determining the correction result of the answer text by the correction result determination unit based on the question, the standard answer, and the standard formulas respectively included in the answer text and their corresponding answers includes:
[0263] Determining a correction result of the answer text based on the structure information of the question, the standard answer and the answer text;
[0264] The structural information of the standard answer and the answer text includes each step, the type of each step, the answer corresponding to the formula in each step, and the standard formula corresponding to each step.
[0265] In a possible implementation, the symbolic formula restoration unit restores the physical quantity of the pure numerical formula type formula in each step of the target answer based on the question, each step of the target answer and the type of each step, including:
[0266] The standard answer and the answer text are used as target answers respectively. For the target answers:
[0267] Obtain a first prompt instruction Prompt format template, the template including a first task instruction, a question slot and a target answer slot, the first task instruction is used to instruct the large model to restore the physical quantity of the pure numerical formula type formula in each step of the target answer in combination with the given question and target answer information, and output the restored symbolic formula in the order of steps;
[0268] Fill the question into the question slot, fill the target answer information into the target answer slot, and obtain a first prompt instruction Prompt, wherein the target answer information includes each step of the target answer and the type of each step;
[0269] The first prompt instruction Prompt is sent to the large model to obtain the symbolic formula output by the large model after restoring the pure numerical formula in each step.
[0270] In a possible implementation, the process of determining the correction result of the answer text by the correction result determination unit based on the structural information of the question, the standard answer and the answer text includes:
[0271] Obtain a second prompt instruction Prompt format template, the template including a second task instruction, a question slot, a standard answer slot and an answer text slot, the second task instruction is used to instruct the large model to refer to the given question, the standard answer and the structural information of the answer text, and give a correction result of the answer text;
[0272] Fill the question into the question slot, fill the structural information of the standard answer into the standard answer slot, and fill the structural information of the answer text into the answer text slot to obtain a second prompt instruction Prompt;
[0273] The second prompt instruction Prompt is sent to the large model to obtain the correction result of the answer text output by the large model.
[0274] In one possible implementation, the second task instruction includes a step alignment judgment instruction and an overall correction instruction. The step alignment judgment instruction is used to instruct the large model to align and match the standard answer and the steps in the answer text, and output whether the formula and answer in each step in the answer text are correct. The overall correction instruction is used to instruct the large model to output the overall correction score of the answer text based on the input information and the step alignment judgment result.
[0275] In a possible implementation, the process of the standard formula retrieval unit retrieving the standard answer and the standard formula corresponding to each symbolic formula in the answer text from the configured standard formula library includes:
[0276] For each symbolic formula in the standard answer and the answer text:
[0277] Concatenate the question with the current symbolic formula to obtain a concatenated text;
[0278] Determine the feature vector of the concatenated text, and calculate the vector similarity with the feature vector of each standard formula in the standard formula library, wherein the vector encoding method of each standard formula in the standard formula library and the concatenated text is consistent;
[0279] A standard formula whose vector similarity meets the set requirements is selected as the standard formula corresponding to the current symbolic formula.
[0280] In a possible implementation, the process of the information extraction unit extracting the standard answer and the formula in the answer text and the answer corresponding to the formula respectively includes:
[0281] Using the configured formula and answer extraction model, the standard answer and the answer text are processed respectively to obtain the formulas contained in the standard answer and the answer text and the answers corresponding to the formulas;
[0282] The formula and answer extraction model is trained using training texts annotated with formula labels and answer labels as training data.
[0283] The present application also provides an electronic device in an embodiment. Figure 8As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, tablet computers, learning machines, teaching large screens, wearable devices, etc. Figure 8 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0284] like Figure 8 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603, so as to implement the physical calculation problem correction method of the aforementioned embodiment of the present application. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0285] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0286] An embodiment of the present application also provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any one of the physics calculation problem grading methods provided in the embodiments of the present application.
[0287] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any one of the physics calculation problem grading methods provided in the embodiment of the present application.
[0288] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0289] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0290] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0291] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0292] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.
Claims
1. A method for correcting physical calculation problems, characterized in that: include: Get questions, standard answers and answer texts; Extracting formulas in the standard answer and the answer text and the answers corresponding to the formulas respectively, and determining the types of the formulas, which at least include pure symbolic formulas and pure numerical formulas; Based on the question, respectively, the standard answer and the pure numerical formula type formulas contained in the answer text are reduced to physical quantities to be reduced to symbolic formulas; Based on the question, the standard answer and the symbolic formulas contained in the answer text and their corresponding answers, the correction result of the answer text is determined.
2. The method according to claim 1, characterized in that Before determining the correction result of the answer text, the method further includes: Retrieve the standard formula corresponding to each symbolic formula in the standard answer and the answer text from the configured standard formula library; The process of determining the correction result of the answer text based on the question, the standard answer and the symbolic formulas contained in the answer text and their corresponding answers includes: Based on the question, the standard answer and the standard formulas contained in the answer text and their corresponding answers, the correction result of the answer text is determined.
3. The method according to claim 2, characterized in that Before reducing the physical quantity of the pure numerical formula type formulas contained in the standard answer and the answer text, it also includes: Dividing the standard answer and the answer text into steps respectively to obtain a number of steps corresponding to the standard answer and a number of steps corresponding to the answer text; The type of each step is determined according to whether each step contains a formula and the type of the formula contained. The step types include: non-formula steps and formula steps. The formula steps at least include pure symbolic formula steps and pure numerical formula steps.
4. The method according to claim 3, characterized in that Based on the question, the process of restoring the physical quantity of the pure numerical formula type formulas contained in the standard answer and the answer text respectively includes: Based on the question, each step of the target answer and the type of each step, the physical quantity of the pure numerical formula type formula in each step of the target answer is restored, wherein the target answer includes the standard answer and the answer text.
5. The method according to claim 3, characterized in that: The process of determining the correction result of the answer text based on the question, the standard answer and the standard formula contained in the answer text and the corresponding answer, includes: Determining a correction result of the answer text based on the structure information of the question, the standard answer and the answer text; The structural information of the standard answer and the answer text includes each step, the type of each step, the answer corresponding to the formula in each step, and the standard formula corresponding to each step.
6. The method according to claim 4, characterized in that Based on the question, each step of the target answer and the type of each step, the process of restoring the physical quantity of the pure numerical formula type formula in each step of the target answer includes: The standard answer and the answer text are used as target answers respectively. For the target answers: Obtain a first prompt instruction Prompt format template, the template including a first task instruction, a question slot and a target answer slot, the first task instruction is used to instruct the large model to restore the physical quantity of the pure numerical formula type formula in each step of the target answer in combination with the given question and target answer information, and output the restored symbolic formula in the order of steps; Fill the question into the question slot, fill the target answer information into the target answer slot, and obtain a first prompt instruction Prompt, wherein the target answer information includes each step of the target answer and the type of each step; The first prompt instruction Prompt is sent to the large model to obtain the symbolic formula output by the large model after restoring the pure numerical formula in each step.
7. The method according to claim 5, characterized in that The process of determining the correction result of the answer text based on the structural information of the question, the standard answer and the answer text, comprises: Obtain a second prompt instruction Prompt format template, the template including a second task instruction, a question slot, a standard answer slot and an answer text slot, the second task instruction is used to instruct the large model to refer to the given question, the standard answer and the structural information of the answer text, and give a correction result of the answer text; Fill the question into the question slot, fill the structural information of the standard answer into the standard answer slot, and fill the structural information of the answer text into the answer text slot to obtain a second prompt instruction Prompt; The second prompt instruction Prompt is sent to the large model to obtain the correction result of the answer text output by the large model.
8. The method according to claim 7, characterized in that The second task instructions include step alignment judgment instructions and overall correction instructions. The step alignment judgment instructions are used to instruct the large model to align and match the standard answers and the steps in the answer text, and output whether the formulas and answers in each step in the answer text are correct. The overall correction instructions are used to instruct the large model to output the overall correction score of the answer text based on the input information and the step alignment judgment results.
9. The method according to claim 2, characterized in that: The process of respectively retrieving the standard answer and the standard formula corresponding to each symbolic formula in the answer text in the configured standard formula library includes: For each symbolic formula in the standard answer and the answer text: Concatenate the question with the current symbolic formula to obtain a concatenated text; Determine the feature vector of the concatenated text, and calculate the vector similarity with the feature vector of each standard formula in the standard formula library, wherein the vector encoding method of each standard formula in the standard formula library and the concatenated text is consistent; A standard formula whose vector similarity meets the set requirements is selected as the standard formula corresponding to the current symbolic formula.
10. The method according to any one of claims 1 to 9, characterized in that: The process of respectively extracting the standard answer and the formula in the answer text and the answer corresponding to the formula includes: Using the configured formula and answer extraction model, the standard answer and the answer text are processed respectively to obtain the formulas contained in the standard answer and the answer text and the answers corresponding to the formulas; The formula and answer extraction model is trained using training texts annotated with formula labels and answer labels as training data.
11. A device for correcting physical calculation problems, characterized in that: include: A data acquisition unit, used to acquire questions, standard answers and answer texts; An information extraction unit, used to extract the formulas in the standard answer and the answer text and the answers corresponding to the formulas, and determine the types of the formulas, which at least include pure symbolic formulas and pure numerical formulas; A symbolic formula restoration unit is used to restore the physical quantities of the pure numerical formula type formulas contained in the standard answer and the answer text respectively based on the question, so as to restore them into symbolic formulas; The correction result determination unit is used to determine the correction result of the answer text based on the question, the standard answer and the symbolic formulas contained in the answer text and their corresponding answers.
12. An electronic device, characterized in that: include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the method for correcting physical calculation problems as described in any one of claims 1 to 10.
13. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the method for correcting physics calculation problems according to any one of claims 1 to 10 is implemented.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, each step of the method for correcting physics calculation problems as claimed in any one of claims 1 to 10 is implemented.
Citation Information
Cited By
Method and device for distillation reinforcement learning data set of intelligent computing center for providing computing power
CN120492933A
Question correction method, device and equipment based on large model and storage medium
CN120671801A