Test question text matching method and device, electronic equipment and storage medium

CN115759034BActive Publication Date: 2026-09-11IFLYTEK SOUTH CHINA ARTIFICIAL INTELLIGENCE RES INST GUANGZHOU CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211485750.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-24
Publication Date
2026-09-11
Estimated Expiration
2042-11-24

AI Technical Summary

Technical Problem

[0004]本发明提供一种试题文本匹配方法、装置、电子设备和存储介质,用以解决现有技术中试题文本中存在多个公式的情况下的文本匹配可靠性差的缺陷

Benefits of technology

[0039]本发明提供的试题文本匹配方法、装置、电子设备和存储介质,通过对试题文本中各公式的公式操作树进行合并和图编码,得到能够表征试题文本所包含的所有公式自身的信息以及公式之间关联的全局公式特征,据此进行文本匹配,能够避免由于公式顺序不一致导致匹配失败的问题,提高文本匹配的可靠性和合理性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115759034B_ABST
    Figure CN115759034B_ABST
Patent Text Reader

Abstract

The application provides a test question text matching method and device, electronic equipment and a storage medium, wherein the method comprises: obtaining a test question text to be matched, analyzing each formula in the test question text to obtain a formula operation tree corresponding to each formula respectively; merging the formula operation trees corresponding to each formula respectively to obtain a global operation tree of the test question text; performing graph coding on the global operation tree to obtain a global formula feature of the test question text; and performing text matching on the test question text based on the global formula feature. The method, device, electronic equipment and storage medium provided by the application can merge and perform graph coding on the formula operation trees of each formula in the test question text, obtain the global formula feature capable of representing the information of all formulas contained in the test question text and the correlation between the formulas, and perform text matching based on the global formula feature, so that the problem of matching failure caused by inconsistent formula order can be avoided, and the reliability and rationality of text matching are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, and in particular to a test text matching method, apparatus, electronic device, and storage medium. Background Technology

[0002] The rapid development of text classification technology has made automated test grading possible. Based on text classification technology, the degree of matching between student answers and standard answer texts can be determined, thereby obtaining the student's graded score.

[0003] However, current automated test grading solutions are not ideal for matching calculation problems that contain a large number of mathematical formulas. Although there are methods to extract and encode mathematical formulas individually from the text, these methods cannot capture the relationships between formulas when multiple formulas exist in the text. Matching is only successful when the order in which the formulas are applied in the student's answer matches the order in the standard answer, thus reducing the accuracy and reliability of test grading. Summary of the Invention

[0004] This invention provides a test question text matching method, apparatus, electronic device, and storage medium to address the shortcomings of poor text matching reliability in the prior art when test question text contains multiple formulas.

[0005] This invention provides a test question text matching method, comprising:

[0006] Obtain the test question text to be matched, parse each formula in the test question text, and obtain the formula operation tree corresponding to each formula;

[0007] The formula operation trees corresponding to each formula are merged to obtain the global operation tree of the test question text;

[0008] Graph encoding is performed on the global operation tree to obtain the global formula features of the test question text;

[0009] Based on the global formula features, text matching is performed on the test question text.

[0010] According to a test question text matching method provided by the present invention, the step of merging the formula operation trees corresponding to each formula to obtain a global operation tree for the test question text includes:

[0011] Based on the common variable nodes among the various formula operation trees, the various formula operation trees are merged to obtain an initial operation tree;

[0012] The root node of each formula operation tree in the initial operation tree is added to the solution result in the question text to obtain the global operation tree.

[0013] According to a test question text matching method provided by the present invention, the step of performing text matching on the test question text based on the global formula features includes:

[0014] Based on the operation tree features of the operation trees corresponding to each formula, the test text is sequence encoded to obtain the sequence features of the test text;

[0015] Based on the sequence features and the global formula features, text matching is performed on the test question text.

[0016] According to a test question text matching method provided by the present invention, the step of performing sequence encoding on the test question text based on the operation tree features of the operation trees corresponding to each formula to obtain the sequence features of the test question text includes:

[0017] Obtain the word segmentation sequence of the test question text;

[0018] Based on the operation tree features of the operation tree corresponding to each formula, the encoding features of each formula in the word segmentation sequence are replaced to obtain the replaced word segmentation sequence;

[0019] Sequence encoding is performed on the replaced word segmentation sequence to obtain the sequence features of the test question text.

[0020] According to a test question text matching method provided by the present invention, the step of performing text matching on the test question text based on the sequence features and the global formula features includes:

[0021] Based on the correlation between the sequence features of the two test question texts, information interaction is performed on the sequence features of the two test question texts to obtain interactive sequence features;

[0022] Based on the correlation between the global formula features of the two test question texts, information exchange is performed on the global formula features of the two test question texts to obtain interactive global features;

