Mathematical question generation method, system and device, medium and product

By constructing a directed acyclic graph and expanding predicates at the gathering point, the problems of inconsistency between formal proof and original reasoning semantics in the generation of mathematical problems in the existing technology and errors in the consistency verification of the question stem are solved, and the generated mathematical problems and specific problems are realized. The effect of matching knowledge fields.

CN119003792AActive Publication Date: 2024-11-22INST OF SOFTWARE - CHINESE ACAD OF SCI

Patent Information

Application Number
CN202411456879.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2024-11-22
Estimated Expiration
2044-10-18

AI Technical Summary

Technical Problem

The existing mathematical problem generation method cannot guarantee that the formal proof obtained by the translation is consistent with the original reasoning semantics, and there is a possibility of errors in the consistency verification of the question stem, resulting in deviations in the generated mathematical problem.

Method used

By constructing a directed acyclic graph as an inference graph, and randomly expanding appropriate predicates at the convergence points of the inference graph, introducing inference fragments of inference graph collection points obtained by decomposition of specific theorems, controlling the scope of the theorems and the number of inference steps used to solve the problem, limiting the Expand the number of times to control the difficulty of the question and generate mathematical problems that meet specific knowledge areas.

Benefits of technology

Ensure that the theorem used in the derivation process of the generated mathematical problems is the set of input theorems, the number of inference steps is fixed, the questions are more in line with specific knowledge areas, and the problems are avoided that the generated questions are much different from the real teaching questions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003792A_ABST
    Figure CN119003792A_ABST
Patent Text Reader

Abstract

The invention provides a mathematical question generation method, system and device, a medium and a product, and relates to the technical field of computers.The method comprises the steps that a target sink is randomly selected from a plurality of sinks in a current question reasoning graph, the target sink serves as a sink to be extended, and random sampling is carried out to obtain candidate predicates to be determined of the sink to be extended; according to the to-be-determined alternative predicate, obtaining a target algebraic relation equation, if it is determined that all sink objects except the to-be-extended sink in the target algebraic relation equation are used as next extended sinks of the to-be-extended sink, the next extended sink is used as a non-extended sink if a closed loop path does not appear after the current topic inference graph is expanded, and the next extended sink is used as a non-extended sink; carrying out the next round of sink extension on the expanded topic inference graph; and generating a corresponding target mathematical question according to the obtained target question reasoning graph after determining that the number of times of performing the sink extension on the expanded question reasoning graph meets a preset extension number of times. According to the invention, the finally generated question is more in line with the specific knowledge field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, system, device, medium and product for generating mathematical questions. Background Art

[0002] Mathematical and physical problem generation is a technology that uses computer technology, especially artificial intelligence technology, to automatically generate mathematical and physical problems. It is widely used in education, scientific research and other fields.

[0003] Question generation mainly summarizes specific concepts for different problem areas, allowing the model to generate questions and reasoning processes based on given concepts, and then translate the reasoning process into formal proofs. Finally, the formal proofs are tested to see if they are correct, thereby selecting questions with correct reasoning as output. Although existing math question generation methods have verified the correctness of questions to a certain extent, they are not rigorous. For example, the model cannot ensure that the formal proof obtained through translation is consistent with the semantics of the original reasoning, and there is still a possibility of error in the numerical verification of the consistency of the question stem, resulting in deviations in the final generated math questions.

[0004] Therefore, there is an urgent need for a method, system, device, medium and product for generating mathematical questions to solve the above problems. Summary of the invention

[0005] In view of the problems existing in the prior art, the present invention provides a method, system, device, medium and product for generating mathematical questions.

[0006] The present invention provides a method for generating mathematical problems, comprising: Randomly select a target sink from multiple sinks that have not been extended in the current question reasoning graph, use the target sink as the sink to be extended in the current question reasoning graph, and use a predicate randomly sampled from the predicate set corresponding to the sink to be extended as a candidate predicate to be determined for the sink to be extended; According to the pending candidate predicate, a target algebraic relation equation is obtained from all algebraic relation equations corresponding to the to-be-extended junction. If all junction objects except the to-be-extended junction in the target algebraic relation equation are determined as the next extended junction of the to-be-extended junction, and the expanded question reasoning graph obtained after the current question reasoning graph is expanded does not have a closed loop path, the next extended junction is used as the junction that has not been extended, and the next round of junction extension is performed on the expanded question reasoning graph; After determining that the number of times the extended question reasoning graph is extended at the confluence point meets the preset extension number, a target question reasoning graph is obtained, and a corresponding target mathematical question is generated according to the target question reasoning graph.

[0007] According to a method for generating mathematical questions provided by the present invention, the method further comprises: Obtain the set of theorems corresponding to the target knowledge domain; Randomly sampling the theorem set to obtain a first random theorem, and taking a predicate randomly sampled from a predicate set corresponding to the first random theorem as an initial candidate predicate; When it is determined that the set of constraints corresponding to the initial candidate predicate as the question stem meets the preset conditions, a set of algebraic relation equations satisfying the algebraic relations between objects in the initial candidate predicate is obtained according to the theorem set and the initial candidate predicate; Based on any one algebraic relation equation in the set of algebraic relation equations, determining the first object in the algebraic relation equation as a source point in an initial question reasoning graph, and using each second object as a sink point in the initial question reasoning graph, so as to obtain the initial question reasoning graph by constructing directed edges between the source point and each sink point; wherein the first object is an object randomly selected from the algebraic relation equation, and the second object is other objects in the algebraic relation equation except the first object; Before randomly selecting a target sink from a plurality of sinks that are not extended in the current question reasoning graph, the method further includes: When it is determined that the current stage is the initial stage of the question reasoning graph, the initial question reasoning graph is used as the current question reasoning graph.

[0008] According to a method for generating mathematical questions provided by the present invention, the method further comprises: Based on the correspondence between the preset predicates and the constraint formulas, the constraint condition set is constructed according to the constraint formulas corresponding to the predicates in the question stem; Based on the question consistency verifier, verify the constraint condition set, and if a solution exists in the verification result, determine that the verification result satisfies the preset condition; In the case that the verification result is inconsistent with the question stem, random re-sampling is performed from the corresponding predicate set, and the predicates obtained by the random re-sampling are added to the question stem.

[0009] According to a method for generating mathematical questions provided by the present invention, the method further comprises: After determining all the junction objects except the junction to be extended in the target algebraic relationship equation as the next extended junction of the junction to be extended, if the expanded question reasoning graph obtained after expanding the current question reasoning graph does not have a closed loop path, the pending alternative predicate is added to the current question stem to obtain an updated question stem, and the constraint conditions corresponding to the target algebraic relationship equation are verified. If the verification result shows a solution, it is determined that the next extended junction is the junction that has not been extended.

