Test question identification method and apparatus

By acquiring the sequence data and character position information of the test questions, generating position vectors, and combining them with a neural network model for iterative parsing, the problem of inaccurate formula recognition results in existing technologies is solved, achieving higher recognition accuracy.

CN115705727BActive Publication Date: 2026-04-17BEIJING YUANLI WEILAI SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING YUANLI WEILAI SCI & TECH CO LTD
Filing Date
2021-08-03
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing test question recognition methods rely on the sequential parsing of the transformer model, which makes it difficult to effectively identify the structural features of formulas, resulting in low accuracy of recognition results.

Method used

By acquiring the character position information in the sequence data, position vectors of sequence order coordinates and tree-like position coordinates are generated. Combined with a preset neural network model, a cyclic parsing operation is performed to generate an initial matrix and perform cyclic parsing to ensure that the recognition process conforms to the logical structure of the formula.

Benefits of technology

It improves the accuracy of test question recognition, especially formula recognition. The cyclic parsing method ensures that the recognition results conform to the logical relationship between the parts of the formula, thereby improving the accuracy of the recognition results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115705727B_ABST
    Figure CN115705727B_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for identifying test questions, relating to the field of analytical technology, and mainly aims to solve the problem of low accuracy in current conventional identification methods. The method includes: acquiring sequence data; determining the position information of the characters; generating a corresponding position vector based on the position information, and determining an initial matrix based on the position vector and the sequence data; performing a cyclic analytical operation based on the initial matrix and a preset neural network model to obtain the analytical result. This invention is used in the process of identifying test questions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of analytical technology, and in particular to a method and apparatus for identifying test questions. Background Technology

[0002] With the development of technology, image content analysis technology has also gradually evolved. For example, when an image contains test questions, analysis technology is needed to identify and parse the questions, thereby extracting the corresponding text content of the test questions from the image content.

[0003] Currently, in the process of identifying test questions, the Transformer model is often used to identify each part of the formula and obtain the corresponding recognition result. The Transformer is a novel network structure model that can be used as an encoder and decoder for sequence data. It was first proposed in machine translation tasks and is often used for data parsing. However, in practical applications, because the Transformer model only identifies the test questions from beginning to end, conventional recognition methods cannot recognize the structural characteristics of the test questions, especially the structure of formulas, thus affecting the accuracy of the recognition results. Summary of the Invention

[0004] In view of the above problems, the present invention provides a method and apparatus for identifying test questions, the main purpose of which is to solve the problem of low accuracy of the identification results of current conventional identification methods.

[0005] To address the aforementioned technical problems, in a first aspect, the present invention provides a method for identifying test questions, the method comprising:

[0006] Obtain sequence data, wherein the sequence data is obtained after the test question has undergone serialization processing, and wherein the sequence data contains multiple characters;

[0007] The position information of the character is determined, including sequence order coordinates and tree position coordinates. The sequence order coordinates are determined based on the order of the character in the sequence data, and the tree position coordinates are determined based on the hierarchical position of each character in the logical tree obtained by the tree operation processing of the sequence data.

[0008] A corresponding position vector is generated based on the position information, and an initial matrix is ​​determined based on the position vector and the sequence data;

[0009] Based on the initial matrix and the preset neural network model, a cyclic parsing operation is performed to obtain the parsing result.

[0010] Optionally, the step of performing a cyclic analysis operation based on the initial matrix and the preset neural network model to obtain the analysis result includes:

[0011] The intermediate matrix and the initial matrix are input into the preset neural network model for parsing to obtain the parsing result. The intermediate matrix is ​​obtained by the preset neural network model based on the parsing result obtained in the previous parsing operation, and the initial parsing result of the preset neural network model is obtained by inputting the initial matrix into the preset neural network model for parsing.

[0012] Optionally, the intermediate matrix is ​​obtained by the preset neural network model performing a re-representation operation based on the parsing result obtained from the previous parsing operation. The re-representation operation is used to convert the parsing result obtained from the parsing operation from a lower triangular matrix into a fully transparent matrix.

[0013] Optionally, after inputting the intermediate matrix and the initial matrix into the preset neural network model for parsing to obtain the parsing result, the method further includes:

[0014] Count the number of operations performed in the parsing process;

[0015] When the number of operations reaches the number of cycles, the parsing result obtained from the parsing operation corresponding to the number of operations is determined as the recognition result.

[0016] Optionally, generating the corresponding position vector based on the position information includes:

[0017] The location information is linearly transformed and then processed according to a preset activation function to obtain the location vector.

[0018] Optionally, the step of performing a linear transformation on the location information and then processing it according to a preset activation function to obtain the location vector includes:

