A mathematical question data enhancement method and system based on semantic retrieval

By using a semantic retrieval-based data augmentation method for math problems, the problems of semantic perturbation and language dependence in existing technologies are solved. This method generates math problems with similar logical structures, expands the diversity of the dataset, and improves the adaptability of the model.

CN119692357BActive Publication Date: 2025-11-25GUANGDONG UNIV OF TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411916832.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-11-25
Estimated Expiration
2044-12-24

AI Technical Summary

Technical Problem

Existing data augmentation methods for math problems directly modify the input data, leading to semantic information disturbance. Furthermore, they rely on specific languages, limiting the applicability and adaptability of the model when processing different types of data.

Method used

This method employs a semantic retrieval approach, using a neural network model to calculate the features of mathematical problems. Semantically similar features are then selected for hybrid enhancement. Gradient stopping strategy and loss function are used for iterative training to generate mathematical problems with similar logical structures, thus overcoming language barriers and being applicable to different question types.

Benefits of technology

It effectively expands the diversity of the dataset, improves the model's adaptability to different question types, ensures that the generated math questions are semantically similar and logically consistent, does not depend on a specific language, and is applicable to both Chinese and English.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119692357B_ABST
    Figure CN119692357B_ABST
Patent Text Reader

Abstract

The application discloses a mathematical question data enhancement method and system based on semantic retrieval. The method comprises the following steps: loading a mathematical question data set, calculating the characteristics of each mathematical question by using a preset neural network model encoder, and outputting an original characteristic set; for one characteristic in the set, another most similar characteristic in the whole characteristic set is screened out by calculating semantic similarity, and a screened characteristic is obtained; the original characteristic and the screened characteristic are mixed and enhanced, and an enhanced characteristic is obtained; the original characteristic and the enhanced characteristic are input into a preset neural network model decoder, and a structured solution is obtained; the above process is repeated, the parameters of the model are iteratively trained by using a loss function with a gradient stopping strategy, and an optimized mathematical question and its solution are obtained. The application can effectively improve the adaptability of the model to different question types, can also overcome language barriers, and is also applicable to mathematical questions in Chinese and English.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of natural language processing, and more particularly, relates to a mathematical question data enhancement method and system based on semantic retrieval. BACKGROUND

[0002] The combination of technologies from the fields of machine reasoning and natural language processing with intelligent education has made mathematical question automatic solving a hot research topic again in recent years. Mathematical question automatic solving requires a model to have the ability to obtain useful information from a text question or a chart, deduce a solution process, and obtain a final answer, just like a human being. This process is a great challenge for a model. Therefore, building a mathematical question automatic solving model has always been a key task in the field of natural language processing intelligent question answering, is a core research problem in building a personalized intelligent education system, and is one of the indispensable key technologies in the process of moving towards general artificial intelligence.

[0003] At present, many experts and scholars at home and abroad have proposed many data sets for this task, such as Math23k, MAWPS, GeoQA, and UniGeo. However, the existing data sets are not large enough to train a robust model, which will weaken the performance of this highly data-driven model. To solve the problem of reaching the performance bottleneck of the model, more high-quality data are needed for training. In addition, due to the lack of a large number of directly available mathematical questions and the requirement of mastering professional knowledge, the existing mathematical question data sets are small in size, and traditional NLP data enhancement methods and existing mathematical question data enhancement methods may cause missing of question information. They directly modify the input data, which will excessively disturb the semantic information of the question, and the existing mathematical question data enhancement methods are only for one type of question and language, for example, only for application questions or geometry questions, and are only suitable for Chinese, which limits the applicability of the model in processing different data.

[0004] The existing technology with the publication number CN113095045B proposes a Chinese mathematical application question data enhancement method based on reverse operation, which directly performs reverse operation on mathematical questions, and the generated mathematical question texts may not be natural in language expression or not conform to human understanding habits, affecting the explainability of the model. These data enhancement methods based on input data will disturb the semantic information of the question and are not suitable for mathematical question data enhancement. SUMMARY