[0010] According to a method for generating mathematical questions provided by the present invention, the step of obtaining a target algebraic relation equation from all algebraic relation equations corresponding to the to-be-extended confluence points according to the to-be-determined candidate predicates comprises: If it is determined that all the sink objects in the target algebraic relation equation except the sink to be extended cannot be used as the next extended sink of the sink to be extended for the next round of sink extension, the pending candidate predicate is deleted from the question stem corresponding to the current question reasoning graph, and a predicate randomly sampled from the predicate set corresponding to the sink to be extended is used as a new pending candidate predicate; According to the new undetermined candidate predicate, the target algebraic relation equation is determined from all algebraic relation equations corresponding to the sink to be extended.

[0011] According to a method for generating a math problem provided by the present invention, generating a corresponding target math problem according to the target problem reasoning diagram includes: The target question reasoning graph is input into a trained large language model to obtain the target math question and the target question answer text content corresponding to the target question reasoning graph output by the trained large language model, wherein the trained large language model is trained based on the sample question reasoning graph and the sample math question and sample question answer text content corresponding to the sample question reasoning graph.

[0012] The present invention also provides a mathematical question generation system, comprising: A first processing module is used to randomly select a target sink from multiple sinks that have not been extended in the current question reasoning graph, use the target sink as the sink to be extended in the current question reasoning graph, and use a predicate randomly sampled from a predicate set corresponding to the sink to be extended as a pending candidate predicate for the sink to be extended; A reasoning module, configured to obtain a target algebraic relation equation from all algebraic relation equations corresponding to the to-be-extended junction according to the to-be-determined candidate predicates, and if all junction objects except the to-be-extended junction in the target algebraic relation equation are determined as the next extended junction of the to-be-extended junction, and if the expanded question reasoning graph obtained after the current question reasoning graph is expanded does not have a closed loop path, then the next extended junction is used as the unextended junction, and the expanded question reasoning graph is subjected to the next round of junction extension; The second processing module is used to obtain a target question reasoning graph after determining that the number of times the convergence point extension is performed on the expanded question reasoning graph meets a preset extension number, and generate a corresponding target mathematical question according to the target question reasoning graph.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any one of the above-mentioned methods for generating mathematical problems is implemented.

[0014] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for generating mathematical questions as described above is implemented.

[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned methods for generating mathematical problems.

[0016] The mathematical question generation method, system, device, medium and product provided by the present invention construct a directed acyclic graph as a reasoning graph, and randomly expand suitable predicates at the intersection of the reasoning graph to introduce reasoning fragments of the reasoning graph intersection obtained by decomposing a specific theorem, thereby gradually expanding the reasoning process while effectively controlling the range of theorems used to solve the problem, and controlling the difficulty of the generated questions by limiting the number of expansions, so that the finally generated questions are more in line with the specific knowledge field. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 A schematic diagram of a flow chart of a method for generating mathematical problems provided by the present invention; Figure 2 A schematic diagram of a question reasoning diagram provided by the present invention; Figure 3 A schematic diagram of the process of generating a question reasoning graph provided by the present invention; Figure 4 A schematic diagram of the overall process of the method for generating mathematical problems provided by the present invention; Figure 5 A schematic diagram of the structure of the mathematical problem generation system provided by the present invention; Figure 6 This is a schematic structural diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0020] The existing automatic generation methods of mathematical and scientific questions mainly adopt the method of combining a large language model with a formal language verifier. The technical solution is to summarize specific concepts for different problem fields, and let the large language model generate questions and reasoning processes based on the given concepts, and translate the reasoning process into formal proofs. Finally, the formal language verifier is used to verify whether the formal proof is correct and select questions with correct reasoning as output.

[0021] In addition, there are other methods for automatically generating questions in some specific mathematical fields. For example, the following two technical routes are mainly used for automatically generating plane geometry questions: One technique is to manually summarize a geometric predicate template, randomly sample predicates from the template and combine them to generate a question stem, and finally select the question objective based on the inference of the predicate relationship corresponding to the obtained question stem.

[0022] Another technique is to generate new questions by modifying the motif input by the user. For example, the geometry proof motif is processed, its point geometry identities are extracted and equivalently converted, and finally translated into a new geometry proof question in the Euclidean style; or, the geometry calculation motif stem is fixed, the theorem sequence is randomly sampled and the symbolic reasoner is called for step-by-step reasoning, and finally it is verified whether the reasoning sequence can lead to a new conclusion. If so, it is combined with the motif stem to generate a new question.

[0023] However, when the existing large language model is combined with a formal language verifier to generate questions, although it can cover a wide range, it has poor controllability and cannot control the reasoning difficulty and required theorems of the generated questions. In addition, the diversity of questions generated in subdivided fields is poor, and the equipment and resource costs are high. In addition, the existing technology of question generation methods designed for specific fields has poor versatility or transferability, and the random sampling method has poor controllability. Questions generated by modifying the main topic also have the problem of poor diversity and controllability.

[0024] Although the above existing methods have verified the correctness of the questions to a certain extent, they all have some inaccuracies. For example, the large language model cannot guarantee that the formal proof obtained by translation is consistent with the original reasoning semantics, there is still a possibility of error in the numerical verification of the consistency of the question stem, and the solution process of the generated question is not the shortest reasoning path.

[0025] In view of the problems existing in the prior art, the present invention is a method for automatically generating mathematical problems based on the expansion of reasoning graphs, which outputs a mathematical problem in a specific field by inputting a set of theorems in the specific field and a number of reasoning steps N (i.e., the preset number of extensions). In the present invention, when outputting a mathematical problem, it also includes a text description of the mathematical problem and the answering process, and can ensure that the range of theorems used in the derivation process of the mathematical problem is the input theorem set, and the number of reasoning steps is N.

[0026] Figure 1 A flow chart of the method for generating mathematical problems provided by the present invention is shown in FIG. Figure 1 As shown, the present invention provides a method for generating mathematical questions, comprising: Step 101, randomly select a target sink from multiple sinks that have not been extended in the current question reasoning graph, use the target sink as the sink to be extended in the current question reasoning graph, and use a predicate randomly sampled from a predicate set corresponding to the sink to be extended as a pending candidate predicate for the sink to be extended.

[0027] In the present invention, the target subject area (i.e., target knowledge area) is first determined, and then a set of common theorems summarized in this area is obtained. ; At the same time, for each theorem , and obtain the set of predicates that can satisfy its establishment conditions ,in, It is a predicate that can describe the relationship between objects in this knowledge domain, and its specific value takes the corresponding basic object in this domain as a parameter.

[0028] In the present invention, mathematical questions refer to questions in subjects such as mathematics and physics, including proof questions or calculation questions. Objects refer to the objects of action of predicate relations or algebraic relations in a specific knowledge field, for example, line segments and angles in plane geometry. Basic objects refer to the basic elements that constitute objects in a specific knowledge field, for example, points in plane geometry. The question reasoning graph is a graphical representation of the question reasoning process, in which the nodes (i.e., sinks or source points) of the question reasoning graph represent predicate relations (for proof questions) or objects (for calculation questions), and the derivation relationship between predicate relations (or objects) caused by the edge identification theorem. Figure 2 The schematic diagram of the question reasoning diagram provided by the present invention can be referred to Figure 2 As shown, for the automatic generation of plane geometry calculation problems, theorem set , for the theorem , the geometric predicate condition that can make it true , where the predicate The representative triangle ABC is a right triangle with ∠B as a right angle, that is, the predicate describes the predicate relationship between objects AB and BC that AB is perpendicular to BC.