[0019] Obtain the weight matrix parameters and the bias vector parameters, wherein the weight matrix parameters and the bias vector parameters are determined based on user instructions;

[0020] A linear transformation operation is performed on the position information based on the weight matrix parameters and the bias vector parameters to obtain a first parameter, wherein the first parameter is obtained by summing the product of the position information and the weight matrix parameters with the bias vector parameters;

[0021] The first parameter is processed according to the preset activation function to obtain a change vector, and the position vector is determined based on the change vector and the preset original coordinate vector.

[0022] Optionally, determining the position information of the character includes:

[0023] The characters are processed according to a tree model to obtain a logic tree, wherein the logic tree contains at least two levels, each level contains at least one node, each node corresponds to one character, and the level order between different levels is determined based on the calculation logic between the characters;

[0024] Based on the logic tree, the hierarchical position of the character corresponding to each node is determined sequentially from the top node according to the hierarchy, and used as the tree-shaped position coordinates to determine the position information of the character.

[0025] Secondly, embodiments of the present invention also provide a test question recognition device, comprising:

[0026] An acquisition unit is used to acquire sequence data, wherein the sequence data is obtained after the test question has been serialized, and wherein the sequence data contains multiple characters, wherein the characters represent a letter, number or operator in the test question;

[0027] A determining unit is used to determine the position information of the character. The position information includes sequence order coordinates and tree position coordinates. The sequence order coordinates are determined based on the order of the character in the sequence data. The tree position coordinates are determined based on the hierarchical position of each character in the logical tree obtained by the tree operation processing of the sequence data.

[0028] A generation unit is configured to generate a corresponding position vector based on the position information, and determine an initial matrix based on the position vector and the sequence data.

[0029] The parsing unit is used to perform cyclic parsing operations based on the initial matrix and the preset neural network model to obtain the parsing results.

[0030] Optionally, the parsing unit is further configured to input the intermediate matrix and the initial matrix into the preset neural network model for parsing operations to obtain parsing results, wherein the intermediate matrix is ​​obtained by the preset neural network model based on the parsing results obtained in the previous parsing operation, and the initial parsing result of the preset neural network model is obtained by inputting the initial matrix into the preset neural network model for parsing.

[0031] Optionally, the intermediate matrix is ​​obtained by the preset neural network model performing a re-representation operation based on the parsing result obtained from the previous parsing operation. The re-representation operation is used to convert the parsing result obtained from the parsing operation from a lower triangular matrix into a fully transparent matrix.

[0032] Optionally, the device further includes:

[0033] The statistics unit is used to count the number of operations performed in the parsing operation;

[0034] The result determination unit is used to determine the parsing result obtained by the parsing operation corresponding to the number of operations as the recognition result when the number of operations reaches the number of loops.

[0035] Optionally, the generation unit is specifically used to perform a linear transformation operation on the position information and then process it according to a preset activation function to obtain the position vector.

[0036] Optionally, the generation unit is further configured to:

[0037] Obtain the weight matrix parameters and the bias vector parameters, wherein the weight matrix parameters and the bias vector parameters are determined based on user instructions;

[0038] A linear transformation operation is performed on the position information based on the weight matrix parameters and the bias vector parameters to obtain a first parameter, wherein the first parameter is obtained by summing the product of the position information and the weight matrix parameters with the bias vector parameters;

[0039] The first parameter is processed according to the preset activation function to obtain a change vector, and the position vector is determined based on the change vector and the preset original coordinate vector.

[0040] Optionally, the determining unit is further configured to:

[0041] The characters are processed according to a tree model to obtain a logic tree, wherein the logic tree contains at least two levels, each level contains at least one node, each node corresponds to one character, and the level order between different levels is determined based on the calculation logic between the characters;

[0042] Based on the logic tree, the hierarchical position of the character corresponding to each node is determined sequentially from the top node according to the hierarchy, and used as the tree-shaped position coordinates to determine the position information of the character.

[0043] To achieve the above objectives, according to a third aspect of the present invention, a storage medium is provided, the storage medium comprising a stored program, wherein, when the program is executed, the device on which the storage medium is located executes the test question identification method described in any one of the first aspects.

[0044] To achieve the above objectives, according to a fourth aspect of the present invention, an apparatus is provided, the apparatus comprising at least one processor and at least one memory and bus connected to the processor; wherein the processor and memory communicate with each other via the bus; the processor is configured to invoke program instructions in the memory to execute the test item identification method as described in any one of the first aspects.