[0023] Based on the interaction sequence features and the interaction global features, text matching is performed on the two test question texts.

[0024] According to a test question text matching method provided by the present invention, the step of performing graph encoding on the global operation tree to obtain the global formula features of the test question text includes:

[0025] Based on the text features of each node in the global operation tree and the node type features of each node, the initial features of each node are determined. The node type features are used to indicate that the node belongs to any one of operator nodes, variable nodes, and numeric nodes.

[0026] Based on the initial features of each node, graph encoding is performed on the global operation tree to obtain the global formula features of the test question text.

[0027] According to a test question text matching method provided by the present invention, the step of obtaining the test question text to be matched includes:

[0028] The standard answer text and the student's answer text are used as the test question text respectively;

[0029] The text matching of the test question text is followed by:

[0030] Based on the text matching results, the score corresponding to the student's answer text is determined.

[0031] The present invention also provides a test question text matching device, comprising:

[0032] The formula parsing unit is used to obtain the test question text to be matched, parse each formula in the test question text, and obtain the formula operation tree corresponding to each formula.

[0033] The merging unit is used to merge the formula operation trees corresponding to each formula to obtain the global operation tree of the test question text.

[0034] The graph encoding unit is used to perform graph encoding on the global operation tree to obtain the global formula features of the test question text;

[0035] The matching unit is used to perform text matching on the test question text based on the global formula features.

[0036] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the test text matching method as described above.

[0037] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the test text matching method as described above.

[0038] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the test text matching method as described above.

[0039] The test question text matching method, apparatus, electronic device, and storage medium provided by this invention merge and graph encode the formula operation trees of each formula in the test question text to obtain global formula features that can characterize the information of all formulas contained in the test question text and the relationships between formulas. Based on this, text matching can avoid the problem of matching failure due to inconsistent formula order, and improve the reliability and rationality of text matching. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0041] Figure 1 This is one of the schematic diagrams of the formula operation tree provided by the present invention;

[0042] Figure 2 This is the second schematic diagram of the formula operation tree provided by the present invention;

[0043] Figure 3 This is a flowchart illustrating the test text matching method provided by the present invention;

[0044] Figure 4 This is one of the schematic diagrams of the merging process of the formula operation tree provided by the present invention;

[0045] Figure 5 This is the second schematic diagram of the merging process of the formula operation tree provided by the present invention;

[0046] Figure 6 This is a flowchart illustrating step 340 in the test text matching method provided by the present invention;

[0047] Figure 7 This is a flowchart illustrating the test paper grading method provided by the present invention;

[0048] Figure 8 This is a schematic diagram of the test question text matching device provided by the present invention;

[0049] Figure 9 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0051] Current automated test grading solutions are not performing well in matching calculation problems that contain a large number of mathematical formulas. Related technologies, particularly those classifying plain text, encode formulas directly as part of the text sequence, losing the structural information of the formulas and thus failing to adequately understand the semantics of the text.

[0052] In related technologies, for cases where formulas exist in text, the mathematical formulas are extracted and encoded separately, and then replaced with special symbols to achieve text encoding. For example, the original text is:

[0053] The height the ball falls to at the end of the 2nd second: h = \frac{1}{2}g{t}^{2} = \frac{1}{2} \times 10 \times {2}^{2}m = 20m,

[0054] Gravitational potential energy: {E}_{P}=-mgh=-0.2\\times 10\\times 20J=-40J.

[0055] The converted text obtained by replacing the formula with the special symbol

MATH

[0056] The height the ball falls to at the end of the 2nd second: h = [MATH_1] = \frac{1}{2}\times10\times{2}^{2}m = 20m,

[0057] Gravitational potential energy: {E}_{P}=

MATH_2

[0058] Formulas [MATH_1] and [MATH_2] can be parsed, and their corresponding operation trees can be constructed, such as... Figure 1 and 2 As shown. For example, in formula [MATH_1], frac{1}{2} corresponds to Figure 1 The numerical node "1 / 2" in the text corresponds to {t}^{2}. Figure 1The system contains a numeric node "2", a variable node "t", and a symbol node "^", with the numeric node "2" and the variable node "t" connected to the symbol node "^".

[0059] Based on this, the formula operation tree can be encoded, and special symbols in the transformed text can be replaced to perform text sequence encoding.

[0060] However, when there are multiple formulas in the text, the above method cannot obtain the relationship between the formulas. It can only match successfully when the order of the formulas used by the student in the answer is consistent with the order of the formulas used in the standard answer, which reduces the accuracy and reliability of the test grading.

[0061] To address the aforementioned issues, embodiments of the present invention provide a test question text matching method for performing text matching on test question texts containing formulas, thereby enabling intelligent teaching applications such as similar question recommendation and automated grading.