[0029] In the present invention, at the initial stage, that is, when the problem reasoning graph has not yet been generated, firstly, from the given theorem set Random Sampling Theorem (i.e., the first random theorem), and the predicate that makes the theorem true and use it with the predicate The random arrangement of different basic objects with the same number of parameters is used as its actual parameter to obtain the initial candidate predicate At the same time, the initial alternative predicate is used as the stem corresponding to the question reasoning diagram in the initial stage.

[0030] Furthermore, the theorem set Input the question stem into the symbolic reasoner to obtain the set of equations corresponding to the algebraic relations between all the objects currently obtained. , and the set of theorems corresponding to each conclusion Then, filter according to the following rules Subset of :For any ,set up for The set of all objects contained in does not exist , so that The collection of all objects contained in yes A proper subset of Must not be empty; randomly selected (Preferential random selection can make of ),set up All objects contained in , randomly select objects As the source of the reasoning graph, and construct point to The directed edges of each sink in the graph are used to expand the reasoning graph, indicating the solution The value of can be decomposed into multiple sub-goals For example, you can refer to Figure 2 As shown, when the theorem is the Pythagorean theorem and the predicate relationship is that the line segment AB is perpendicular to the line segment BC, based on the algebraic relationship equations between all the objects obtained, AC is randomly selected as the source point, pointing to the confluence points BC and AB, thereby constructing the initial question reasoning diagram.

[0031] In the present invention, the input to the symbolic reasoner is a given theorem set and the stem consisting of predicates, the output is to use The algebraic relations (generating calculation questions) or predicate relations (generating proof questions) between all objects that can be derived from the current question stem, as well as the theorem used to derive each relation. The front end of the symbolic reasoner defines the appropriate data structure to receive and predicate stem, by calling the symbolic reasoner, using Perform forward reasoning on the stem to the fixed point of reasoning (that is, all the conclusions that can be drawn so far have been obtained), and modify the symbolic reasoner appropriately so that it can record the theorem used to obtain each conclusion. , , through the symbolic reasoner, the algebraic relationship equations between all objects can be obtained as: , and the theorem used to obtain this conclusion is the Pythagorean theorem.

[0032] After constructing the initial question reasoning graph, it is necessary to further determine whether each sink of the reasoning graph can be extended downward and whether the extended reasoning graph meets the conditions. After any sink is extended, the extension times of the question reasoning graph are increased by 1. Before the subsequent sink extension of the initial question reasoning graph, the sink of the question reasoning graph is first randomly selected. (i.e., the sinks that have not been extended) as the target to be decomposed, and according to the inclusion The random sampling theorem in the collection of equations related to the object type , we get the predicate that makes the premise of the theorem true , and then obtain by sampling according to the object type in the predicate Parameters , thus obtaining the pending candidate predicate , so that the candidate predicates to be determined have diversity and can also obtain the inclusion Try to avoid the closed loop path caused by this equation in the reasoning process.

[0033] In one embodiment, the parameters of the candidate predicates can be obtained by the following steps. Specifically, a heuristic strategy is adopted to obtain the sink point Some basic objects in are fixedly or randomly mapped to Some positions of the parameters (which can be summarized a priori for each predicate), if If there are still surplus input parameters, the directed edges are filtered out. All the , and randomly add The basic objects in the question stem or the basic objects that do not appear in the question stem will eventually lead to the candidate predicates to be expanded into the question stem. .

[0034] Step 102, according to the pending alternative predicate, obtain the target algebraic relationship equation from all algebraic relationship equations corresponding to the to-be-extended junction. If all junction objects except the to-be-extended junction in the target algebraic relationship equation are determined as the next extended junction of the to-be-extended junction, and the expanded question reasoning graph obtained after expanding the current question reasoning graph does not have a closed loop path, then the next extended junction is used as the junction that has not been extended, and the next round of junction extension is performed on the expanded question reasoning graph.

[0035] In the present invention, the theorem set The current question stem (i.e., the pending candidate predicate) is input into the symbolic reasoner, and the set of equations corresponding to the algebraic relations between all the objects currently obtained is recorded. , that is, the target algebraic relation equation and the set of theorems corresponding to each conclusion Since the initial question reasoning graph has been constructed in the early stage, the current question reasoning graph is determined after determining the current target to be decomposed. After that, the candidate predicates are determined, and the target algebraic relations are selected according to the following screening rules. Subset of : (a) For any , ,in, For the equation The set of all objects contained in ; (b) For any , does not exist , so that ,and yes A proper subset of ; (c) For any , in the question reasoning graph, establish point to The directed edges of each sink in will not lead to cycles in the inference graph; (d) For any , if we build point to For each sink in the problem, after the values ​​of the objects corresponding to all sinks are given as known conditions, the problem reasoning graph describes one of the shortest backward reasoning processes for obtaining the values ​​of the objects corresponding to the source points using the given theorem set and the current problem stem. This condition can be screened by enumerating the reasoning process.

[0036] If based on the above screening process, the screened Not empty, randomly selected (Prefer random selection to make of ), and build from point to The directed edges of each sink in the graph are used to expand the reasoning graph, indicating the solution The value of can be decomposed into multiple sub-goals The value of .

[0037] If based on the above screening process, the screened If it is empty, randomly traverse all the sinks in the question reasoning graph (without extending the sink point), and select according to the above filtering rules Subset of ;like If it is still empty, the traversal process jumps to the next sink.

[0038] In the present invention, when the current expanded conditions cannot lead to the extension of the question reasoning graph, the current predicate conditions need to be deleted and resampled. Specifically, when it is determined that all the confluence points cannot be extended, new pending candidate predicates are added to the question stem, and then a new set of related equations is obtained. If the subsequent pending candidate predicates added to the question stem still fail to lead to the extension of the question reasoning graph, the pending candidate predicates are deleted from the question stem, and at this time, it is necessary to resample according to the inclusion of The random sampling theorem in the collection of equations related to the object type , and obtain the new candidate predicate that makes the new theorem valid. , then add the candidate predicate to the question stem, and generate the corresponding target algebraic relation equation again through the above process, so as to perform subsequent screening rules to select the target algebraic relation Subset of The present invention extends the reasoning diagram as many times as possible for the question stem in the current question reasoning diagram, avoiding the problem that a condition needs to be expanded each time the reasoning diagram is extended, resulting in a large number of premise conditions in questions with a large number of reasoning steps, which leads to a large difference between the generated questions and the actual teaching questions.