[0045] By employing the above technical solution, the test question recognition method and apparatus provided by this invention address the problem of low accuracy in current test question recognition results. This invention acquires sequence data, then determines the position information of the characters, generates a corresponding position vector based on the position information, determines an initial matrix based on the position vector and the sequence data, and finally performs a cyclic parsing operation based on the initial matrix and a preset neural network model to obtain the parsing result. This allows for the recognition of test questions based on the parsing result. In this solution, since the sequence data is obtained after the test question has undergone serialization processing, and the sequence data contains multiple characters, each character representing a letter, number, or operator in the test question, this ensures that during the test question recognition process, especially in formula recognition, each character and operator in the formula can be recognized, thus ensuring recognition accuracy. Meanwhile, the positional information includes sequence order coordinates and tree-like position coordinates. The sequence order coordinates are determined based on the order of the characters in the sequence data, and the tree-like position coordinates are determined based on the hierarchical position of each character in the logical tree obtained after tree-like processing. This allows the various parts of the formula to be represented in a tree structure, enabling subsequent parsing based on the positional characteristics of each part within the tree structure. This ensures that data like formulas, where internal parts have logical relationships, can be parsed according to a tree structure that conforms to these logical relationships, thus improving the accuracy of the parsing results. Furthermore, since the target data includes the initial matrix, the iterative parsing operation adds the output data to the target data after the preset neural network model obtains output data based on the target data. This ensures that the final parsing result can be determined through iterative processing, which is more accurate than non-iterative parsing methods.

[0046] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0047] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0048] Figure 1 A flowchart of a test question identification method provided by an embodiment of the present invention is shown;

[0049] Figures 2-A to 2-E The diagrams show specific steps involved in the execution of a test question identification method provided in an embodiment of the present invention.

[0050] Figure 3 This diagram illustrates a block diagram of a test question recognition device provided in an embodiment of the present invention;

[0051] Figure 4 This diagram illustrates a block diagram of a device for identifying test questions, as provided in an embodiment of the present invention. Detailed Implementation

[0052] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.

[0053] To address the issue of low accuracy in current conventional identification methods, this invention provides a method for identifying test questions, such as... Figure 1 As shown, the method includes:

[0054] 101. Obtain sequence data.

[0055] The sequence data is obtained by serializing the test question, and the sequence data contains multiple characters. In this embodiment, the character represents a letter, number, or operator in the test question.

[0056] In this embodiment of the invention, the test question can specifically be text containing formula content. That is, the method described in this embodiment is mainly used for the recognition process of specific formula text in the test question. Based on this, the overall sequence data can be as follows: Figure 2-AAs shown, d1, 3.14, and * are all characters in the sequence data. This sequence data can be obtained by serializing the formula "3 / 3.14*(4+5)". Of course, in practical applications, the form of the serialized sequence data includes, but is not limited to, the methods described above.

[0057] Furthermore, the sequence data can be obtained either by the user manually inputting it after serialization, or by the user inputting a normal formula and then serializing it. No specific limitation is made here.

[0058] 102. Determine the position information of the character.

[0059] The location information includes sequence order coordinates and tree-like position coordinates. The sequence order coordinates are determined based on the order of the characters in the sequence data, and the tree-like position coordinates are determined based on the hierarchical position of each character in the logical tree obtained by the tree operation processing of the sequence data.

[0060] Since the obtained sequence data contains multiple characters, it is necessary to determine the position of each character so that the relationships between the characters can be determined during subsequent recognition. In this embodiment, a combination of two position coordinates is mainly used as the position information of each character, such as... Figure 2-B As shown. The first type is the sequence coordinate, determined by the positional order of the character within the sequence data.

[0061] The second method involves processing characters using a tree-like structure and then determining the tree-like position coordinates of each character within the logic tree, based on its level. Since the logic tree is constructed based on the logical relationships between characters, the relationships between characters can be reflected in different levels.

[0062] 103. Generate the corresponding position vector based on the position information, and determine the initial matrix based on the position vector and sequence data.

[0063] Since the analysis process is based on an analysis model trained on a transformer model, it is necessary to generate corresponding position vectors from the position information to obtain corresponding matrices based on the characteristics of this model, and then perform analysis based on the analysis model and the matrices.

[0064] Therefore, in this embodiment, it is necessary to first generate a corresponding position vector from the position information. In the original Transformer, each position coordinate corresponds to a unique low-dimensional spatial numerical vector (e.g., 768-dimensional).

[0065] In addition, based on this embodiment, the concept of tree-like position coordinates is proposed. In order to make the two coordinates related, the sequence order coordinates and tree-like position coordinates can be made to share the same low-dimensional vector numerical space through an algorithm.

[0066] Finally, after generating position vectors based on these two types of position information, the initial matrix of the corresponding formula is determined by the position vectors and sequence data.

[0067] 104. Perform a cyclic analysis operation based on the initial matrix and the preset neural network model to obtain the analysis results.