[0062] Figure 3 This is a flowchart illustrating the test text matching method provided by the present invention, as shown below. Figure 3 As shown, the method includes:

[0063] Step 310: Obtain the test question text to be matched, parse each formula in the test question text, and obtain the formula operation tree corresponding to each formula.

[0064] Here, the test question text to be matched can be the question text, the answer text, or the analysis text. This embodiment of the invention does not specifically limit this.

[0065] Understandably, to achieve test question text matching, the number of test question texts to be matched is at least two, meaning there are two or more test question texts, and all test question texts used for matching are of the same type. For example, in an automated test question grading scenario, there can be a standard answer text and one or more student answer texts as test question texts. By matching the standard answer text with each student answer text, the score of each student answer text can be obtained. As another example, in a similar test question recommendation scenario, the parsing text of a benchmark test question and the parsing texts of one or more candidate test questions that may be used for test question recommendation can be selected as test question texts. By matching the parsing text of the benchmark test question with the parsing text of each candidate test question, test questions similar to the benchmark test question can be obtained for recommendation.

[0066] For multiple question texts to be matched, the formula operation tree for each formula under each question text can be obtained separately. It should be noted that the formula parsing and formula operation tree construction for the question text are performed independently for each individual question text, and the question texts are not related to each other.

[0067] For any given test question text, all formulas contained within it can be extracted. Then, for each formula, formula parsing is performed to determine the numerical values, variables, and symbols within the formula, as well as the relationships between these values, variables, and symbols. This allows the construction of the corresponding Operator Tree (OPT). See also... Figure 1 , Figure 2 The formula operation tree includes three types of nodes: numerical nodes, variable nodes, and symbol nodes. Both data nodes and variable nodes are connected to symbol nodes to enable symbol-based operations.

[0068] Step 320: Merge the formula operation trees corresponding to each formula to obtain the global operation tree of the test question text.

[0069] Considering that there may be logical connections between the formulas in a test question text, such as the value obtained by formula one being able to be substituted into the variable of formula two, for any test question text, the formula operation trees corresponding to all formulas in that test question text can be merged to obtain a global operation tree that can reflect the structural information of all formulas in that test question text, as well as the connections between all formulas.

[0070] Here, the merging of formula operation trees can be based on whether there are common variable nodes among the various formula operation trees. For example... Figure 4 This is one of the schematic diagrams of the merging process of the formula operation tree provided by the present invention, such as... Figure 4 As shown, each question text includes two formulas, and the formula operation diagrams for the two formulas correspond to... Figure 1 and Figure 2 Understandable Figure 1 The diagram showing the formula operation is intended to solve for the height h, while Figure 2 In the diagram showing the formula operation, h is the variable required to solve for the gravitational potential energy E. Therefore, it is possible to... Figure 1 and Figure 2 The shown formula operation tree is merged and applied. Figure 1 The formula operation tree replacement shown Figure 2 The variable node "h" in the tree is used to obtain the global operation tree.

[0071] Step 330: Perform graph encoding on the global operation tree to obtain the global formula features of the test question text.

[0072] Specifically, for any given test question text, the global operation tree corresponding to that test question text not only covers the information of all formulas in the test question text in terms of formula structure and formula content, but also covers the relationships between the formulas in the test question text. In other words, the global operation tree can reflect the global information of the formulas contained in the test question text.

[0073] After obtaining the global operation tree, it can be regarded as a graph structure and graph encoded to achieve feature extraction based on the global operation tree. The features of the global operation tree are then used as the global formula features of the test text. Here, the global formula features are used to represent the global features of all formulas contained in the test text.

[0074] Step 340: Based on the global formula features, perform text matching on the test question text.

[0075] Specifically, global formula features can reflect the global features of all formulas contained in the test question text. Based on this, text matching can be performed for different test question texts. In this process, text matching for different test question texts can be achieved by performing feature matching on the global formula features of each test question text, or by performing feature matching on the global formula features and the text features of each test question text. This embodiment of the invention does not specifically limit this approach.

[0076] Furthermore, the matching results obtained from text matching can be used to implement functions such as automated grading and similar question recommendation. For example, in the scenario of automated question grading, text matching can be performed between the standard answer text and each student's answer text based on the global formula features of the standard answer text and the global formula features of each student's answer text. Based on the matching degree between each student's answer text and the standard answer text, the score of each student's answer text can be determined. Similarly, in the scenario of similar question recommendation, text matching can be performed between the parsing text of the benchmark question and the parsing text of each candidate question based on the global formula features of the parsing text of the benchmark question and the parsing text of each candidate question. Based on the matching degree of each candidate question relative to the benchmark question, questions similar to the benchmark question can be selected from the candidate questions for recommendation.