[0039] Step 103, after determining that the number of times the extended question reasoning graph is extended at the confluence point meets the preset extension number, a target question reasoning graph is obtained, and a corresponding target mathematical question is generated according to the target question reasoning graph.

[0040] In the present invention, if the number of confluence point extensions in the question reasoning graph reaches the preset extension number N times, it means that the predicate stem in the current question reasoning graph describes the conditions satisfied between the question objects, and the known quantities that should be given in the question are the object values ​​corresponding to all confluence points in the current question reasoning graph, and the target of the question is the object value corresponding to the source point in the question reasoning graph.

[0041] Furthermore, a natural language template is defined to translate the formal language question and question reasoning diagram into the question description and reasoning process expressed in natural language, and finally the corresponding question is output.

[0042] In one embodiment, a large language model can be used to list the meanings of different predicates and formal language descriptions of the questions in Prompt. Through its contextual learning ability and rich pre-trained knowledge, accurate and more diverse natural language question descriptions can be given to increase the flexibility of question expression and make the generated questions more in line with scenario requirements.

[0043] The method for generating mathematical questions provided by the present invention constructs a directed acyclic graph as a reasoning graph, and randomly expands appropriate predicates at the intersection of the reasoning graph to introduce reasoning fragments of the intersection of the reasoning graph obtained by decomposing a specific theorem, thereby gradually expanding the reasoning process while effectively controlling the range of theorems used to solve the problem, and controlling the difficulty of the generated questions by limiting the number of expansions, so that the finally generated questions are more in line with the specific knowledge field.

[0044] Based on the above embodiment, the method further includes: Obtain the set of theorems corresponding to the target knowledge domain; Randomly sampling the theorem set to obtain a first random theorem, and taking a predicate randomly sampled from a predicate set corresponding to the first random theorem as an initial candidate predicate; When it is determined that the set of constraints corresponding to the initial candidate predicate as the question stem meets the preset conditions, a set of algebraic relation equations satisfying the algebraic relations between objects in the initial candidate predicate is obtained according to the theorem set and the initial candidate predicate; Based on any one algebraic relation equation in the set of algebraic relation equations, determining the first object in the algebraic relation equation as a source point in an initial question reasoning graph, and using each second object as a sink point in the initial question reasoning graph, so as to obtain the initial question reasoning graph by constructing directed edges between the source point and each sink point; wherein the first object is an object randomly selected from the algebraic relation equation, and the second object is other objects in the algebraic relation equation except the first object; Before randomly selecting a target sink from a plurality of sinks that are not extended in the current question reasoning graph, the method further includes: When it is determined that the current stage is the initial stage of the question reasoning graph, the initial question reasoning graph is used as the current question reasoning graph.

[0045] Figure 3 The schematic diagram of the problem reasoning diagram generation process provided by the present invention can be referred to Figure 3 As shown, in the present invention, a specific description is given by generating a geometric calculation problem, and the specific process is as follows: The input theorem set is , set the preset number of reasoning steps, that is, the preset extension times N=3, and the maximum upper limit of the resampling of the candidate predicates to be determined is 10 times. The theorem-predicate premise template is: ; Among them, the predicate means AB is perpendicular to BC, the predicate It means that AB is perpendicular to CD at point B, and the predicate Indicates that A is the midpoint of BC, the predicate Means that A is a point on line segment BC (specifically, A is on line segment BC, and A, B, and C are arranged from bottom left to top right). For all predicates involving point A on line segment BC, it is stipulated that the order of points A, B, and C on the line segment from bottom left to top right is B, A, C.

[0046] Furthermore, after determining the above theorem set, predicate set and preset extension times, the method for generating mathematical questions provided by the present invention first constructs an initial question reasoning graph. Since in the initial stage, the equation sets corresponding to the question stem and reasoning graph are both empty, you can refer to Figure 3 As shown, the theorem (i.e., the first random theorem) is randomly sampled: the line segments and , and the predicate PointLiesOnLine is randomly sampled from the corresponding premise predicates, and then the random arrangement of three different points is used as its actual parameters to obtain the alternative predicate PointLiesOnLine (B, A, C), that is, B is a point on AC, which is used as the initial alternative predicate.

[0047] Then, add the initial candidate predicate to the question stem, and the question stem now contains only the initial candidate predicate. At the same time, the corresponding predicate relationship content "B is a point on AC, and the three points A, B, and C are A, B, and C from the lower left to the upper right on the line segment" is converted into a constraint formula , where the coordinates of points A, B, and C are , which can be obtained through vector knowledge.

[0048] Based on the above embodiment, the method further includes: Based on the correspondence between the preset predicates and the constraint formulas, the constraint condition set is constructed according to the constraint formulas corresponding to the predicates in the question stem; Based on the question consistency verifier, verify the constraint condition set, and if a solution exists in the verification result, determine that the verification result satisfies the preset condition; In the case that the verification result is inconsistent with the question stem, random re-sampling is performed from the corresponding predicate set, and the predicates obtained by the random re-sampling are added to the question stem.

[0049] In the present invention, this set of constraint formulas is input into a question consistency verifier (such as a Z3 solver), and after verification, it is determined that the question stem is consistent. Optionally, in the early stage, a conversion database between predicate relationships and constraint formulas is constructed, and the predicate relationship content corresponding to the alternative predicates is matched with the constraint formula in the database, so as to quickly convert the corresponding target constraint formula. In the present invention, the question consistency verifier takes as input a question stem composed of predicates, and outputs whether the question stem is consistent (that is, whether there is a contradiction in the question conditions). Specifically, the predicate relationship satisfied between objects is first translated into a constraint formula to obtain a set of constraint conditions corresponding to the question stem, and then the constraint solver (Z3 solver) is called to solve this constraint set to determine whether there is a solution. If there is a solution, it means that the question stem is consistent, and vice versa. Please refer to Figure 3 As shown, for the predicate , the coordinates of A, B, and C are , then we can know from the vector that the equivalent constraint formula of the predicate relation AB represented by the predicate is perpendicular to BC: , and then convert each predicate in the question into a corresponding constraint formula and input it into the constraint Z3 solver. When the constraints are consistent, the Z3 solver will return all coordinates that meet the conditions. , otherwise UNSAT is returned, indicating that the constraint formula set is contradictory and has no solution.

[0050] Furthermore, the theorem set and the stem filled with the initial alternative predicates Input the symbolic reasoner and get all the equations that can be derived: Then, after judging that the equation meets the screening criteria through the screening rules of the above embodiment, the equation Expand the question reasoning graph, all the objects it contains are , randomly select AB as the source point of the reasoning graph to be constructed (that is, the final goal of the question), and it can be found that AB can be inferred from BC and AC (according to the equation ), at this time, BC and AC are added as sinks to the reasoning graph to be constructed, and directed edges from AB to BC and AC are established respectively, indicating that the goal AB can be decomposed into two sub-goals BC and AC, thereby completing the construction of the initial question reasoning graph.