[0068] In this embodiment, since the preset neural network model is an analytical model trained based on the transformer model, it has the same network space. Therefore, the parsing process is similar to that of the transformer model. During parsing, the result obtained after the first parsing is used as the input data for the next parsing. In other words, the result of the previous parsing is continuously used as the input for the next parsing, thus forming a cyclic parsing process. That is, after inputting the initial matrix into the preset neural network model, cyclic parsing operations can be continuously performed, and the result of the cyclic parsing operations is used as the parsing result of the entire formula corresponding to the sequence data.

[0069] Thus, in the above scheme, sequence data is first acquired, then the position information of the characters is determined, a corresponding position vector is generated based on the position information, and an initial matrix is ​​determined based on the position vector and the sequence data. Finally, a cyclic parsing operation is performed based on the initial matrix and a preset neural network model to obtain the parsing result, thereby realizing the function of identifying test questions based on the parsing result. In the above scheme, since the sequence data is obtained after the test questions have been serialized, the sequence data contains multiple characters, and the characters represent a letter, number, or operator in the test questions. This ensures that during the process of identifying test questions, especially in the process of recognizing formulas, each character and operator in the formula can be identified, thus ensuring the accuracy of the recognition. Meanwhile, the positional information includes sequence order coordinates and tree-like position coordinates. The sequence order coordinates are determined based on the order of the characters in the sequence data, and the tree-like position coordinates are determined based on the hierarchical position of each character in the logical tree obtained after tree-like processing. This allows the various parts of the formula to be represented in a tree structure, enabling subsequent parsing based on the positional characteristics of each part within the tree structure. This ensures that data like formulas, where internal parts have logical relationships, can be parsed according to a tree structure that conforms to these logical relationships, thus improving the accuracy of the parsing results. Furthermore, since the target data includes the initial matrix, the iterative parsing operation adds the output data to the target data after the preset neural network model obtains output data based on the target data. This ensures that the final parsing result can be determined through iterative processing, which is more accurate than non-iterative parsing methods.

[0070] In an optional embodiment, step 104 of the aforementioned embodiment involves a cyclic parsing operation based on the aforementioned initial matrix and preset neural network model to obtain the parsing result, including:

[0071] The intermediate matrix and the initial matrix are input into the aforementioned preset neural network model for parsing to obtain the parsing result. The intermediate matrix is ​​obtained by the preset neural network model based on the parsing result of the previous parsing operation, and the initial parsing result of the preset neural network model is obtained by inputting the initial matrix into the preset neural network model for parsing.

[0072] In this step, the parsing process can be as follows: Figure 2-CAs shown, the iterative parsing process can be understood as follows: In the first parsing, only the initial matrix is ​​input into the preset neural network as the target data, and an intermediate matrix (the initial parsing result) is obtained. In the second parsing, both the intermediate matrix and the initial matrix are used as target data. During the repeated parsing process, each subsequent parsing uses the intermediate matrix obtained from the previous parsing and the initial matrix as target data. Thus, because the iterative parsing operation re-parses the results after each parsing, it achieves an iterative parsing process. This allows the characteristics of the preset neural network model to be utilized for parsing, resulting in the final parsing result after multiple iterations, thereby improving the accuracy of the parsing result.

[0073] In the above steps, in order to make the method of this embodiment more accurately reflect the relationship between different characters, it is also necessary to adjust the matrix pattern of the parsing result after the initial matrix is ​​parsed by the preset neural network model, so as to improve the accuracy of the parsing result based on the correlation between the various parts.

[0074] Based on this, the aforementioned intermediate matrix is ​​obtained by performing a re-representation operation on the parsing result obtained from the previous parsing operation using the preset neural network model. The re-representation operation is used to convert the parsing result obtained from the previous parsing operation from a lower triangular matrix into a fully transparent matrix.

[0075] In this embodiment, since the conventional transformer model is trained in parallel for each position in the target sequence during training, when the original transformer model is used as a decoder, a lower triangular matrix is ​​generally used as an attention marker to ensure that the later positions in the target sequence do not expose information to the earlier parts of the sequence during the forward propagation of the neural network.

[0076] In this embodiment, when using a pre-defined neural network model with the same structure as the transformer for parsing, since the decoding and encoding parsing methods are the same, the resulting value still reuses the lower triangular attention marker, meaning the parsing result obtained from the initial matrix parsing is also a triangular matrix. However, in this embodiment, since the character position also includes tree-like position coordinates to reflect the relationship between characters, if the lower triangular matrix is ​​still used for iterative parsing at this time, it may cause the lower triangular attention marker to mask the information of all child nodes of the current node (because in the preorder traversal sequence of the tree, the parent node appears before all child nodes), thus causing a loss of tree structure information. Therefore, in this embodiment, a re-representation operation can be performed on the parsing result after each parsing result, that is, converting the lower triangular matrix obtained from the parsing result into a fully transparent matrix, such as... Figure 2-DAs shown. This allows the parent node to update its representation during the re-representation process when decoding a new child node.