[0077] The method provided in this invention merges and graph-encodes the formula operation trees of each formula in the test question text to obtain global formula features that can characterize all the formulas contained in the test question text as well as the relationships between the formulas. Based on this, text matching can be performed, which can avoid the problem of matching failure due to inconsistent formula order and improve the reliability and rationality of text matching.

[0078] In real-world matching scenarios, especially in automated test grading, even if the student's answer approach is consistent with the standard answer, the formulas in the student's answer may not be exactly the same as those in the standard answer. For example, in the formulas [MATH_1] and [MATH_2] above, if the student directly substitutes the calculation formula for height h or the calculated value of h when solving for gravitational potential energy E, the resulting formula will not be consistent with the "-mgh" indicated in formula [MATH_2] in the standard answer, which may lead to misjudgment.

[0079] To address this issue, based on the above embodiments, step 320 includes:

[0080] Based on the common variable nodes among the various formula operation trees, the various formula operation trees are merged to obtain an initial operation tree;

[0081] The root node of each formula operation tree in the initial operation tree is added to the solution result in the question text to obtain the global operation tree.

[0082] Specifically, in the process of merging the formula operation trees for each formula, it is not only necessary to perform the specific merging operation, but also to introduce the solution results of each variable node in the test text as a supplement after the merging is completed, so as to avoid the problem of matching failure due to inconsistent formula writing.

[0083] Here, for merging the formula operation trees of each formula, we can traverse each formula and its formula operation tree in the question text, check whether there is a variable that the previous formula is looking for in the current formula, that is, whether there is a common variable node between the current formula and the previous formula. If there is, the formula operation tree corresponding to the previous formula is merged into the formula operation tree corresponding to the current formula, and then the formula operation tree corresponding to the current formula is stored, until the formula operation trees of all formulas are traversed, and the merged formula operation tree is used as the initial operation tree.

[0084] Furthermore, during the merging of formula operation trees, the root node of each formula operation tree can be recorded. This root node corresponds to the solution variable of the formula within that operation tree. Therefore, based on the root nodes recorded during the merging process, it is possible to determine which nodes in the initial merged operation tree correspond to solutions found in the question text.

[0085] For the root nodes of each formula operand in the initial operation tree, the corresponding solution results can be found in the question text and added as nodes to the initial operation tree, thus obtaining the global operation tree. The solution results here can include the variable being calculated by the formula, as well as the specific value of the variable. Adding the solution results to the global operation tree makes the representation of variables more diverse and the logical connections between formulas clearer. Based on the global operation tree with the added solution results, global formula features are extracted, and text matching is performed based on these features. This allows for text matching compatible with different formula expressions under the same solution approach, thus better ensuring the reliability and accuracy of text matching.

[0086] Furthermore, for the global operation tree, identical leaf nodes, such as identical numerical nodes or identical variable nodes, can be merged, thereby further improving the global operation tree's ability to express the relationships between formulas in the test text.

[0087] For example, Figure 5 This is the second schematic diagram of the merging process of the formula operation tree provided by the present invention, as shown below. Figure 5 As shown, the question text includes two formulas: formula [MATH_1] corresponds to formula operation tree 511, and formula [MATH_2] corresponds to formula operation tree 512. Merging formula operation trees 511 and 512 yields the initial operation tree 520. The bolded nodes in the initial operation tree 520 are the root nodes of formula operation trees 511 and 512. The solution result for formula [MATH_1] in formula operation tree 511 is h = 20m, where h is a variable and 20m is the specific value of the variable. The solution result for formula [MATH_2] in formula operation tree 512 is E = -40J, where E is a variable and -40J is the specific value of the variable.

[0088] The solution result can then be added to the initial operation tree 520, resulting in the global operation tree 530. Compared to the initial operation tree 520, the global operation tree 530 adds the solution result at the root nodes of the two formulas, specifically including the symbol node "=", as well as variable nodes and value nodes. Furthermore, compared to the initial operation tree 530, the global operation tree 530 also merges the identical leaf nodes "g".

[0089] The method provided in this invention adds the solution results in the test question text to the global operation tree, enabling the global operation tree to construct the relationship between all variables in the test question text and include the final results of all variables. This allows for finer-grained interaction between formulas in different test question texts during text matching, thereby alleviating the problem of text-level alignment difficulties caused by inconsistent solution ideas and order, and thus better ensuring the reliability and accuracy of text matching.

[0090] Based on any of the above embodiments Figure 6 This is a flowchart illustrating step 340 of the test text matching method provided by the present invention, as shown below. Figure 6 As shown, step 340 includes:

[0091] Step 341: Based on the operation tree features of the formula operation trees corresponding to each formula, sequence encoding is performed on the test question text to obtain the sequence features of the test question text;

[0092] Step 342: Based on the sequence features and the global formula features, perform text matching on the test question text.