[0051] In the present invention, since there is only one algebraic relation equation, if this equation is still used to extend BC or AC, a loop will appear in the reasoning graph. At this time, all the convergence points in the question reasoning graph cannot be extended further, and new alternative predicates need to be added to the question stem. If the corresponding convergence points cannot be extended after adding the new alternative predicates, the alternative predicates in the question stem need to be deleted and new alternative predicates need to be resampled to extend the reasoning graph.

[0052] Based on the above embodiment, the method further includes: After determining all the junction objects except the junction to be extended in the target algebraic relationship equation as the next extended junction of the junction to be extended, if the expanded question reasoning graph obtained after expanding the current question reasoning graph does not have a closed loop path, the pending alternative predicate is added to the current question stem to obtain an updated question stem, and the constraint conditions corresponding to the target algebraic relationship equation are verified. If the verification result shows a solution, it is determined that the next extended junction is the junction that has not been extended.

[0053] In the present invention, all equations are inferred according to the current question stem, and appropriate equations are selected to extend the number of reasoning steps, thereby extending the question reasoning graph, wherein the equations that can extend the question reasoning graph must satisfy: the objects contained in the equations include specified extension convergence points, and when extending through the specified extension convergence points, no loop will appear in the reasoning process, and the reasoning difficulty will not be degraded; in addition, in order to make the generated questions more in line with real questions, if there are two different equations, so that object T can be inferred from object set A or B, but A is a proper subset of B, then A is preferentially selected to infer the equation corresponding to object T to extend the question reasoning graph, thereby removing redundant objects in the question reasoning graph.

[0054] In the present invention, in the initial stage, the question reasoning graph is empty and does not involve issues such as specifying extended convergence points. Therefore, at this time, only the standard of removing redundant objects is used to screen equations. After the initial question reasoning graph is constructed, the screening rules in the above embodiment are used to screen equations, and then the screened equations are randomly selected. The extended convergence point is specified as the target through the equation, and the remaining objects in the equation are used as sub-targets (new convergence points) to complete the expansion of the question reasoning graph.

[0055] Specifically, please refer to Figure 3 As shown, when the question is When , the set of algebraic relation equations corresponding to the reasoning diagram of the question is , the specific extension steps are as follows: S1, randomly select AC as the sink to be extended in the sink of the question reasoning graph, and finally sample the candidate predicate , that is, EC is perpendicular to AD at point C; S2, add alternative predicates to the question stem. Through the question consistency verifier, it can be seen that the question stem is consistent after the alternative predicates are added.

[0056] S3, input the theorem set and the current question into the symbolic reasoner, and all equations that can be derived are: ; Based on the screening rules in the above embodiment, the equation set is obtained: , and then use the equation To further extend the sink AC, all the objects it contains are , we can see that AC can be inferred from CE and AE. Therefore, CE and AE are added to the reasoning graph as sinks, and directed edges from AC to CE and AE are established, indicating that obtaining the target AC can be decomposed into obtaining two sub-targets CE and AE.

[0057] S4, randomly traverse to the sink BC and obtain the set of screening equations , and then randomly select equation , to extend BC, all the objects it contains are , we know that BC can be inferred from CD and BD, so we add CD and BD to the problem reasoning graph as the sink, and establish a directed edge from BC to CD and BD, indicating that obtaining the goal BC can be decomposed into obtaining two sub-goals CD and BD. At this point, the number of extensions of the reasoning graph reaches N=3.

[0058] S5, after the current extension times meet the preset extension times, the obtained question reasoning graph involves the following contents: the current question predicate condition is that point B is located on AC, EC is perpendicular to AD at point C; the known quantities to be given are CE, AE, CD, BD; the solution target is AB. Then the question reasoning graph is translated into the reasoning process expressed in natural language and returned together with the question, and the question generation process ends.

[0059] On the basis of the above embodiment, the step of obtaining the target algebraic relation equation from all algebraic relation equations corresponding to the sink to be extended according to the undetermined candidate predicates includes: If it is determined that all the sink objects in the target algebraic relation equation except the sink to be extended cannot be used as the next extended sink of the sink to be extended for the next round of sink extension, the pending candidate predicate is deleted from the question stem corresponding to the current question reasoning graph, and a predicate randomly sampled from the predicate set corresponding to the sink to be extended is used as a new pending candidate predicate; According to the new undetermined candidate predicate, the target algebraic relation equation is determined from all algebraic relation equations corresponding to the sink to be extended.

[0060] In the present invention, reference may be made to Figure 3 As shown, the current question is , the set of equations corresponding to the question reasoning diagram is When , randomly select BC as the sink to be extended in the problem reasoning graph sink, and sample the theorem line segment and, as well as the predicate At this time, in order to ensure that the equation caused by the premise of the predicate contains BC, point C needs to be fixed at the first position of the parameter, and point B is randomly placed in one of the last two positions of the parameter, and finally the candidate predicate is sampled. , that is, C is a point on DB. Then, add the alternative predicate to the question stem to get the question stem , after being converted into the corresponding constraint formula and input into the Z3 solver, a contradiction occurs (point C should be both below and to the left of point B, and above and to the right of point B). Therefore, it is removed from the question. , that is, delete Figure 3 In the question “C is a point on DB”, resample the alternative predicates.

[0061] In another embodiment, the current question is , the set of equations corresponding to the question reasoning diagram is , randomly select BC as the target to be extended in the topic reasoning graph sink, and finally sample the candidate predicate , that is, B is the midpoint of AC. Then, add the alternative predicates to the question stem. It is verified that the question stem is consistent after adding the alternative predicates. Furthermore, all equations that can be derived at present are , but if these equations are used to decompose BC, the decomposed sub-junction must contain AB, resulting in a loop in the question reasoning graph, so the final set of equations screened is empty. Then randomly traverse all the confluences in the question reasoning graph. If all the confluences cannot be extended at this time, add a new candidate predicate to the question stem. If the candidate predicate newly added to the question stem It does not lead to an extension of the reasoning diagram, so it is removed from the question stem, that is, deleted Figure 3 Alternative predicates in , that is, "B is the midpoint of AC" in the question stem, and re-execute the sampling, so as to extend the question reasoning diagram as many times as possible while reducing a large number of premise conditions in the question.

[0062] Based on the above embodiment, the step of generating a corresponding target math problem according to the target problem reasoning diagram includes: The target question reasoning graph is input into a trained large language model to obtain the target math question and the target question answer text content corresponding to the target question reasoning graph output by the trained large language model, wherein the trained large language model is trained based on the sample question reasoning graph and the sample math question and sample question answer text content corresponding to the sample question reasoning graph.

[0063] In the present invention, the large language model is a deep learning model that can process and understand a large amount of text data and perform natural language generation, understanding, and translation tasks based on it. It has a huge number of parameters and a complex network structure and can capture complex patterns and regularities in the language.