[0005] To overcome the problems of the existing mathematical question data enhancement methods, in particular, directly modifying the input data, which will excessively disturb the semantic information of the question, and relying on specific language character sequences instead of focusing on the logical structure implied by the question, the present application provides a mathematical question data enhancement method and system based on semantic retrieval.

[0006] The primary object of the present application is to solve the above technical problems, and the technical solution of the present application is as follows:

[0007] The first aspect of the present application provides a mathematical question data enhancement method based on semantic retrieval, comprising the following steps:

[0008] Load the mathematical question data set, use the preset neural network model encoder to calculate the features of each mathematical question, and output the original mathematical question feature set;

[0009] For a mathematical question feature in the set, the most similar mathematical question feature is selected from the entire feature set by calculating the semantic similarity, and the filtered mathematical question feature is obtained;

[0010] Mix the original mathematical question feature and the filtered mathematical question feature to obtain the enhanced mathematical question feature;

[0011] Input the original mathematical question feature and the enhanced mathematical question feature into the preset neural network model decoder to obtain the structured solution of the mathematical question;

[0012] Repeat the above process, use the loss function with gradient stopping strategy to iteratively train the encoder, decoder and the parameters of the mixed enhancement process, minimize the semantic difference between the original feature and the enhanced feature, and obtain the optimized mathematical question and its solution.

[0013] Further, the method for calculating the features of each piece of data using the preset neural network model encoder comprises the following steps:

[0014] Convert each word in the mathematical question text into a word embedding vector using an embedding layer;

[0015] Input the converted word embedding vector sequence into the encoder to output a hidden state sequence;

[0016] Take the last hidden state of the hidden state sequence as the feature output of the mathematical question text.

[0017] Further, the method for selecting the most similar mathematical question feature comprises the following steps:

[0018] Select each mathematical question feature from the original feature set as the target mathematical question feature in order;

[0019] Calculate the similarity distance between the mathematical question feature and other mathematical question features in the original feature set;

[0020] Compare all the calculated distance values, select the mathematical question feature with the smallest distance from the target mathematical question feature, and obtain the filtered mathematical question feature.

[0021] Further, the method of hybrid enhancement comprises the following steps:

[0022] generating a first binary mask and a second binary mask opposite to the first binary mask bit by bit; and randomly generating a hybrid proportion coefficient;

[0023] mixing the original mathematical question features and the screened mathematical question features according to the hybrid proportion coefficient, the first binary mask and the second binary mask to obtain enhanced mathematical question features, and the expression is as follows:

[0024] h′ i =α·M·h i +(1-α)·M·h s +M′·h i (1)

[0025] wherein, the hybrid proportion coefficient is α, M and M' are binary masks, α∈[0, 1], h i is a certain original mathematical question feature, h s is a similar mathematical question feature with the smallest distance from h i , and h′ i is the enhanced mathematical question feature corresponding to h i and h s .

[0026] Further, the preset neural network model is a GTS model or an NGS model.

[0027] Further, the loss function with a gradient stopping strategy is used for training, and the method comprises the following steps:

[0028] inputting the original mathematical question features and the enhanced mathematical question features into a decoder respectively to obtain respective prediction output probability distributions;

[0029] combining the gradient stopping strategy and the respective prediction output probability distributions, and training the parameters of the encoder, the decoder and the hybrid enhancement process by using the loss function to minimize the semantic difference between the original features and the enhanced features.

[0030] Further, the loss function comprises a loss of the original mathematical question features and a target, a loss of the enhanced mathematical question features and the target, and a loss of a constraint target, and the total loss function expression is as follows:

[0031] L=L ori +L mix +β·L con (2)

[0032] wherein, the loss of the original mathematical question features and the target is L ori , the loss of the enhanced mathematical question features and the target is L mixTo enhance the loss of the mathematical question features and the target, beta is the loss weight of the constraint target L con .

[0033] Further, the loss of the original mathematical question features and the target, and the enhanced loss of the mathematical question features and the target are negative log-likelihood loss functions, wherein the expression of the loss of the original mathematical question features and the target is:

[0034] L ori = -∑ (Y,X)∈D log(P θ (Y|X)) (3.1)

[0035] The expression of the enhanced loss of the mathematical question features and the target is:

[0036] L mix = -∑ (Y,X)∈D log(P' θ (Y|X)) (3.2)

[0037] Wherein, X is input data, Y is the target expression tree corresponding to the input data to be generated, theta is the parameter of the entire network structure, P θ (Y|X) is the predicted output probability distribution of the original mathematical question features, and P' θ (Y|X) is the predicted output probability distribution of the enhanced mathematical question features.

[0038] Further, the loss of the constraint target is the symmetric Kullback-Leibler divergence, and the expression of the loss of the constraint target is:

[0039]

[0040] Wherein, X is input data, Y is the target expression tree corresponding to the input data to be generated, P θ (Y|X) is the predicted output probability distribution of the original mathematical question features, and P' θ (Y|X) is the predicted output probability distribution of the enhanced mathematical question features, stopgrad(·) represents the gradient stopping strategy, and D kl (·,·) represents the calculation of the symmetric Kullback-Leibler divergence.

[0041] The second aspect of the present application provides a mathematical question data enhancement system based on semantic retrieval, which comprises a memory and a processor, the memory comprises a mathematical question data enhancement method based on semantic retrieval program, and the mathematical question data enhancement method based on semantic retrieval program is executed by the processor to realize the steps of the mathematical question data enhancement method based on semantic retrieval.

[0042] Compared with the prior art, the technical scheme of the present application has the following advantages:

[0043] The application can generate mathematical problems similar to the original data in semantics by semantic retrieval, without directly enhancing the input data, but enhancing the feature level of the input data. Through the introduction of moderate disturbance and change, the model not only learns the characteristics of the original problem, but also learns the characteristics of other related problems, effectively expanding the diversity of the data set and improving the adaptability of the model to different types of problems. In addition, the application mixes and enhances the data at the high-level representation level, i.e. the feature level of the problem, and does not depend on the specific language of the text sequence, but focuses on the logical structure implied by the question. It is not only suitable for geometry problems that require spatial geometry reasoning and application problems that require actual situation understanding, but also can cross language barriers and is also suitable for Chinese and English mathematical problems. BRIEF DESCRIPTION OF DRAWINGS

[0044] In order to make the purpose, technical scheme of the application more clear, the application provides the following drawings and makes the following description:

[0045] Figure 1 The method flowchart provided for the embodiment of the application;

[0046] Figure 2 The semantic retrieval and mixed enhancement process diagram provided for the embodiment of the application. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical scheme of the application more clear, the application provides the following drawings and makes the following description:

[0048] In the following description, many specific details are set forth in order to provide a thorough understanding of the application, but the application can also be implemented in other ways different from those described herein, therefore, the scope of protection of the application is not limited by the specific embodiments disclosed below.

[0049] Embodiment 1:

[0050] The application provides a mathematical problem data enhancement method based on semantic retrieval, as shown in Figure 1 The method flowchart of the mathematical problem data enhancement method based on semantic retrieval is shown in the figure, and the specific steps are as follows:

[0051] The Chinese mathematical geometry question in this embodiment is selected from a data set GeoQA, and the GeoQA has 4998 questions. A text example of the selected geometry question is: {“Problem”: “As shown in the figure, in triangle ABC, it is known that ∠A = 80°, ∠B = 60°, DE / / BC, then the size of ∠CED is ( ) A. 40° B. 60° C. 120° D. 140°”, “answer”: “D”}.

[0052] To demonstrate the cross-language function, an English application question is selected from the MAWPS data set, and an example is: {“Problem”: “Mary is baking a cake. The recipe wants 8 cups of flour. She already put in 2 cups. How many cups does she need to add?”, “answer”: “6”}.

[0053] S1: Load the mathematical question data set, and use the preset neural network model encoder to calculate the features of each mathematical question, and output the original mathematical question feature set;

[0054] The specific process is as follows:

[0055] The embedding layer is used to convert each word in the mathematical question text into a word embedding vector;

[0056] The converted word embedding vector sequence is input into the encoder to output a hidden state sequence;

[0057] The last hidden state of the hidden state sequence is taken as the feature output of the mathematical question text.

[0058] Suppose the input data set is N is the size of the data set, and a single question text can be represented as The question text is first subjected to the embedding layer to obtain each word x j The corresponding word embedding is then subjected to the encoder to obtain a hidden state sequence. The last hidden state of the hidden state sequence is taken as the feature of the question text, denoted as h i . After the above operation is performed on each question text, the original mathematical question feature set Each mathematical question feature h i has the same length.

[0059] S2: For a mathematical question feature in the set, the most similar mathematical question feature in the entire feature set is selected through calculation of semantic similarity, and the filtered mathematical question feature is obtained;

[0060] The specific process is as follows:

[0061] select each mathematical question feature from the original feature set as a target mathematical question feature in sequence;

[0062] calculate the similarity distance between the mathematical question feature and other mathematical question features in the original feature set;

[0063] compare all the calculated distance values, filter out the mathematical question feature with the smallest distance from the target mathematical question feature, and obtain the filtered mathematical question feature.

[0064] For each mathematical question feature h i , calculate the distance between it and other mathematical question features in the feature set, where the distance calculation is shown in expression (5). Compare the sizes of the N-1 distances, and select the other mathematical question feature h i with the smallest distance from h s , denoted as the similar mathematical question feature.

[0065]

[0066] where cosine(·,·) represents the cosine similarity between the two, which is equal to the dot product of the two vectors divided by the product of the lengths of the two vectors.

[0067] By calculating the distance between two mathematical question features, the distance calculation formula here can be cosine distance, Euclidean distance, etc. If the distance between two mathematical question features is smaller, it means that the directions of the two in the hidden space are more consistent, and the similarity between the two is higher. For each mathematical question feature, filter out the other mathematical question feature with the highest similarity in the entire original feature set.

[0068] Through semantic retrieval, the input data is not directly enhanced, but the feature level of the input data is enhanced, which can generate mathematical questions similar in semantics to the original data. By introducing moderate disturbance and changes, the model not only learns the features of the original problem, but also learns the features of other related problems, effectively expanding the diversity of the data set and improving the model's adaptability to different types of problems.

[0069] S3: mix the original mathematical question feature and the filtered mathematical question feature to obtain the enhanced mathematical question feature;

[0070] The specific process is as follows:

[0071] A binary mask and another binary mask opposite to it bit by bit are generated; a mixing ratio coefficient is randomly generated to determine whether each part of the original mathematical question feature is mixed with the corresponding similar mathematical question feature part. A binary mask M and another binary mask M' opposite to M bit by bit are generated. M and M' are composed of 0 and 1, and the number of 0 and 1 is random. M is used to select part of the information in the original mathematical question feature to mix with the corresponding part of the similar mathematical question feature, 1 indicating that the part is selected for mixing, and 0 indicating that the part is not mixed. M' is used to retain the information in the original mathematical question feature except the part to be mixed.

[0072] According to the mixing ratio coefficient and the binary mask, the original mathematical question feature and the screened mathematical question feature are mixed to obtain an enhanced mathematical question feature. If a part of the original mathematical question feature is to be mixed with the similar mathematical question feature, the mixing ratio is operated. A mixing ratio coefficient a is generated, which is a random number between 0 and 1. The mixing ratio of the original mathematical question feature and the similar mathematical question feature is a: (1-a), and the two binary masks M and M' and the random number a are substituted into expression (6) to obtain the enhanced mathematical question feature h' i . For each mathematical question feature h i , the above operation is performed, and an enhanced mathematical question feature set As shown in Figure 2 . The expression of a single mathematical question feature is:

[0073] h′ i = a·M·h i +(1-a)·M·h s +M′·h i (6)

[0074] Wherein, a is a mixing ratio coefficient, M and M' are binary masks, h i is a certain original mathematical question feature, h s is the similar mathematical question feature with the smallest distance from h i , and h′ i is the enhanced mathematical question feature corresponding to h i and h s . The present application mixes and enhances at the high-level representation level of data, i.e. the feature level of the question, and is not dependent on the specific language of the text sequence, but focuses on the logical structure implied by the question, and is not only suitable for geometric questions requiring spatial geometric reasoning and application questions requiring actual situation understanding, but also can cross language barriers and is suitable for Chinese and English mathematical questions.

[0075] S4: input the original mathematical question features and the enhanced mathematical question features into a preset neural network model decoder to obtain a structured solution of the mathematical question;

[0076] The preset neural network model is a GTS model or an NGS model. The encoder and the decoder of the GTS model are used when processing an English application question. The encoder and the decoder of the NGS model are used when processing a Chinese geometry question. In this example, the GTS model is adopted to directly generate an expression tree in a target-driven manner. The enhanced mathematical question feature set H' and the original mathematical question feature set H are input into the GTS model. The GTS model first initializes a target vector of a root node according to the mathematical question features, then decomposes the target, encodes a sub-tree using a recurrent neural network, and finally generates an expression tree. The enhanced mathematical question feature set H' and the original mathematical question feature set H are respectively denoted as Y' gen and Y gen after being output by the GTS model, so as to obtain a structured solution of the mathematical question.

[0077] It should be noted that the output of the GTS model is an executable program or an expression, and the result of the mathematical question can be calculated according to the executable program or the expression.

[0078] S5: repeat the above process, iteratively train the parameters of the encoder, the decoder and the hybrid enhancement process using a loss function with a gradient stopping strategy, minimize the semantic difference between the original features and the enhanced features, and obtain an optimized mathematical question and its solution.

[0079] The specific process is as follows:

[0080] The original mathematical question features and the enhanced mathematical question features are respectively input into the decoder to obtain respective prediction output probability distributions. The decoder adopts an LSTM. The enhanced mathematical question feature set H' obtained by the expression (6) and the original mathematical question feature set H of step S1 are respectively input into the decoder, and finally pass through a linear layer to obtain respective prediction probability distributions P' θ (Y|X) and P θ (Y|X), and θ is the parameter of the entire network structure.

[0081] A constraint target is defined. The semantic difference between the original features and the enhanced features is measured by calculating the symmetric Kullback-Leibler (KL) divergence between the two prediction output probability distributions. The target of the enhanced mathematical question feature set H' and the original mathematical question feature set is the same. The two path networks can be approximately regarded as two different model networks. A constraint target is constructed using the symmetric KL divergence, and the expression is as follows:

[0082]

[0083] Where X represents the input data, Y represents the target expression tree to be generated corresponding to the input data, θ represents the parameters of the entire network structure, and P... θ (Y|X) represents the predicted output probability distribution of the original mathematical problem features, P′ θ (Y|X) represents the predicted output probability distribution for enhancing the features of the math problem, stopgrad(·) represents the gradient stopping strategy, and D kl (·,·) denotes the calculation of symmetric KL divergence.

[0084] Introducing a gradient stopping strategy can prevent model instability during optimization. Training is performed using a negative log-likelihood loss function, and the loss between the original mathematical problem features and their target, the loss between the enhanced mathematical problem features and their target, and the loss weights of the constraint target are combined to minimize the semantic difference between the original features and the enhanced features.

[0085] Assume the input dataset is X i For input data, Y i This is the target expression tree for the problem. The model's task loss is the negative log-likelihood of the entire dataset. The expression for the loss between the original mathematical problem features and the target is:

[0086] L ori =-Σ (Y,X)∈D log(P θ (Y|X)) (8.1)

[0087] The expression for the loss that enhances the features of the mathematical problem and the objective is:

[0088] L mix =-Σ (Y,X)∈D log(P′ θ (Y|X)) (8.2)

[0089] Where X represents the input data, Y represents the target expression tree to be generated corresponding to the input data, θ represents the parameters of the entire network structure, and P... θ (Y|X) represents the predicted output probability distribution of the original mathematical problem features, P′ θ (Y|X) represents the predicted output probability distribution for enhancing the features of mathematical problems.

[0090] The constraint objective is constructed using symmetric KL divergence, as shown in expression (8).

[0091]

[0092] Where X represents the input data, Y represents the target expression tree to be generated corresponding to the input data, and P represents the target expression tree to be generated. θ (Y|X) represents the predicted output probability distribution of the original mathematical problem features, P′ θ(Y|X) is the prediction output probability distribution of enhanced mathematical question features, stopgrad(·) represents a gradient stopping strategy, and the gradient stopping strategy is introduced when calculating the symmetric KL divergence, which can prevent the model from collapsing. kl (·, ·) represents the calculation of symmetric KL divergence.

[0093] As shown in expression (9), the total training target is composed of three parts.

[0094] L = L ori + L mix + β·L con (10)

[0095] Wherein, L ori is the loss of the original mathematical question features and the target, L mix is the loss of the enhanced mathematical question features and the target, and β is the loss weight of the constraint target L con , and the value of β is 0.01.

[0096] The loss function is used to train the parameters of the encoder, the decoder and the hybrid enhancement process, and the semantic difference between the original features and the enhanced features is minimized. In this embodiment, the Chinese mathematical geometry question is finally output as an executable program: “Program”: “g_minus, C_3, N_0, N_1, g_minus, C_3, _0”, and the answer of the question is calculated as the value 140.0 by executing the program; the English application question is finally output as an expression: “Equation”: “-8.0 2.0”, and the answer of the question is calculated as the value 6.0 by executing the expression.

[0097] Embodiment 2:

[0098] The embodiment provides a mathematical question data enhancement system based on semantic retrieval, comprising a memory and a processor, the memory comprises a mathematical question data enhancement method based on semantic retrieval, and the mathematical question data enhancement method based on semantic retrieval is implemented when the processor executes the steps of the mathematical question data enhancement method based on semantic retrieval in embodiment 1.

[0099] Obviously, the above embodiments of the application are only examples for clearly illustrating the application, and are not intended to limit the implementation manner of the application. Based on the above description, other different forms of changes or variations can be made by those skilled in the art. Here, all the implementation manners are not required or can not be exhausted. Any modification, equivalent replacement and improvement made within the spirit and principle of the application should be included in the protection scope of the claims of the application.

Claims

1. A data augmentation method for mathematical problems based on semantic retrieval, characterized in that, Includes the following steps: Load the math problem dataset, use a pre-defined neural network model encoder to calculate the features of each math problem, and output the original set of math problem features. For a mathematical problem feature in the set, the semantic similarity is calculated to select another mathematical problem feature that is most similar to it in the entire feature set, and the selected mathematical problem feature is obtained. The original mathematical problem features are combined with the filtered mathematical problem features to enhance them, resulting in enhanced mathematical problem features. The original and enhanced features of the mathematical problem are input into a preset neural network model decoder to obtain a structured solution to the mathematical problem. Repeat the above process, using a loss function with a gradient stopping strategy to iteratively train the parameters of the encoder, decoder, and hybrid augmentation process, minimizing the semantic difference between the original features and the augmented features, to obtain the optimized mathematical problem and its solution; The hybrid enhancement method includes the following steps: Generate a first binary mask and a second binary mask that is bitwise inverse of the first binary mask; randomly generate a mixing scaling factor; Based on the mixing ratio coefficient, the first binary mask, and the second binary mask, the original mathematical problem features and the filtered mathematical problem features are mixed to obtain the enhanced mathematical problem features, expressed as follows: h′ i =α·M·h i +(1-α)·M·h s +M′·h i (1) Where α is the mixing ratio coefficient, M and M′ are both binary masks, α∈[0,1], h i For a certain original mathematical problem, h s Is with h i Characteristics of similar mathematical problems with minimum distance, h′ i for h i and h s Corresponding enhanced mathematical problem features; The training process, which utilizes a loss function with a gradient stopping strategy, includes the following steps: The original and enhanced mathematical problem features are input into the decoder to obtain their respective predicted output probability distributions. By combining the gradient stopping strategy and the respective predicted output probability distributions, the parameters of the encoder, decoder, and hybrid augmentation process are trained using a loss function to minimize the semantic difference between the original features and the augmented features.

2. The mathematical problem data augmentation method based on semantic retrieval according to claim 1, characterized in that, The features of each math problem are calculated using a pre-defined neural network model encoder, including the following steps: The embedding layer is used to convert each word in the math problem text into a word embedding vector; The converted word embedding vector sequence is input into the encoder, and the output is the hidden state sequence; Take the last hidden state in the hidden state sequence as the feature output of the math problem text.

3. The mathematical problem data augmentation method based on semantic retrieval according to claim 1, characterized in that, The method for selecting the most similar math problems based on their characteristics includes the following steps: Each mathematical problem feature is selected sequentially from the original feature set as the target mathematical problem feature; Calculate the similarity distance between the features of this math problem and other features of math problems in the original feature set; By comparing all the calculated distance values, the mathematical problem features with the smallest distance to the target mathematical problem features are selected, and the filtered mathematical problem features are obtained.

4. The mathematical problem data augmentation method based on semantic retrieval according to claim 1, characterized in that, The preset neural network model is either a GTS model or an NGS model. When processing English word problems, the encoder and decoder of the GTS model are used; when processing Chinese geometry problems, the encoder and decoder of the NGS model are used.

5. The mathematical problem data augmentation method based on semantic retrieval according to claim 1, characterized in that, The loss function includes: the loss between the original mathematical problem features and the target, the loss between the enhanced mathematical problem features and the target, and the loss for the constrained target. The overall loss function expression is as follows: L=L ori +L mix +β·L con (2) Among them, L ori For the loss of features and objectives of the original mathematical problem, L mix To enhance the loss between the characteristics of the mathematical problem and the objective, β represents the constraint objective L. con The loss weight.

6. The mathematical problem data augmentation method based on semantic retrieval according to claim 5, characterized in that, The loss between the original mathematical problem features and the target, and the loss between the enhanced mathematical problem features and the target, are both negative log-likelihood loss functions. The expression for the loss between the original mathematical problem features and the target is: L ori =-∑ (Y,X)∈D log(P θ (Y|X)) (3.1) Where D is the input dataset; The expression for the loss that enhances the features of the mathematical problem and the objective is: L mix =-∑ (Y,X)∈D log(P θ ′ (Y|X)) (3.2) Where X represents the input data, Y represents the target expression tree to be generated corresponding to the input data, θ represents the parameters of the entire network structure, and P... θ (Y|X) represents the predicted output probability distribution of the original mathematical problem features, P θ ′ (Y|X) represents the predicted output probability distribution for enhancing the features of mathematical problems.

7. A method for data augmentation of mathematical problems based on semantic retrieval according to claim 5, characterized in that, The loss of the constrained objective is the symmetric Kullback-Leibler divergence, and the expression for the constrained objective loss is: Where X represents the input data, Y represents the target expression tree to be generated corresponding to the input data, and P represents the target expression tree to be generated. θ (Y|X) represents the predicted output probability distribution of the original mathematical problem features, P θ ′ (Y|X) represents the predicted output probability distribution for enhancing the features of the math problem, stopgrad(·) represents the gradient stopping strategy, and D kl (·,·) denotes the calculation of the symmetric Kullback-Leibler divergence.

8. A mathematical problem data augmentation system based on semantic retrieval, characterized in that, The system includes a memory and a processor. The memory includes a program for a mathematical problem data augmentation method based on semantic retrieval. When the program for the mathematical problem data augmentation method based on semantic retrieval is executed by the processor, it implements the steps of a mathematical problem data augmentation method based on semantic retrieval as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • A Data Augmentation Method for Chinese Mathematical Word Problems Based on Reverse Operations

    CN113095045B

  • Grammar dependence enhanced mathematical application question semantic recognition and reasoning method and system

    CN112613323A

  • Automatic problem solving method for plane geometry mathematical problem

    CN116028888A