[0077] Since the parsing results can be re-represented to obtain the corresponding fully transparent matrix, the relationship between parent and child nodes can be reflected in the subsequent parsing process based on the characteristics of the fully transparent matrix. This allows the parsing results to reflect the characteristics of tree structure information, thus making the parsing results more accurate.

[0078] In an optional embodiment, after inputting the intermediate matrix and the initial matrix into the aforementioned preset neural network model for parsing to obtain the parsing result in the steps of the foregoing embodiments, the method of this embodiment further includes:

[0079] Count the number of operations performed in the parsing process;

[0080] When the number of operations reaches the number of cycles, the parsing result obtained from the parsing operation corresponding to the number of operations is determined as the recognition result.

[0081] Since the parsing operation is a continuously looping process, it's necessary to determine how many times the loop is executed, i.e., to count the number of parsing operations. Because each parsing iteration is equivalent to one loop iteration, the number of operations is equal to the number of loop iterations.

[0082] By determining the final parsing result as the recognition result based on the number of iterations, control over the cyclic parsing operation is achieved. This allows the user to select the appropriate number of iterations based on their needs, thereby ensuring the controllability of the parsing process and avoiding meaningless repetitive loops.

[0083] In an optional embodiment, the step of generating a corresponding position vector based on the position information in the foregoing steps includes:

[0084] The location information is linearly transformed and then processed according to a preset activation function to obtain the location vector.

[0085] In this embodiment of the invention, the aforementioned position vector can be understood as processing the original coordinates through a linear transformation layer, i.e., a linear transformation operation. This linear transformation operation can be performed as y = Wx, where x can be understood as the original coordinates, and W is the coefficient of the linear transformation operation.

[0086] Furthermore, when performing pre-defined activation function processing, this function can be the GELU function. In the process of neural network modeling, a crucial property is non-linearity. Simultaneously, to improve the model's generalization ability, random regularization needs to be added. Random regularization and non-linear activation are two separate processes, but in reality, the model's input is determined by both non-linear activation and random regularization. GELU introduces the idea of ​​random regularization into the activation process, providing a probabilistic description of neuron inputs that intuitively aligns with natural understanding. Therefore, processing based on a pre-defined activation function can result in a more accurate position vector.

[0087] In an optional embodiment, the specific execution method for processing the location information based on linear operations and then performing preset function processing can be as follows:

[0088] First, obtain the weight matrix parameters and the bias vector parameters, wherein the weight matrix parameters and the bias vector parameters are determined based on user instructions;

[0089] Then, a linear transformation operation is performed on the position information according to the weight matrix parameters and the bias vector parameters to obtain the first parameter, wherein the first parameter is obtained by summing the product of the position information and the weight matrix parameters with the bias vector parameters;

[0090] Finally, the first parameter is processed according to the preset activation function to obtain the change vector, and the position vector is determined based on the change vector and the preset original coordinate vector.

[0091] As mentioned in the previous embodiments, in the original transformer model, each position coordinate corresponds to a unique low-dimensional spatial numerical vector. However, in this embodiment, in addition to using sequential coordinates, a tree-like position coordinate system is also used, thus establishing a relationship between the two coordinates. This invention allows these two coordinates to coexist in a single vector coordinate system. However, it is also necessary to distinguish between the two types of coordinates. In this invention, E... t It can be a vector of changes in tree-like position coordinates after linear transformation and processing with a preset activation function, E o These are the preset original coordinate vectors, and the relationship between them can be specifically shown in the following formula:

[0092] E t =GELU(W·E o +b)

[0093] Where GELU is the activation function, W is the weight matrix parameter, and b is the bias vector parameter. After determining the transformation vector, we can then base our analysis on the transformation vector and the preset original coordinate vector E. o Determine the position vector E, where E = Eo +E t .

[0094] The above method can convert position coordinates into corresponding position vectors, thus providing data support for subsequent analysis based on position vectors.

[0095] In an optional embodiment, since this embodiment needs to determine the relationships between all characters in the sequence data, that is, to represent the relationships between each character in a tree structure, the process of determining the tree position coordinates requires constructing a corresponding tree structure, i.e., a logic tree, and determining the character corresponding to each node in the logic tree. Therefore, determining the position information of the character in the aforementioned steps includes:

[0096] First, the characters are processed using a tree-like model to obtain a logic tree. This logic tree contains at least two levels, each level contains at least one node, and each node corresponds to one character. The order of the levels is determined based on the computational logic between the characters. For example, based on the formula in the aforementioned embodiment, after constructing the logic tree, its form can be as follows: Figure 2-E As shown.