[0064] During the training process, the large language model is trained by learning the association between the "sample question reasoning diagram" and the corresponding "sample math and science questions" and "sample question answer text content". The sample data is prepared in advance and contains a large number of question reasoning diagrams (mathematical or physical problems represented in a graphical way), corresponding math and science questions (i.e., the text description questions converted from these graphical representations) and the answer texts of the questions.

[0065] Furthermore, the goal of the model is to learn to extract key information from the problem reasoning diagram, understand the mathematical or physical logic behind it, and then generate the corresponding, accurate and clear math and science problems and their solution texts. After the model training is completed, first generate the corresponding problem reasoning diagram by taking the theorem set corresponding to the target knowledge field and the preset extension times, and then input the problem reasoning diagram into the model, and the model will output the corresponding math and science problem. Figure 3 As shown, based on the theorem After the preset extension times N=3 to generate the question reasoning graph, the question reasoning graph is input into the trained large language model, and the model outputs multiple questions that meet the requirements, for example, question: point B is on AC, EC is perpendicular to AD at point C, if CD, BD, AE, CE are known, find the value of line segment AB; solution steps: from the line segments and, BD and CD are known, BC can be known; from the Pythagorean theorem, AE and CE are known, AC can be known; from the line segments and, AC and BC are known, AB can be known; solution is complete. In the present invention, during the training process of the large language model, for geometry questions, it can also be trained according to the question geometry graph corresponding to the input sample question reasoning graph, so that the model can generate corresponding geometric figures according to the input geometry type question reasoning graph.

[0066] In one embodiment, the process of generating mathematical problems provided by the present invention is generally described. Figure 4 The overall flow chart of the method for generating mathematical problems provided by the present invention can be referred to as Figure 4 As shown, the specific steps are as follows: Step 1: Randomly search for candidate predicates to be expanded into the current question stem (initially empty). There are two situations: Case A: The initial stage of the problem reasoning graph, when the problem reasoning graph is empty, from the given theorem set Random Sampling Theorem , and the predicate that makes the premise of the theorem true and use it with the predicate The current candidate predicate is obtained by taking the random arrangement of different basic objects with the same number of parameters as its actual parameters. ; Case B: When the initial question reasoning graph is generated, the question reasoning graph is not empty, and the confluence point of the question reasoning graph is randomly selected. as the sink to be decomposed, and from the Random sampling from a collection of theorems related to equations of object type , and the predicate that makes the premise of the theorem true , and then define a heuristic strategy to sample Parameters , so that the resulting candidate predicate While being diverse, it can lead to inclusion , and try to avoid the closed loop path caused by this equation in the reasoning process. Specifically, Some basic objects in are fixedly or randomly mapped to At certain positions of the parameters, if If there are still surplus input parameters, the directed edges are filtered out. All the , and randomly add The basic objects in the question stem or the basic objects that do not appear in the question stem will eventually lead to the candidate predicates to be expanded into the question stem. ; By executing step 1, if the candidate predicates searched each time do not meet the conditions, the search is repeated. If step 1 is repeated to the specified maximum search limit, the question generation fails and the search is terminated. Otherwise, step 2 is executed. The present invention sets the number of searches for candidate predicates in order to sample as many predicate conditions as possible that can extend the number of reasoning steps to expand the question stem. At the initial stage of the question reasoning graph, the question stem and the question reasoning graph are both empty, so at this time, random selection can make the sampling theorem The predicate of which the premise is true and its parameters, in order to obtain the initial equation that can be used to expand the reasoning graph in the subsequent steps (case A); when the question stem and the reasoning graph have been expanded, the extension of the number of reasoning steps needs to target the specified convergence point, so the parameters of the predicate conditions that can extend the number of reasoning steps need to meet more constraints to ensure that the equation it leads to contains the specified extended convergence point and that loops are avoided as much as possible in the reasoning process.

[0067] Step 2: Add the alternative predicate to the question stem and use the question consistency verifier to verify whether the new question stem is consistent. If it is consistent, execute step 3; otherwise, remove the alternative predicate from the current question stem and re-execute step 1. The purpose of this step is to prevent the newly added conditions from contradicting the original conditions in the question, so as to ensure the rationality of the generated question.

[0068] Step 3: Set the theorem And the current question input symbolic reasoner, record the set of equations corresponding to the algebraic relations between all the objects currently obtained , and the set of theorems corresponding to each conclusion ,Similarly, according to the generation stage of the reasoning graph, it can be divided into two cases: Case A: When the question reasoning diagram is empty, filter according to the following rules Subset of :For any ,set up for The set of all objects contained in does not exist , so that The collection of all objects contained in yes A proper subset of Must not be empty; randomly selected (Preferential random selection can make of ),set up All objects contained in , randomly selected As the source of the question reasoning graph, and construct point to The directed edges of each sink in the graph are used to expand the inference graph, indicating that The value of can be decomposed into multiple sub-goals The value of Case B: When the problem reasoning graph is not empty, for the undecomposed confluence point selected in step 1 , filter by the following conditions Subset of : 1. For any , ( for The set of all objects contained in ); 2. For any , does not exist Make and yes A proper subset of ; 3. For any , in the inference graph, we build point to The directed edges of each sink in will not lead to cycles in the inference graph; 4. For any , if we build point to The directed edge of each sink in the question describes one of the shortest backward reasoning processes for obtaining the value of the object corresponding to the source point using the given theorem set and the current question stem, after the values ​​of the objects corresponding to all sinks are given as known conditions. This condition can be selected by enumerating the reasoning process. After filtering through the above filtering conditions, if the filtered If it is empty, go to step 4 directly, otherwise randomly select (Prefer random selection to make of ), and build from point to The directed edges of each sink in the graph are used to expand the inference graph, indicating that The value of can be decomposed into multiple sub-goals The value of For the reasoning diagrams of the questions in the above cases A and B, if they are extended and the total number of extensions reaches N, go to step 6, otherwise go to step 4; In step 2, all equations are inferred according to the current question stem, and appropriate equations are selected to extend the number of reasoning steps, that is, to extend the question reasoning graph. The equations that can extend the reasoning graph must meet the following conditions: the objects they contain include the specified extension sink, which does not cause loops in the reasoning process and does not cause the difficulty of reasoning to degenerate. In addition, in order to make the generated questions more in line with real teaching questions, if there are two different equations so that object T can be inferred from object set A or B, but A is a proper subset of B, then the equation corresponding to T obtained by inference from A is preferred to extend the question reasoning graph, that is, to remove redundant objects in the question reasoning graph. Since the question reasoning graph does not involve the issue of specifying extension sinks when it is empty, only the standard of removing redundant objects is used to filter equations (case A); when the reasoning graph is not empty, all the above filtering conditions are used to filter equations (case B). Randomly select the filtered equations, and only need to use the specified extension sink as the target and the remaining objects in the equation as sub-targets (new sinks) to complete the expansion of the reasoning graph.