[0093] Specifically, when performing text matching on test question texts, not only the global formula features of the test question texts can be referenced, but also the sequence features of the test question texts. Here, the sequence features of the test question texts can be understood as the features obtained by encoding the word segmentation sequence corresponding to the test question texts, and the sequence features can reflect the semantics of the test question texts.

[0094] Considering that formulas are part of the test text, in order to ensure that the sequence features representing the semantics of the test text carry the semantic and structural information of the formulas themselves, after obtaining the formula operation trees of each formula in the test text, feature encoding can be performed on the formula operation trees of each formula to obtain the operation tree features of each formula operation tree. Then, the operation tree features of each formula in the test text are applied to the sequence encoding of the test text, thereby ensuring that the obtained sequence features can carry the semantics of the formulas themselves.

[0095] Based on any of the above embodiments, step 341 includes:

[0096] Obtain the word segmentation sequence of the test question text;

[0097] Based on the operation tree features of the operation tree corresponding to each formula, the encoding features of each formula in the word segmentation sequence are replaced to obtain the replaced word segmentation sequence;

[0098] Sequence encoding is performed on the replaced word segmentation sequence to obtain the sequence features of the test question text.

[0099] Specifically, the word segmentation sequence of the test text can be obtained by segmenting the test text. In the word segmentation process, a formula can be regarded as a word and divided. Here, for the convenience of expressing the word segmentation sequence, the formula used as a word segmentation can be replaced with a special symbol such as [MATH].

[0100] For the formula operation tree corresponding to each formula in the test text, tools such as TangentCFT can be used to encode the operation tree. Specifically, a depth-first search method can be used to traverse the formula operation tree, thereby converting the formula operation tree into a sequence text. Then, the sequence text is feature-encoded based on n-gram. Finally, the feature vectors of each word obtained by n-gram encoding are subjected to average pooling to obtain the feature representation of the entire formula operation tree, i.e., the operation tree feature.

[0101] After obtaining the operation tree features of each formula, the operation tree features of each formula can be used to replace the formulas represented by the special symbol [MATH] in the word segmentation sequence, thereby obtaining the replaced word segmentation sequence.

[0102] After feature replacement, the segmented word sequence can be sequence encoded to obtain the sequence features of the test text. This sequence encoding can be implemented using a pre-trained language model encoder, such as a Transformer-Encoder based on a self-attention mechanism.

[0103] Based on any of the above embodiments, step 342 includes:

[0104] Based on the correlation between the sequence features of the two test question texts, information interaction is performed on the sequence features of the two test question texts to obtain interactive sequence features;

[0105] Based on the correlation between the global formula features of the two test question texts, information exchange is performed on the global formula features of the two test question texts to obtain interactive global features;

[0106] Based on the interaction sequence features and the interaction global features, text matching is performed on the two test question texts.

[0107] Specifically, in the process of text matching by combining the sequence features of the test question text and the global formula features, the differences between different test question texts can be analyzed at the text level and the global formula level, thereby achieving test question text matching.

[0108] Furthermore, for two test question texts, information interaction can be performed on the sequence features of the two test question texts based on the correlation between their respective sequence features. This yields interactive sequence features that reflect the similarities and differences between the two test question texts at the textual level. Here, the correlation between the sequence features of the two test question texts can be achieved through an attention mechanism. Based on this, the information interaction can obtain features that highlight the differences between the two test question texts at the textual level.

[0109] Similarly, for two test question texts, information interaction can be performed on their global formula features based on the correlation between their respective global formula features. This yields interactive global features that reflect the similarities and differences between the two test question texts at the global formula level. Here, the correlation between the global formula features of the two test question texts can be achieved through an attention mechanism. Based on this information interaction, features that highlight the differences between the two test question texts at the global formula level can be obtained.

[0110] Once the interaction sequence features and interaction global features are obtained, it can be used to determine whether two test item texts match, or to determine the degree of matching between the two test item texts. For example, the interaction sequence features and interaction global features can be concatenated and input into a fully connected layer to obtain the degree of matching.

[0111] The method provided in this invention applies the correlation between sequence features and the correlation between global formula features to perform information interaction at the text level and the global formula level for test text, thereby capturing the similarities and differences between the test text at the text level and the global formula level, thus improving the reliability of text matching.

[0112] Based on any of the above embodiments, in step 342, the information interaction of the sequence features of the two test question texts based on the correlation between their sequence features can be achieved through a self-attention mechanism, as shown in the following formula:

[0113]

[0114] In the formula, S represents the interaction sequence feature, S S and S U The sequence features of the two test texts are W, respectively. Q W K and W V Here, d represents the learnable attention mechanism parameters, and d is the vector length of the attention mechanism parameters.

[0115] Based on any of the above embodiments, in step 342, the information interaction of the global formula features of the two test question texts based on the correlation between the global formula features of the two test question texts can be achieved through a self-attention mechanism, as shown in the following formula:

[0116]

[0117] In the formula, T represents the interactive global feature, T S and T U The global formula features of the two test question texts are W. Q W K and W V Here, d represents the learnable attention mechanism parameters, and d is the vector length of the attention mechanism parameters.

[0118] Based on any of the above embodiments, step 330 includes:

[0119] Based on the text features of each node in the global operation tree and the node type features of each node, the initial features of each node are determined. The node type features are used to indicate that the node belongs to any one of operator nodes, variable nodes, and numeric nodes.

[0120] Based on the initial features of each node, graph encoding is performed on the global operation tree to obtain the global formula features of the test question text.

[0121] Specifically, before performing graph encoding on the global operation tree, it is necessary to define the initial features of each node in the global operation tree. Compared to the traditional feature initialization method for graph nodes, the initial features of each node in the global operation tree in this embodiment of the invention not only examine the text features of the text corresponding to each node, but also refer to the node type features that characterize the node type to which each node belongs in the global operation tree. Consistent with the formula operation tree, the nodes in the global operation tree can also be divided into three types: operator nodes, variable nodes, and numerical nodes. The node type features corresponding to the node type can be randomly initialized or pre-encoded; this embodiment of the invention does not specifically limit this.

[0122] For any given node, its text features and node type features can be accumulated, concatenated, or fused in other ways to form the node's initial features. For example, the initial feature n of any node... i =e i +t i , where e i and t i These are the text features and node type features of the node, respectively.

[0123] After obtaining the initial features of each node in the global operation tree, graph encoding can be performed on the global operation tree based on these initial features. Here, image encoding of the global operation tree can be implemented using various graph encoding methods, such as GAT (Graph Attention Networks).

[0124] The method provided in this invention combines text features and node type features to construct the initial features of each node, thereby ensuring the reliability of global formula feature extraction.

[0125] Based on any of the above embodiments, in step 330, graph encoding of the global operation tree based on the initial features of each node can be achieved by the following formula:

[0126]

[0127] In the formula, n i and n j Let represent the node features of the i-th and j-th nodes in the global operation tree, respectively, and K be the number of heads in the multi-head self-attention mechanism. This indicates a concatenation and integration operation of the feature vectors obtained from the attention processes of K heads; W k N represents the weight matrix to be learned in the k-th head; i This represents the set of all adjacent nodes of the i-th node in the global operation tree.

[0128] in, Let be the attention weight value between the i-th node and the j-th node in the k-th head. It can be determined based on the following formula:

[0129]

[0130] e ij =FNN([n i ;n j ]),j∈N i

[0131] In the formula, FNN is a feedforward neural network, and σ represents the activation function.

[0132] Based on any of the above embodiments, step 310, obtaining the test question text to be matched, includes:

[0133] The standard answer text and the student's answer text are used as the test question text respectively;

[0134] In step 340, the text matching of the test question text is performed, and then the following is also included:

[0135] Based on the text matching results, the score corresponding to the student's answer text is determined.

[0136] Specifically, in automated test grading scenarios, the standard answer text and one or more student answer texts can be used as test texts. Then, the global formula features of the standard answer text and each student answer text are obtained separately. Subsequently, text matching can be performed between the standard answer text and the student answer text based on the global formula features of the standard answer text and the global formula features of any student answer text, or text matching can be performed between the standard answer text and the student answer text based on the global formula and sequence features of the standard answer text and the global formula and sequence features of any student answer text. The matching degree of the student answer text relative to the standard answer text is then used as the text matching result, and the score corresponding to the student answer text is determined based on the matching degree.

[0137] Based on any of the above embodiments Figure 7 This is a flowchart illustrating the test paper grading method provided by the present invention, as shown below. Figure 7 As shown, the method includes:

[0138] First, obtain the standard answer text and one or more student answer texts as the test question text. The student answer text can be text directly entered by the student, or it can be obtained by OCR recognition of scanned or photographed images of student exam papers, assignments, etc.

[0139] Subsequently, for each question text, formulas are extracted from the question text, and a formula operation tree is constructed based on each extracted formula.

[0140] Next, based on the operation tree features of the formula operation tree corresponding to each formula in the test question text, sequence encoding can be performed on the test question text to obtain its sequence features. Based on this, the sequence features of the standard answer text and the sequence features of the student's answer text can be exchanged to obtain interactive sequence features.

[0141] Simultaneously, the formula operation trees corresponding to each formula in the test question text can be merged to construct a global operation tree for the test question text. Then, graph encoding is performed on the global operation tree to obtain the global formula features of the test question text. Based on this, the global formula features of the standard answer text and the global formula features of the student's answer text can be exchanged for structural information, thereby obtaining interactive global features.