[0097] Then, based on the logic tree, the hierarchical position of the character corresponding to each node is determined sequentially from the top node according to the hierarchy, and used as the tree-shaped position coordinates to determine the position information of the character.

[0098] By using the above method, since the resulting logic tree is constructed according to the logical relationship between each character in the sequence data, that is, it can reflect the relationship between each part of the formula. This ensures that the final tree-shaped position coordinates can reflect the position of each character in the whole formula, which is beneficial to obtain a relatively accurate recognition result through the relationship between position coordinates in the subsequent parsing process. This improves the accuracy of the formula recognition process.

[0099] Furthermore, as a response to the above Figure 1 In addition to the implementation of the method shown, this embodiment of the invention also provides a test question recognition device for identifying the above-mentioned questions. Figure 1 The method shown is implemented accordingly. This device embodiment corresponds to the foregoing method embodiment. For ease of reading, this device embodiment will not repeat the details of the foregoing method embodiment, but it should be clear that the device in this embodiment can implement all the contents of the foregoing method embodiment. Figure 3 As shown, the device includes:

[0100] The acquisition unit 31 can be used to acquire sequence data, wherein the sequence data is obtained after the test question has been serialized, and wherein the sequence data contains multiple characters, wherein the characters represent a letter, number or operator in the test question;

[0101] The determining unit 32 can be used to determine the position information of the character. The position information includes sequence order coordinates and tree position coordinates. The sequence order coordinates are determined based on the order of the character in the sequence data. The tree position coordinates are determined based on the hierarchical position of each character in the logical tree obtained by the tree operation processing of the sequence data.

[0102] The generation unit 33 can be used to generate a corresponding position vector based on the position information, and to determine an initial matrix based on the position vector and the sequence data;

[0103] The parsing unit 34 can be used to perform cyclic parsing operations based on the initial matrix and the preset neural network model to obtain the parsing results.

[0104] Furthermore, the parsing unit 34 can also be specifically used to input the intermediate matrix and the initial matrix into the preset neural network model for parsing operations to obtain parsing results. The intermediate matrix is ​​obtained by the preset neural network model based on the parsing results obtained in the previous parsing operation, and the initial parsing result of the preset neural network model is obtained by inputting the initial matrix into the preset neural network model for parsing.

[0105] Furthermore, the intermediate matrix is ​​obtained by the preset neural network model performing a re-representation operation based on the parsing result obtained from the previous parsing operation. The re-representation operation can be used to convert the parsing result obtained from the parsing operation from a lower triangular matrix into a fully transparent matrix.

[0106] Furthermore, the device also includes:

[0107] The statistics unit can be used to count the number of operations performed in the parsing operation;

[0108] The result determination unit can be used to determine the parsing result obtained by the parsing operation corresponding to the number of operations as the recognition result when the number of operations reaches the number of cycles.

[0109] Furthermore, the generation unit 33 can be specifically used to perform a linear transformation operation on the position information and then process it according to a preset activation function to obtain the position vector.

[0110] Furthermore, the generation unit 33 can also be used for:

[0111] Obtain the weight matrix parameters and the bias vector parameters, wherein the weight matrix parameters and the bias vector parameters are determined based on user instructions;

[0112] A linear transformation operation is performed on the position information based on the weight matrix parameters and the bias vector parameters to obtain a first parameter, wherein the first parameter is obtained by summing the product of the position information and the weight matrix parameters with the bias vector parameters;

[0113] The first parameter is processed according to the preset activation function to obtain a change vector, and the position vector is determined based on the change vector and the preset original coordinate vector.

[0114] Furthermore, the determining unit 32 can also be used for:

[0115] The characters are processed according to a tree model to obtain a logic tree, wherein the logic tree contains at least two levels, each level contains at least one node, each node corresponds to one character, and the level order between different levels is determined based on the calculation logic between the characters;

[0116] Based on the logic tree, the hierarchical position of the character corresponding to each node is determined sequentially from the top node according to the hierarchy, and used as the tree-shaped position coordinates to determine the position information of the character.