[0069] Step 4: Randomly traverse all sinks in the inference graph , and select according to the screening rules of case B in step 3 Subset of ;like If is empty, the traversal process jumps to the next sink. If all sinks cannot be extended, go to step 5. If not empty, randomly select , and build from point to The directed edges of each sink in the problem are used to expand the reasoning graph of the problem, indicating that The value of can be decomposed into multiple sub-goals If the total number of extensions of the inference graph reaches N times, execute step 6, otherwise re-execute step 4.

[0070] In step 4, for the current question stem, extend the question reasoning diagram as many times as possible to avoid expanding a condition each time the question reasoning diagram is extended. This will cause questions with a large number of reasoning steps to contain a large number of premise conditions, resulting in a large difference between the generated questions and the actual teaching questions.

[0071] Step 5: If the alternative predicate added to the question stem in step 2 fails to extend the question reasoning graph, delete the alternative predicate in the question stem and return to step 1. The purpose of this step is to delete the predicate condition and resample when the current expanded condition fails to extend the reasoning graph.

[0072] Step 6, if the current predicate stem describes the conditions satisfied between the objects in the question, the known quantity to be given in the question is the object value corresponding to all the sinks in the current question reasoning graph, and the goal of the question is the object value corresponding to the source point in the question reasoning graph. At this time, the formal language question and the question reasoning graph are translated into the question description and reasoning process expressed in natural language through the defined natural language template, and the question is returned. In one embodiment, a large language model can be used to list the meanings of different predicates and the formal language description of the question in Prompt, and to give an accurate and more diverse natural language question description through its contextual learning ability and rich pre-training knowledge, so as to increase the flexibility of the question expression. The final question is obtained through step 6 and the stem and question reasoning graph are expressed in natural language, so that the generated question is more in line with teaching needs.

[0073] The present invention regards the question generation process as the inverse process of the reasoning process, and synchronously generates diverse and qualified questions by randomly and controllably extending the reasoning process. In the reasoning process, by maintaining a directed acyclic graph as the reasoning graph, and randomly expanding appropriate predicates at the junction of the reasoning graph, the reasoning fragments that use specific theorems to decompose the junction of the reasoning graph are introduced, thereby gradually expanding the reasoning process while effectively controlling the range of theorems used to solve the problem, and limiting the number of expansions to control the difficulty of the generated questions. In addition, by translating the predicate relationship into symbolic constraints and calling the solver to strictly verify the consistency of the question, the shortest reasoning process is guaranteed by enumerating the reasoning path.

[0074] The mathematical question generation system provided by the present invention is described below. The mathematical question generation system described below and the mathematical question generation method described above can be referred to each other.

[0075] Figure 5 The schematic diagram of the structure of the mathematical problem generation system provided by the present invention is as follows: Figure 5As shown, the present invention provides a mathematical question generation system, comprising a first processing module 501, a reasoning module 502, and a second processing module 503, wherein the first processing module 501 is used to randomly select a target sink from multiple sinks that have not been extended in the current question reasoning graph, use the target sink as the sink to be extended in the current question reasoning graph, and use the predicates randomly sampled from the predicate set corresponding to the sink to be extended as the pending candidate predicates of the sink to be extended; the reasoning module 502 is used to obtain the target from all algebraic relation equations corresponding to the sink to be extended according to the pending candidate predicates. algebraic relationship equation, if all the junction objects except the to-be-extended junction in the target algebraic relationship equation are determined as the next extended junction of the to-be-extended junction, and the expanded question reasoning graph obtained after expanding the current question reasoning graph does not have a closed loop path, then the next extended junction is used as the junction that has not been extended, and the expanded question reasoning graph is subjected to the next round of junction extension; the second processing module 503 is used to obtain the target question reasoning graph after determining that the number of junction extensions for the expanded question reasoning graph meets the preset extension number, and generate the corresponding target mathematical question according to the target question reasoning graph.

[0076] The mathematical question generation system provided by the present invention constructs a directed acyclic graph as a reasoning graph, and randomly expands appropriate predicates at the intersection of the reasoning graph to introduce reasoning fragments of the intersection of the reasoning graph obtained by decomposing a specific theorem, thereby gradually expanding the reasoning process while effectively controlling the range of theorems used to solve the problem, and controlling the difficulty of the generated questions by limiting the number of expansions, so that the finally generated questions are more in line with the specific knowledge field.

[0077] The system provided in the embodiment of the present invention is used to execute the above-mentioned method embodiments. Please refer to the above-mentioned embodiments for the specific process and detailed contents, which will not be repeated here.

[0078] Figure 6 A schematic diagram of the structure of an electronic device provided by the present invention, such as Figure 6As shown, the electronic device may include: a processor (Processor) 601, a communication interface (Communications Interface) 602, a memory (Memory) 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604. The processor 601 can call the logic instructions in the memory 603 to execute the method for generating mathematical questions, which includes: randomly selecting a target sink from multiple sinks that have not been extended in the current question reasoning graph, taking the target sink as the sink to be extended in the current question reasoning graph, and taking the predicate randomly sampled from the predicate set corresponding to the sink to be extended as the pending candidate predicate for the sink to be extended; according to the pending candidate predicate, obtaining the target algebraic relationship equation from all algebraic relationship equations corresponding to the sink to be extended; if all sink objects except the sink to be extended in the target algebraic relationship equation are determined as the next extended sink of the sink to be extended, and the expanded question reasoning graph obtained after the current question reasoning graph is expanded does not have a closed loop path, then taking the next extended sink as the sink that has not been extended, and performing the next round of sink extension on the expanded question reasoning graph; after determining that the number of sink extensions on the expanded question reasoning graph meets the preset extension number, obtaining the target question reasoning graph, and generating the corresponding target mathematical question according to the target question reasoning graph.

[0079] In addition, the logic instructions in the above-mentioned memory 603 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0080] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the mathematical question generation method provided by the above-mentioned methods, which includes: randomly selecting a target convergence point from multiple convergence points that have not been extended in the current question reasoning graph, using the target convergence point as the to-be-extended convergence point in the current question reasoning graph, and using the predicate randomly sampled from the predicate set corresponding to the to-be-extended convergence point as the to-be-determined candidate predicate of the to-be-extended convergence point; according to the to-be-determined candidate predicate word, obtain the target algebraic relationship equation from all algebraic relationship equations corresponding to the to-be-extended junctions; if all junction objects in the target algebraic relationship equation except the to-be-extended junction are determined as the next extended junctions of the to-be-extended junction, and the expanded question reasoning graph obtained after expanding the current question reasoning graph does not have a closed loop path, then the next extended junction is used as the unextended junction, and the next round of junction extension is performed on the expanded question reasoning graph; after determining that the number of junction extensions for the expanded question reasoning graph meets the preset extension number, the target question reasoning graph is obtained, and the corresponding target mathematical question is generated according to the target question reasoning graph.