[0142] Finally, score regression is performed based on the interaction sequence features and interaction global features to obtain the score of the student's answer text. Specifically, score regression can be achieved by fusing the interaction sequence features and interaction global features and inputting them into a linear layer.

[0143] Furthermore, assuming the interaction sequence feature is S and the interaction global feature is T, the feature S at the [CLS] position in S can be... CLS Features obtained by mean pooling T After concatenation and input into a fully connected network, the model's predicted score is obtained through the Sigmoid function. The specific formula is as follows:

[0144]

[0145] It is understandable that the above formula extraction, formula operation tree construction, text sequence encoding, sequence information interaction, global operation tree construction and graph encoding, structural information interaction and score regression can all be achieved through a single model. This model can be trained using sample standard text and sample student answer text as samples, the scores of the sample student answer text as labels, and the mean squared error loss function.

[0146] The test grading method provided in this invention can comprehensively extract formula structure information from both the standard answer text and the student's answer text, thereby ensuring the accuracy and reliability of automated test grading and helping to reduce the workload of teachers. Furthermore, after obtaining the scores from the student's answer text, it can also combine other technologies to collect students' incorrect answers for functions such as question recommendation or related knowledge point reinforcement training.

[0147] Based on any of the above embodiments Figure 8 This is a schematic diagram of the test text matching device provided by the present invention, as shown below. Figure 8 As shown, the device includes:

[0148] Formula parsing unit 810 is used to obtain the test question text to be matched, parse each formula in the test question text, and obtain the formula operation tree corresponding to each formula.

[0149] The merging unit 820 is used to merge the formula operation trees corresponding to each formula to obtain the global operation tree of the test question text;

[0150] Graph encoding unit 830 is used to perform graph encoding on the global operation tree to obtain the global formula features of the test question text;

[0151] The matching unit 840 is used to perform text matching on the test question text based on the global formula features.

[0152] The apparatus provided in this invention merges and graph-encodes the formula operation trees of each formula in the test question text to obtain global formula features that can characterize all the formulas contained in the test question text as well as the relationships between the formulas. Based on this, text matching can be performed, which can avoid the problem of matching failure due to inconsistent formula order and improve the reliability and rationality of text matching.

[0153] Based on any of the above embodiments, the merging unit 820 is used for:

[0154] Based on the common variable nodes among the various formula operation trees, the various formula operation trees are merged to obtain an initial operation tree;

[0155] The root node of each formula operation tree in the initial operation tree is added to the solution result in the question text to obtain the global operation tree.

[0156] Based on any of the above embodiments, the matching unit 840 is used for:

[0157] Based on the operation tree features of the operation trees corresponding to each formula, the test text is sequence encoded to obtain the sequence features of the test text;

[0158] Based on the sequence features and the global formula features, text matching is performed on the test question text.

[0159] Based on any of the above embodiments, the matching unit 840 is specifically used for:

[0160] Obtain the word segmentation sequence of the test question text;

[0161] Based on the operation tree features of the operation tree corresponding to each formula, the encoding features of each formula in the word segmentation sequence are replaced to obtain the replaced word segmentation sequence;

[0162] Sequence encoding is performed on the replaced word segmentation sequence to obtain the sequence features of the test question text.

[0163] Based on any of the above embodiments, the matching unit 840 is specifically used for:

[0164] Based on the correlation between the sequence features of the two test question texts, information interaction is performed on the sequence features of the two test question texts to obtain interactive sequence features;

[0165] Based on the correlation between the global formula features of the two test question texts, information exchange is performed on the global formula features of the two test question texts to obtain interactive global features;

[0166] Based on the interaction sequence features and the interaction global features, text matching is performed on the two test question texts.

[0167] Based on any of the above embodiments, the graph encoding unit is used for:

[0168] Based on the text features of each node in the global operation tree and the node type features of each node, the initial features of each node are determined. The node type features are used to indicate that the node belongs to any one of operator nodes, variable nodes, and numeric nodes.

[0169] Based on the initial features of each node, graph encoding is performed on the global operation tree to obtain the global formula features of the test question text.

[0170] Based on any of the above embodiments, the formula parsing unit 810 is used for:

[0171] The standard answer text and the student's answer text are used as the test question text respectively;

[0172] Matching unit 840 is also used for:

[0173] Based on the text matching results, the score corresponding to the student's answer text is determined.

[0174] Figure 9 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 9 As shown, the electronic device may include a processor 910, a communication interface 920, a memory 930, and a communication bus 940, wherein the processor 910, the communication interface 920, and the memory 930 communicate with each other via the communication bus 940. The processor 910 can call logical instructions in the memory 930 to execute a test text matching method. This method includes: acquiring the test text to be matched; parsing each formula in the test text to obtain a formula operation tree corresponding to each formula; merging the formula operation trees corresponding to each formula to obtain a global operation tree of the test text; performing graph encoding on the global operation tree to obtain global formula features of the test text; and performing text matching on the test text based on the global formula features.