[0117] By employing the above technical solution, embodiments of the present invention provide a method and apparatus for identifying test questions. Addressing the problem of low accuracy in current test question identification results, the present invention acquires sequence data, then determines the position information of the characters, generates a corresponding position vector based on the position information, determines an initial matrix based on the position vector and the sequence data, and finally performs a cyclic parsing operation based on the initial matrix and a preset neural network model to obtain the parsing result. This allows for the identification of test questions based on the parsing result. In the above solution, since the sequence data is obtained after the test question has undergone serialization processing, and the sequence data contains multiple characters, each character representing a letter, number, or operator in the test question, this ensures that during the test question identification process, especially in formula identification, each character and operator in the formula can be identified, thus ensuring the accuracy of the identification. Meanwhile, the positional information includes sequence order coordinates and tree-like position coordinates. The sequence order coordinates are determined based on the order of the characters in the sequence data, and the tree-like position coordinates are determined based on the hierarchical position of each character in the logical tree obtained after tree-like processing. This allows the various parts of the formula to be represented in a tree structure, enabling subsequent parsing based on the positional characteristics of each part within the tree structure. This ensures that data like formulas, where internal parts have logical relationships, can be parsed according to a tree structure that conforms to these logical relationships, thus improving the accuracy of the parsing results. Furthermore, since the target data includes the initial matrix, the iterative parsing operation adds the output data to the target data after the preset neural network model obtains output data based on the target data. This ensures that the final parsing result can be determined through iterative processing, which is more accurate than non-iterative parsing methods.

[0118] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured; adjusting kernel parameters can address the low accuracy of current conventional recognition methods.

[0119] This invention provides a storage medium storing a program that, when executed by a processor, implements the method for identifying the test questions.

[0120] This invention provides a processor for running a program, wherein the program executes the method for identifying the test questions during runtime.

[0121] This invention provides a device 40, such as... Figure 4As shown, the device includes at least one processor 401, and at least one memory 402 and bus 403 connected to the processor; wherein the processor 401 and the memory 402 communicate with each other through the bus 403; the processor 401 is used to call program instructions in the memory to execute the above-mentioned test question recognition method.

[0122] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.

[0123] This application also provides a computer program product, which, when executed on a process management device, is suitable for executing an initialization program with the following method steps: acquiring sequence data, wherein the sequence data is obtained after the test question has undergone serialization processing, wherein the sequence data contains multiple characters, and the characters represent a letter, number, or operator in the test question; determining the position information of the characters, the position information including sequence order coordinates and tree-like position coordinates, wherein the sequence order coordinates are determined based on the order of the characters in the sequence data, and the tree-like position coordinates are determined based on the hierarchical position of each character in the logic tree obtained by the tree operation processing of the sequence data; generating a corresponding position vector according to the position information, and determining an initial matrix according to the position vector and the sequence data; performing a cyclic parsing operation based on the initial matrix and a preset neural network model to obtain a parsing result.

[0124] Furthermore, the iterative analysis operation based on the initial matrix and the preset neural network model to obtain the analysis results includes:

[0125] The intermediate matrix and the initial matrix are input into the preset neural network model for parsing to obtain the parsing result. The intermediate matrix is ​​obtained by the preset neural network model based on the parsing result obtained in the previous parsing operation, and the initial parsing result of the preset neural network model is obtained by inputting the initial matrix into the preset neural network model for parsing.

[0126] Furthermore, the intermediate matrix is ​​obtained by the preset neural network model performing a re-representation operation based on the parsing result obtained from the previous parsing operation. The re-representation operation is used to convert the parsing result obtained from the parsing operation from a lower triangular matrix into a fully transparent matrix.

[0127] Furthermore, after inputting the intermediate matrix and the initial matrix into the preset neural network model for parsing to obtain the parsing result, the method further includes:

[0128] Count the number of operations performed in the parsing process;

[0129] When the number of operations reaches the number of cycles, the parsing result obtained from the parsing operation corresponding to the number of operations is determined as the recognition result.

[0130] Furthermore, generating the corresponding position vector based on the position information includes:

[0131] The location information is linearly transformed and then processed according to a preset activation function to obtain the location vector.

[0132] Furthermore, the step of performing a linear transformation on the location information and then processing it according to a preset activation function to obtain the location vector includes:

[0133] Obtain the weight matrix parameters and the bias vector parameters, wherein the weight matrix parameters and the bias vector parameters are determined based on user instructions;

[0134] A linear transformation operation is performed on the position information based on the weight matrix parameters and the bias vector parameters to obtain a first parameter, wherein the first parameter is obtained by summing the product of the position information and the weight matrix parameters with the bias vector parameters;

[0135] The first parameter is processed according to the preset activation function to obtain a change vector, and the position vector is determined based on the change vector and the preset original coordinate vector.

[0136] Furthermore, determining the position information of the character includes:

[0137] The characters are processed according to a tree model to obtain a logic tree, wherein the logic tree contains at least two levels, each level contains at least one node, each node corresponds to one character, and the level order between different levels is determined based on the calculation logic between the characters;

[0138] Based on the logic tree, the hierarchical position of the character corresponding to each node is determined sequentially from the top node according to the hierarchy, and used as the tree-shaped position coordinates to determine the position information of the character.