[0081] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the mathematical problem generation method provided by the above-mentioned embodiments, the method comprising: randomly selecting a target sink from a plurality of sinks that have not been extended in the current problem reasoning graph, taking the target sink as the sink to be extended in the current problem reasoning graph, and taking a predicate randomly sampled from a predicate set corresponding to the sink to be extended as a pending candidate predicate for the sink to be extended; according to the pending candidate predicate, selecting a target sink from all algebraic relations corresponding to the sink to be extended; A target algebraic relation equation is obtained from a set of equations. If all the junction objects except the to-be-extended junction in the target algebraic relation equation are determined as the next extended junction of the to-be-extended junction, and no closed loop path appears in the expanded question reasoning graph obtained after the current question reasoning graph is expanded, the next extended junction is used as the unextended junction, and the next round of junction extension is performed on the expanded question reasoning graph. After determining that the number of junction extensions performed on the expanded question reasoning graph meets the preset extension number, a target question reasoning graph is obtained, and a corresponding target mathematical question is generated according to the target question reasoning graph.

[0082] The device embodiments described above are merely illustrative, 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 on 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. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0083] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating mathematical questions, characterized in that: include: Randomly select a target sink from multiple sinks that have not been extended in the current question reasoning graph, use the target sink as the sink to be extended in the current question reasoning graph, and use a predicate randomly sampled from the predicate set corresponding to the sink to be extended as a candidate predicate to be determined for the sink to be extended; According to the pending candidate predicate, a target algebraic relation equation is obtained from all algebraic relation equations corresponding to the to-be-extended junction. If all junction objects except the to-be-extended junction in the target algebraic relation equation are determined as the next extended junction of the to-be-extended junction, and the expanded question reasoning graph obtained after the current question reasoning graph is expanded does not have a closed loop path, the next extended junction is used as the junction that has not been extended, and the next round of junction extension is performed on the expanded question reasoning graph; After determining that the number of times the extended question reasoning graph is extended at the confluence point meets the preset extension number, a target question reasoning graph is obtained, and a corresponding target mathematical question is generated according to the target question reasoning graph.

2. The method for generating mathematical problems according to claim 1, characterized in that: The method further comprises: Obtain the set of theorems corresponding to the target knowledge domain; Randomly sampling the theorem set to obtain a first random theorem, and taking a predicate randomly sampled from a predicate set corresponding to the first random theorem as an initial candidate predicate; When it is determined that the set of constraints corresponding to the initial candidate predicate as the question stem meets the preset conditions, a set of algebraic relation equations satisfying the algebraic relations between objects in the initial candidate predicate is obtained according to the theorem set and the initial candidate predicate; Based on any one algebraic relation equation in the set of algebraic relation equations, determining the first object in the algebraic relation equation as a source point in an initial question reasoning graph, and taking each second object as a sink point in the initial question reasoning graph, so as to obtain the initial question reasoning graph by constructing directed edges between the source point and each sink point; wherein the first object is an object randomly selected from the algebraic relation equation, and the second object is other objects in the algebraic relation equation except the first object; Before randomly selecting a target sink from a plurality of sinks that are not extended in the current question reasoning graph, the method further includes: When it is determined that the current stage is the initial stage of the question reasoning graph, the initial question reasoning graph is used as the current question reasoning graph.

3. The method for generating mathematical problems according to claim 2, characterized in that: The method further comprises: Based on the correspondence between the preset predicates and the constraint formulas, the constraint condition set is constructed according to the constraint formulas corresponding to the predicates in the question stem; Based on the question consistency verifier, verify the constraint condition set, and if a solution exists in the verification result, determine that the verification result satisfies the preset condition; In the case that the verification result is inconsistent with the question stem, random re-sampling is performed from the corresponding predicate set, and the predicates obtained by the random re-sampling are added to the question stem.

4. The method for generating mathematical problems according to claim 2, characterized in that: The method further comprises: After determining all the junction objects except the junction to be extended in the target algebraic relationship equation as the next extended junction of the junction to be extended, if the expanded question reasoning graph obtained after expanding the current question reasoning graph does not have a closed loop path, the pending alternative predicate is added to the current question stem to obtain an updated question stem, and the constraint conditions corresponding to the target algebraic relationship equation are verified. If the verification result shows a solution, it is determined that the next extended junction is the junction that has not been extended.

5. The method for generating mathematical problems according to claim 2, characterized in that: The step of obtaining a target algebraic relation equation from all algebraic relation equations corresponding to the sink to be extended according to the undetermined candidate predicates includes: If it is determined that all the sink objects in the target algebraic relation equation except the sink to be extended cannot be used as the next extended sink of the sink to be extended for the next round of sink extension, the pending candidate predicate is deleted from the question stem corresponding to the current question reasoning graph, and a predicate randomly sampled from the predicate set corresponding to the sink to be extended is used as a new pending candidate predicate; According to the new undetermined candidate predicate, the target algebraic relation equation is determined from all algebraic relation equations corresponding to the sink to be extended.

6. The method for generating mathematical problems according to claim 1, characterized in that: Generating a corresponding target math problem according to the target problem reasoning graph includes: The target question reasoning graph is input into a trained large language model to obtain the target math question and the target question answer text content corresponding to the target question reasoning graph output by the trained large language model, wherein the trained large language model is trained based on the sample question reasoning graph and the sample math question and sample question answer text content corresponding to the sample question reasoning graph.

7. A mathematical question generation system, characterized in that: include: A first processing module is used to randomly select a target sink from multiple sinks that have not been extended in the current question reasoning graph, use the target sink as the sink to be extended in the current question reasoning graph, and use a predicate randomly sampled from a predicate set corresponding to the sink to be extended as a pending candidate predicate for the sink to be extended; A reasoning module, configured to obtain a target algebraic relation equation from all algebraic relation equations corresponding to the to-be-extended junction according to the to-be-determined candidate predicates, and if all junction objects except the to-be-extended junction in the target algebraic relation equation are determined as the next extended junction of the to-be-extended junction, and if the expanded question reasoning graph obtained after the current question reasoning graph is expanded does not have a closed loop path, then the next extended junction is used as the unextended junction, and the expanded question reasoning graph is subjected to the next round of junction extension; The second processing module is used to obtain a target question reasoning graph after determining that the number of times the convergence point extension is performed on the expanded question reasoning graph meets a preset extension number, and generate a corresponding target mathematical question according to the target question reasoning graph.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for generating mathematical problems as described in any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating mathematical problems as described in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for generating mathematical problems as claimed in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method, device and platform for automatically extracting knowledge points of mathematical problems and solving problems

    CN109918514A

  • Topic analysis method and device, electronic equipment and storage medium

    CN111126610A

  • Topic generation method and device, equipment and storage medium

    CN113254591A

  • Anti-fact explanation generation method and system based on multi-objective genetic algorithm

    CN118709774A

  • Using Constraint Solving to Discovering Disjunctive and Quantified Invariants Over Predicate Abstraction

    US20100088548A1

Cited By

  • Proposition method and system combining large model and inference engine, medium and product

    CN119476246A