[0175] Furthermore, the logical instructions in the aforementioned memory 930 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0176] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the test text matching method provided by the above methods. The method includes: acquiring the test text to be matched; parsing each formula in the test text to obtain the formula operation tree corresponding to each formula; merging the formula operation trees corresponding to each formula to obtain the global operation tree of the test text; performing graph encoding on the global operation tree to obtain the global formula features of the test text; and performing text matching on the test text based on the global formula features.

[0177] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the test text matching method provided by the above methods. The method includes: acquiring test text to be matched; parsing each formula in the test text to obtain a formula operation tree corresponding to each formula; merging the formula operation trees corresponding to each formula to obtain a global operation tree of the test text; performing graph encoding on the global operation tree to obtain global formula features of the test text; and performing text matching on the test text based on the global formula features.

[0178] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0179] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0180] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A test question text matching method, characterized in that, include: Obtain the test question text to be matched, parse each formula in the test question text, and obtain the formula operation tree corresponding to each formula; Based on whether there are common variable nodes among the various formula operation trees, the formula operation trees corresponding to each formula are merged to obtain the global operation tree of the test question text. The global operation tree reflects the structural information of all formulas under the test question text and the relationship between all formulas. Graph encoding is performed on the global operation tree to obtain the global formula features of the test question text; Based on the global formula features, text matching is performed on the test question text; The step of performing graph encoding on the global operation tree to obtain the global formula features of the test question text includes: Based on the text features of each node in the global operation tree and the node type features of each node, the initial features of each node are determined. The node type features are used to indicate that the node belongs to any one of operator nodes, variable nodes, and numeric nodes. Based on the initial features of each node, graph encoding is performed on the global operation tree to obtain the global formula features of the test question text.

2. The test text matching method according to claim 1, characterized in that, The step of merging the formula operation trees corresponding to each formula to obtain the global operation tree of the test question text includes: Based on the common variable nodes among the various formula operation trees, the various formula operation trees are merged to obtain an initial operation tree; The root node of each formula operation tree in the initial operation tree is added to the solution result in the question text to obtain the global operation tree.

3. The test text matching method according to claim 1, characterized in that, The text matching based on the global formula features includes: Based on the operation tree features of the operation trees corresponding to each formula, the test text is sequence encoded to obtain the sequence features of the test text; Based on the sequence features and the global formula features, text matching is performed on the test question text.

4. The test text matching method according to claim 3, characterized in that, The step of performing sequence encoding on the test text based on the operation tree features corresponding to each formula to obtain the sequence features of the test text includes: Obtain the word segmentation sequence of the test question text; Based on the operation tree features of the operation tree corresponding to each formula, the encoding features of each formula in the word segmentation sequence are replaced to obtain the replaced word segmentation sequence; Sequence encoding is performed on the replaced word segmentation sequence to obtain the sequence features of the test question text.

5. The test text matching method according to claim 3, characterized in that, The text matching based on the sequence features and the global formula features includes: Based on the correlation between the sequence features of the two test question texts, information interaction is performed on the sequence features of the two test question texts to obtain interactive sequence features; Based on the correlation between the global formula features of the two test question texts, information exchange is performed on the global formula features of the two test question texts to obtain interactive global features; Based on the interaction sequence features and the interaction global features, text matching is performed on the two test question texts.

6. The test text matching method according to any one of claims 1 to 5, characterized in that, The process of obtaining the test question text to be matched includes: The standard answer text and the student's answer text are used as the test question text respectively; The text matching of the test question text is followed by: Based on the text matching results, the score corresponding to the student's answer text is determined.

7. A test question text matching device, characterized in that, include: The formula parsing unit is used to obtain the test question text to be matched, parse each formula in the test question text, and obtain the formula operation tree corresponding to each formula. The merging unit is used to merge the formula operation trees corresponding to each formula based on whether there are common variable nodes among the formula operation trees, to obtain the global operation tree of the test question text. The global operation tree reflects the structural information of all formulas under the test question text and the relationship between all formulas. The graph encoding unit is used to perform graph encoding on the global operation tree to obtain the global formula features of the test question text; A matching unit is used to perform text matching on the test question text based on the global formula features; The graph encoding unit is specifically used for: Based on the text features of each node in the global operation tree and the node type features of each node, the initial features of each node are determined. The node type features are used to indicate that the node belongs to any one of operator nodes, variable nodes, and numeric nodes. Based on the initial features of each node, graph encoding is performed on the global operation tree to obtain the global formula features of the test question text.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the test text matching method as described in any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the test text matching method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Mathematical formula index creation method and system for retrieval system

    CN110795526A

  • Retrieval method and device for engineering field design calculation formula

    CN114266228A