[0139] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable process management device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable process management device, generate instructions for implementing the process... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0140] In a typical configuration, the device includes one or more processors (CPUs), memory, and a bus. The device may also include input / output interfaces, network interfaces, etc.

[0141] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM, and memory includes at least one memory chip. Memory is an example of computer-readable media.

[0142] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0143] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0144] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0145] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method of identifying a test question, comprising: include: Obtain sequence data, wherein the sequence data is obtained after the test question has undergone serialization processing, and the sequence data contains multiple characters; The position information of the character is determined, including sequence order coordinates and tree position coordinates. The sequence order coordinates are determined based on the order of the character in the sequence data, and the tree position coordinates are determined based on the hierarchical position of each character in the logical tree obtained by the tree operation processing of the sequence data. A corresponding position vector is generated based on the position information, and an initial matrix is ​​determined based on the position vector and the sequence data; Based on the initial matrix and the preset neural network model, a cyclic parsing operation is performed to obtain the parsing result. The preset neural network model is a transformer model.

2. The method of claim 1, wherein, The iterative parsing operation based on the initial matrix and the preset neural network model yields the following parsing results: The intermediate matrix and the initial matrix are input into the preset neural network model for parsing to obtain the parsing result. The intermediate matrix is ​​obtained by the preset neural network model based on the parsing result obtained in the previous parsing operation, and the initial parsing result of the preset neural network model is obtained by inputting the initial matrix into the preset neural network model for parsing.

3. The method of claim 2, wherein, The intermediate matrix is ​​obtained by the preset neural network model performing a re-representation operation based on the parsing result obtained from the previous parsing operation. The re-representation operation is used to convert the parsing result obtained from the parsing operation from a lower triangular matrix into a fully transparent matrix.

4. The method of claim 2, wherein, After inputting the intermediate matrix and the initial matrix into the preset neural network model for parsing to obtain the parsing result, the method further includes: Count the number of operations performed in the parsing process; When the number of operations reaches the number of cycles, the parsing result obtained from the parsing operation corresponding to the number of operations is determined as the recognition result.

5. The method of claim 1, wherein, The step of generating a corresponding position vector based on the position information includes: The location information is linearly transformed and then processed according to a preset activation function to obtain the location vector.

6. The method of claim 5, wherein, The step of performing a linear transformation on the location information and then processing it according to a preset activation function to obtain the location vector includes: Obtain the weight matrix parameters and the bias vector parameters, wherein the weight matrix parameters and the bias vector parameters are determined based on user instructions; A linear transformation operation is performed on the position information based on the weight matrix parameters and the bias vector parameters to obtain a first parameter, wherein the first parameter is obtained by summing the product of the position information and the weight matrix parameters with the bias vector parameters; The first parameter is processed according to the preset activation function to obtain a change vector, and the position vector is determined based on the change vector and the preset original coordinate vector.

7. The method according to any one of claims 1-6, characterized in that, The determination of the position information of the character includes: The characters are processed according to a tree model to obtain a logic tree, wherein the logic tree contains at least two levels, each level contains at least one node, each node corresponds to one character, and the level order between different levels is determined based on the calculation logic between the characters; Based on the logic tree, the hierarchical position of the character corresponding to each node is determined sequentially from the top node according to the hierarchy, and used as the tree-shaped position coordinates to determine the position information of the character.

8. A test question recognition device, characterized in that, include: An acquisition unit is used to acquire sequence data, wherein the sequence data is obtained after the test question has been serialized, and wherein the sequence data contains multiple characters, wherein the characters represent a letter, number or operator in the test question; A determining unit is used to determine the position information of the character. The position information includes sequence order coordinates and tree position coordinates. The sequence order coordinates are determined based on the order of the character in the sequence data. The tree position coordinates are determined based on the hierarchical position of each character in the logical tree obtained by the tree operation processing of the sequence data. A generation unit is configured to generate a corresponding position vector based on the position information, and determine an initial matrix based on the position vector and the sequence data. The parsing unit is used to perform cyclic parsing operations based on the initial matrix and the preset neural network model to obtain the parsing result. The preset neural network model is a transformer model.

9. A storage medium, characterized in that, The storage medium includes a stored program, wherein, when the program is executed, it controls the device where the storage medium is located to perform the test question identification method as described in any one of claims 1 to 7.

10. An electronic device, characterized in that, The device includes at least one processor and at least one memory and bus connected to the processor; wherein the processor and memory communicate with each other through the bus; the processor is used to call program instructions in the memory to execute the test question recognition method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and system for automatically solving mathematical problems

    CN110751137A

  • Hierarchical classification using neural networks

    US20190171913A1