Numerical reasoning method and device in machine reading comprehension

By constructing a relational network graph and iterating node representation vectors, the insufficient ability of machine reading comprehension to solve complex numerical reasoning problems is addressed, thereby improving the accuracy of answers.

CN112507074BActive Publication Date: 2026-05-08ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
Filing Date
2020-07-31
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing technologies often fail to arrive at correct answers when dealing with complex numerical reasoning problems in machine reading comprehension.

Method used

By constructing a relational network graph, the types of entities and digital nodes are determined, and language models and attention mechanisms are used for iteration to obtain the updated representation vectors of each node, ultimately determining the numerical reasoning answer.

Benefits of technology

It improves the ability of machine reading comprehension to handle complex problems through numerical reasoning, enabling it to solve complex problems better and improve the accuracy of answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112507074B_ABST
    Figure CN112507074B_ABST
Patent Text Reader

Abstract

Embodiments of the present specification provide a numerical reasoning method and device in machine reading comprehension. The method comprises: obtaining a current question and a current text; determining each entity and each number included in the current question and the current text, and the type corresponding to each number; constructing a relationship network graph, including entity nodes corresponding to each entity, and number nodes corresponding to each number, and forming neighbors between number nodes of the same type, and between entity nodes and number nodes having a preset relationship through a connection edge; determining a first question representation vector corresponding to the current question, and an initial representation vector of each node in the relationship network graph; based on the initial representation vector of each node, performing a predetermined number of iterations on each node in the relationship network graph to obtain an updated representation vector of each node. The ability of the numerical reasoning processing complex problems in machine reading comprehension can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This invention application is a divisional application of the invention application filed on July 31, 2020, with application number 202010759810.0 and titled "Numerical Reasoning Method and Apparatus in Machine Reading Comprehension". Technical Field

[0002] This specification relates to one or more embodiments in the field of computers, and more particularly to numerical reasoning methods and apparatus in machine reading comprehension. Background Technology

[0003] Machine reading comprehension, a task within natural language processing, typically presents a question and text. The text describes the conditions of the question, and machine reading comprehension can derive the corresponding answer. Numerical reasoning is a crucial capability in machine reading comprehension, often involving numerical reasoning methods such as addition, subtraction, sorting, and statistics. For a question related to numerical reasoning, how to deduce the correct answer based on the text is a current research focus.

[0004] In existing technologies, when performing numerical reasoning in machine reading comprehension, it is often impossible to obtain the correct answer when faced with complex problems.

[0005] Therefore, we hope to find an improved solution that can enhance the ability of machine reading comprehension to handle complex problems through numerical reasoning. Summary of the Invention

[0006] This specification describes one or more embodiments of a numerical reasoning method and apparatus for machine reading comprehension, which can improve the ability of numerical reasoning in machine reading comprehension to handle complex problems.

[0007] Firstly, a numerical reasoning method for machine reading comprehension is provided, the method including:

[0008] Obtain the current question and the current text, where the current text describes the conditions of the current question;

[0009] Determine the current question and each entity and number included in the current text, as well as the type corresponding to each number;

[0010] Construct a relational network graph, which includes entity nodes corresponding to each entity and digital nodes corresponding to each number. Neighbors are formed between digital nodes of the same type and between entity nodes and digital nodes with a preset relationship through connecting edges.

[0011] Input the current question and the current text into a language model, and obtain the first semantic representation vector corresponding to the position of each semantic element in the current question and the current text through the language model;

[0012] Based on each first semantic representation vector, determine the first problem representation vector corresponding to the current problem, and the initial representation vector of each node in the relational network graph;

[0013] Based on the initial representation vector of each node, the nodes in the relational network graph are iterated a predetermined number of times. Each iteration includes, for each node, aggregating neighbor nodes based on the first problem representation vector and using an attention mechanism to obtain the updated representation vector of each node.

[0014] The numerical reasoning answer is determined based on the updated representation vector of each node after the predetermined number of iterations.

[0015] In one possible implementation, the type includes at least one of the following:

[0016] Amount, time, percentage.

[0017] In one possible implementation, the entity includes at least one of the following:

[0018] Names of people, places, and items.

[0019] In one possible implementation, determining the first problem representation vector corresponding to the current problem based on each first semantic representation vector includes:

[0020] The first semantic representation vector corresponding to each semantic element position in the current problem is subjected to mean pooling to obtain the first problem representation vector corresponding to the current problem.

[0021] In one possible implementation, determining the initial representation vector of each node in the relational network graph based on each first semantic representation vector includes:

[0022] For any node in the relational network graph, determine the positions of several semantic elements in the current question and the current text that match the content of that node, and perform mean pooling on several first semantic representation vectors corresponding to the positions of the several semantic elements to determine the initial representation vector of that node.

[0023] In one possible implementation, each iteration includes:

[0024] Based on the first problem representation vector, the problem driving vector corresponding to the current iteration number is determined using a neural network corresponding to the current iteration number;

[0025] Based on the initial representation vector, current representation vector, and problem-driving vector of each node, the intermediate vector of each node is determined.

[0026] The intermediate vectors of each node are transformed using the query matrix, key matrix, and value matrix respectively, to obtain the query vector, key vector, and value vector corresponding to each node.

[0027] The similarity between the query vector corresponding to the first node and the key vector corresponding to the second node is calculated to obtain the attention score from the second node to the first node; wherein the first node and the second node are any two nodes that are neighbors in the relational network graph.

[0028] Take any node as the target node, and sum the value vectors of each neighbor according to the attention scores of each neighbor to the target node. Based on the summation result, determine the updated representation vector of the target node.

[0029] Further, the step of determining the problem-driving vector corresponding to the current iteration number using a neural network corresponding to the current iteration number based on the first problem representation vector includes:

[0030] The first problem representation vector is passed through the first fully connected layer to obtain the first feature vector;

[0031] The first feature vector is processed by an activation function to obtain the second feature vector;

[0032] The second feature vector is passed through the second fully connected layer corresponding to the current iteration number to obtain the problem-driving vector corresponding to the current iteration number.

[0033] Furthermore, determining the intermediate vector of each node based on the initial representation vector, the current representation vector, and the problem-driving vector of each node includes:

[0034] The initial representation vector of each node is concatenated with the current representation vector of each node to obtain the first concatenated vector corresponding to each node.

[0035] After converting the first concatenation vector of each node into a preset dimension, it is multiplied bitwise with the problem-driven vector to obtain the intermediate vector of each node.

[0036] Further, the step of converting the first concatenated vector into a preset dimension includes:

[0037] The first concatenated vector is passed through a third fully connected layer to be transformed into a preset dimension, which is the same as the dimension of the problem-driven vector.

[0038] In one possible implementation, determining the numerical reasoning answer based on the updated representation vectors of each node after the predetermined number of iterations includes:

[0039] For any node in the relational network graph, determine the positions of several semantic elements in the current question and the current text that match the content of that node, and obtain several first semantic representation vectors corresponding to the positions of the several semantic elements.

[0040] Based on the updated representation vector of any node after the predetermined number of iterations, update the first semantic representation vectors corresponding to the positions of the several semantic elements obtained, so as to determine the second semantic representation vectors corresponding to the positions of the several semantic elements respectively.

[0041] Based on the second semantic representation vectors corresponding to the positions of several semantic elements in the current question and the current text, and the first semantic representation vectors corresponding to the positions of other semantic elements, determine the first comprehensive representation vector corresponding to the current question and the current text.

[0042] Based on the first comprehensive representation vector, the answer type corresponding to the numerical reasoning answer is determined using the first classification model;

[0043] The numerical reasoning answer is determined using a second classification model, based at least on the answer type and the first comprehensive representation vector.

[0044] Furthermore, the answer type includes at least one of the following:

[0045] Answer extraction, counting problems, and arithmetic expression problems.

[0046] Furthermore, the answer type is answer extraction;

[0047] The step of determining the numerical reasoning answer using a second classification model based at least on the answer type and the first comprehensive representation vector includes:

[0048] Based on the second semantic representation vectors corresponding to the positions of several semantic elements in the current problem, and the first semantic representation vectors corresponding to the positions of other semantic elements, the second problem representation vector corresponding to the current problem is determined.

[0049] The first comprehensive representation vector is multiplied bitwise with the second problem representation vector to obtain the first cross representation vector;

[0050] The first comprehensive representation vector and the first cross representation vector are concatenated and input into the second classification model to obtain the numerical reasoning answer.

[0051] Furthermore, the second classification model is used to predict the start position and end position of the answer in each semantic element position, so as to obtain the numerical reasoning answer based on the start position and end position of the answer.

[0052] Furthermore, the answer type is a counting problem;

[0053] The second classification model is used to predict numbers from 0 to 9 to obtain the numerical reasoning answer.

[0054] Furthermore, the answer type is an arithmetic expression problem;

[0055] The second classification model is used to predict the symbol of each number in the current question and the current text, including plus signs, minus signs, and 0, and to obtain a numerical reasoning answer by operating on each number and symbol.

[0056] Secondly, a numerical reasoning device for machine reading comprehension is provided, the device comprising:

[0057] The acquisition unit is used to acquire the current question and the current text, wherein the current text is used to describe the conditions of the current question;

[0058] The first determining unit is used to determine the entities and numbers included in the current question and current text acquired by the acquiring unit, as well as the types corresponding to each number;

[0059] A construction unit is used to construct a relational network graph, which includes entity nodes corresponding to each entity determined by the first determining unit and digital nodes corresponding to each number. Neighbors are formed between digital nodes of the same type and between entity nodes and digital nodes with a preset relationship through connecting edges.

[0060] The first representation unit is used to input the current question and current text acquired by the acquisition unit into the language model, and obtain the first semantic representation vector corresponding to the position of each semantic element in the current question and current text through the language model;

[0061] The second representation unit is used to determine the first problem representation vector corresponding to the current problem and the initial representation vector of each node in the relational network graph based on the first semantic representation vectors obtained by the first representation unit.

[0062] An iterative unit is used to iterate over each node in the relational network graph a predetermined number of times based on the initial representation vector of each node obtained by the second representation unit. Each iteration includes, for each node, aggregating neighbor nodes based on the first problem representation vector obtained by the second representation unit and using an attention mechanism to obtain the updated representation vector of each node.

[0063] The second determining unit is used to determine the numerical reasoning answer based on the updated representation vector of each node after a predetermined number of iterations obtained by the iterative unit.

[0064] Thirdly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of the first aspect.

[0065] Fourthly, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method of the first aspect.

[0066] The method and apparatus provided in the embodiments of this specification first obtain the current problem and current text, whereby the current text describes the conditions of the current problem. Then, it is determined not only that the current problem and current text include each number, but also that each entity included within them, and the type corresponding to each number. Next, a relationship network graph is constructed, comprising entity nodes corresponding to each entity and number nodes corresponding to each number. Neighborhoods are formed between number nodes of the same type, and between entity nodes and number nodes with a preset relationship, through connecting edges. The relationship network graph establishes the relationships between entities and numbers with preset relationships. The node representation vectors iterated based on these relationships help distinguish between the relationships between numbers and text. Furthermore, a relationship network graph establishes relationships between numbers of the same type. The node representation vectors iterated based on these relationships help distinguish the types of different numbers. In addition, during the iteration process of the node vectors, iteration is performed based on the question representation vector, reflecting the importance of each node in answering the question. It is understood that nodes related to the question are more important than other nodes, which can effectively guide the iteration process. Correspondingly, the node representation vectors iterated based on these relationships can reflect the importance of different nodes. Finally, based on the updated representation vectors of each node after the predetermined number of iterations, the numerical reasoning answer is determined, which can better solve complex problems and thus improve the ability of machine reading comprehension to handle complex problems through numerical reasoning. Attached Figure Description

[0067] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0068] Figure 1 This is a schematic diagram illustrating an implementation scenario of one embodiment disclosed in this specification;

[0069] Figure 2 A flowchart of a numerical reasoning method in machine reading comprehension according to one embodiment is shown;

[0070] Figure 3 A schematic diagram of the structure of a relational network diagram according to one embodiment is shown;

[0071] Figure 4 A schematic diagram illustrating the encoded output of a language model according to one embodiment is shown.

[0072] Figure 5 This diagram illustrates a multi-iteration process according to one embodiment;

[0073] Figure 6 A schematic diagram illustrating a method for determining a second semantic representation vector according to one embodiment is shown.

[0074] Figure 7 This diagram illustrates the answer prediction process according to one embodiment.

[0075] Figure 8 A schematic block diagram of a numerical reasoning apparatus in machine reading comprehension according to one embodiment is shown. Detailed Implementation

[0076] The solution provided in this specification will now be described with reference to the accompanying drawings.

[0077] Figure 1 This is a schematic diagram illustrating an implementation scenario of one embodiment disclosed in this specification. This implementation scenario relates to numerical reasoning in machine reading comprehension. (Refer to...) Figure 1 Understandably, numerical reasoning requires answers based on conditions and questions. In machine reading comprehension, conditions are given through text, meaning the conditions of the question are described in text. Different texts will typically yield different answers to the same question. For example, text 1 (condition 1) states: Xiaohong has 5 yuan, Xiaoming has 3 yuan, and the question is: How much money do Xiaohong and Xiaoming have in total? Using addition, the answer to the question under the conditions described in text 1 is 8 yuan. Text 2 (condition 2) states: Xiaohong has 2 yuan, Xiaoming has 3 yuan, and the question is: How much money do Xiaohong and Xiaoming have in total? Using addition, the answer to the question under the conditions described in text 2 is 5 yuan. Under the same conditions, different questions usually yield different answers. For example, if the text states that Xiaohong has 5 yuan and Xiaoming has 3 yuan, and question 1 is how much money Xiaohong and Xiaoming have in total, then by addition, the answer to question 1 under the conditions described in the text is 8 yuan. If the text states that Xiaohong has 5 yuan and Xiaoming has 3 yuan, and question 2 is how much more money Xiaohong has than Xiaoming, then by subtraction, the answer to question 2 under the conditions described in the text is 2 yuan.

[0078] It should be noted that the text and questions described above are merely illustrative examples and are not intended to limit the text and questions in the embodiments of this specification. The numerical reasoning methods in machine reading comprehension provided in the embodiments of this specification can be applied to various numerical reasoning problems in various scenarios. In addition to the arithmetic expression problems mentioned above, they can also include answer extraction, counting problems, etc.

[0079] Figure 2 This diagram illustrates a flowchart of a numerical reasoning method in machine reading comprehension according to one embodiment, which can be based on... Figure 1 The implementation scenario is shown. For example... Figure 2 As shown, the numerical reasoning method in machine reading comprehension in this embodiment includes the following steps: Step 21, obtaining the current question and current text, wherein the current text describes the conditions of the current question; Step 22, determining the entities and numbers included in the current question and current text, and the types corresponding to each number; Step 23, constructing a relational network graph, wherein the relational network graph includes entity nodes corresponding to each entity and number nodes corresponding to each number, and neighboring entities are formed between number nodes of the same type and between entity nodes and number nodes with a preset relationship through connecting edges; Step 24, inputting the current question and current text into a language model, and through the... The language model obtains the first semantic representation vectors corresponding to the current question and the positions of each semantic element in the current text; step 25, based on each first semantic representation vector, determines the first question representation vector corresponding to the current question, and the initial representation vector of each node in the relational network graph; step 26, based on the initial representation vector of each node, iterates each node in the relational network graph a predetermined number of times, each iteration including, for each node, aggregating neighbor nodes based on the first question representation vector and using an attention mechanism to obtain the updated representation vector of each node; step 27, based on the updated representation vector of each node after the predetermined number of iterations, determines the numerical reasoning answer. The specific execution method of each of the above steps is described below.

[0080] First, in step 21, the current question and current text are obtained, whereby the current text describes the conditions of the current question. It is understood that both the current question and the current text are typically related to numbers, or at least one of them is related to numbers; both the current question and the current text may contain numbers, or one of them may contain numbers.

[0081] In the embodiments described in this specification, the current text can be a paragraph or an article, and there is no limitation on the length of the current text.

[0082] Then, in step 22, the entities and numbers included in the current question and the current text, as well as the type corresponding to each number, are determined. It is understood that this step can be achieved using existing Chinese word segmentation tools.

[0083] In one example, the type includes at least one of the following:

[0084] Amount, time, percentage.

[0085] For example, the number 1 in "1 yuan" corresponds to the type of amount; the number 2019 in "2019" corresponds to the type of time; and the number 50 in "discount of 50%" corresponds to the type of percentage.

[0086] In one example, the entity includes at least one of the following:

[0087] Names of people, places, and items.

[0088] For example, the entities in the text "Xiaohong went to Hainan last month and bought 5 jin of bananas" include Xiaohong, Hainan, and bananas. Here, Xiaohong is a personal name, Hainan is a place name, and bananas are the name of the item.

[0089] Next, in step 23, a relationship network graph is constructed. This graph includes entity nodes corresponding to each entity and number nodes corresponding to each number. Neighborhoods are formed between number nodes of the same type, and between entity nodes and number nodes with a preset relationship, through connecting edges. It can be understood that step 23 constructs the relationship network graph based on the entities and numbers determined in step 22, and the types corresponding to each number.

[0090] For example, if two number nodes correspond to numbers that are both monetary, or both time, or both percentages, then these two number nodes have a connecting edge, meaning that these two number nodes are neighbors.

[0091] In one example, the aforementioned preset relationship refers to the relationship between the entity corresponding to the entity node and the number corresponding to the number node in the semantic element position within the current question or text. For instance, the preset relationship could mean that the entity corresponding to the entity node and the number corresponding to the number node belong to the same sentence in the current question or text.

[0092] Figure 3 A schematic diagram of a relational network diagram according to one embodiment is shown. (Refer to...) Figure 3The relationship network diagram includes entity nodes S1, S2, S3, and S4, and numeric nodes J1, J2, T1, and T2. Numeric nodes J1 and J2 both correspond to monetary amounts, and are connected by an edge. Numeric nodes T1 and T2 both correspond to time amounts, and are connected by an edge. Entity node S1 and numeric node J2 have a pre-defined relationship, and are connected by an edge. Entity node S1 and numeric node T1 have a pre-defined relationship, and are connected by an edge. Entity node S2 and numeric node J1 have a pre-defined relationship, and are connected by an edge. Entity nodes S3 and S4 do not have any pre-defined relationships with any numeric node, and are not connected by any numeric node.

[0093] In step 24, the current question and the current text are input into a language model, and the language model obtains the first semantic representation vector corresponding to the position of each semantic element in the current question and the current text. It can be understood that the current question and the current text can be divided into semantic elements, and each semantic element corresponds to a position in the current question and the current text; this position can be called the semantic element position.

[0094] In one example, the language model described above can be implemented based on RoBERTa, by concatenating the current question and the current text and then inputting the concatenation into the language model.

[0095] Figure 4 This diagram illustrates the encoded output of a language model according to one embodiment. (See also...) Figure 4 Input the current question and the current text into the language model, and obtain the first semantic representation vector corresponding to the position of each semantic element in the current question and the current text through the language model. Each small circle corresponds to a semantic element position. The semantic element positions corresponding to the solid small circles filled with black correspond to the entities and numbers determined in step 22, or in other words, to the nodes in step 23.

[0096] In step 25, based on each first semantic representation vector, the first problem representation vector corresponding to the current problem and the initial representation vector of each node in the relational network graph are determined. It is understood that the current problem typically includes several semantic element positions, and the content of any node usually matches several semantic element positions. Therefore, based on the first semantic representation vectors corresponding to each semantic element position, the first problem representation vector corresponding to the current problem and the initial representation vector of each node in the relational network graph can be determined.

[0097] In one example, mean pooling can be performed on each first semantic representation vector corresponding to each semantic element position in the current problem to obtain the first problem representation vector corresponding to the current problem.

[0098] In one example, for any node in the relational network graph, the positions of several semantic elements in the current question and the current text that match the content of that node can be determined, and the several first semantic representation vectors corresponding to the positions of the several semantic elements can be averaged and pooled to determine the initial representation vector of that node.

[0099] In step 26, based on the initial representation vector of each node, a predetermined number of iterations are performed on each node in the relationship network graph. Each iteration includes, for each node, aggregating neighboring nodes based on the first problem representation vector and using an attention mechanism to obtain the updated representation vector of each node. It is understood that since there are connecting edges between digital nodes of the same type in the relationship network graph, and between entity nodes and digital nodes with a preset relationship, the updated representation vector of each node after iteration can also reflect the relationships between these nodes.

[0100] Figure 5 A schematic diagram illustrating a multi-iteration process according to one embodiment is shown. (Refer to...) Figure 5 In the embodiments described in this specification, each node in the relationship network graph is iterated a predetermined number of times. The predetermined number of times can be 2 or 3, etc. Figure 5 The example uses a predetermined iteration count of 2. Here, T represents the current iteration count. When the current iteration count is 1, the node's current representation vector is its initial representation vector. When the current iteration count is 2, the node's current representation vector is its updated representation vector after the first iteration. Based on the first problem representation vector guiding the iteration process, it can be understood that nodes related to the problem are more important in the numerical reasoning process. In T=1, based on the relationship network graph and the first problem representation vector, a subgraph related to the problem can be determined. In T=2, iteration can be performed based on the subgraph determined in T=1.

[0101] In one example, each iteration includes:

[0102] Based on the first problem representation vector, the problem driving vector corresponding to the current iteration number is determined using a neural network corresponding to the current iteration number;

[0103] Based on the initial representation vector, current representation vector, and problem-driving vector of each node, the intermediate vector of each node is determined.

[0104] The intermediate vectors of each node are transformed using the query matrix, key matrix, and value matrix respectively, to obtain the query vector, key vector, and value vector corresponding to each node.

[0105] The similarity between the query vector corresponding to the first node and the key vector corresponding to the second node is calculated to obtain the attention score from the second node to the first node; wherein the first node and the second node are any two nodes that are neighbors in the relational network graph.

[0106] Take any node as the target node, and sum the value vectors of each neighbor according to the attention scores of each neighbor to the target node. Based on the summation result, determine the updated representation vector of the target node.

[0107] It is understandable that the problem-driving vector will be different when the current iteration number is different. Therefore, in the iteration process, that is, in the graph reasoning process, it is necessary to learn the different focuses of the problem for each layer of iteration so that the focus of each layer of reasoning is different.

[0108] Further, the step of determining the problem-driving vector corresponding to the current iteration number using a neural network corresponding to the current iteration number based on the first problem representation vector includes:

[0109] The first problem representation vector is passed through the first fully connected layer to obtain the first feature vector;

[0110] The first feature vector is processed by an activation function to obtain the second feature vector;

[0111] The second feature vector is passed through the second fully connected layer corresponding to the current iteration number to obtain the problem-driving vector corresponding to the current iteration number.

[0112] In the embodiments described in this specification, the first fully connected layer is used to obtain a first feature vector that is different from the distribution of the first problem representation vector space. When obtaining the problem-driving vector corresponding to each current iteration number, the aforementioned first fully connected layer can be shared.

[0113] As an example, the activation function mentioned above can be the ELU activation function.

[0114] Furthermore, determining the intermediate vector of each node based on the initial representation vector, the current representation vector, and the problem-driving vector of each node includes:

[0115] The initial representation vector of each node is concatenated with the current representation vector of each node to obtain the first concatenated vector corresponding to each node.

[0116] After converting the first concatenation vector of each node into a preset dimension, it is multiplied bitwise with the problem-driven vector to obtain the intermediate vector of each node.

[0117] Further, the step of converting the first concatenated vector into a preset dimension includes:

[0118] The first concatenated vector is passed through a third fully connected layer to be transformed into a preset dimension, which is the same as the dimension of the problem-driven vector.

[0119] It is understandable that if vector A is (a1, a2, ..., an) and vector B is (b1, b2, ..., bn), then the result of multiplying vector A and vector B by their positions is (a1b1, a2b2, ..., anbn).

[0120] Furthermore, there are many ways to calculate the similarity between the query vector corresponding to the first node and the key vector corresponding to the second node. For example, the query vector corresponding to the first node can be concatenated with the key vector corresponding to the second node, and then passed through a fully connected layer to obtain the attention score from the second node to the first node.

[0121] To better evaluate the more important nodes among the target node's neighbors, a softmax regression can be performed on the attention score.

[0122] Furthermore, the aforementioned determination of the updated representation vector of the target node based on the summation result can be specifically achieved by concatenating the vector obtained from the summation result with the current representation vector of the target node, and then passing it through a fully connected layer to obtain the updated representation vector of the target node.

[0123] Finally, in step 27, the numerical reasoning answer is determined based on the updated representation vectors of each node after the predetermined number of iterations. It is understood that, compared to the initial representation vectors of each node, the updated representation vectors of each node better reflect the relationship between entities and numbers, as well as the different types of numbers, thus helping to determine the numerical reasoning answer.

[0124] In one example, determining the numerical reasoning answer based on the updated representation vectors of each node after the predetermined number of iterations includes:

[0125] For any node in the relational network graph, determine the positions of several semantic elements in the current question and the current text that match the content of that node, and obtain several first semantic representation vectors corresponding to the positions of the several semantic elements.

[0126] Based on the updated representation vector of any node after the predetermined number of iterations, update the first semantic representation vectors corresponding to the positions of the several semantic elements obtained, so as to determine the second semantic representation vectors corresponding to the positions of the several semantic elements respectively.

[0127] Based on the second semantic representation vectors corresponding to the positions of several semantic elements in the current question and the current text, and the first semantic representation vectors corresponding to the positions of other semantic elements, determine the first comprehensive representation vector corresponding to the current question and the current text.

[0128] Based on the first comprehensive representation vector, the answer type corresponding to the numerical reasoning answer is determined using the first classification model;

[0129] The numerical reasoning answer is determined using a second classification model, based at least on the answer type and the first comprehensive representation vector.

[0130] Figure 6 This diagram illustrates a method for determining a second semantic representation vector according to one embodiment. (Refer to...) Figure 6 The semantic element positions, represented by solid black circles, correspond to nodes in the relational network graph. Only these semantic element positions need to be updated. The update can be achieved by summing the update representation vector with the first semantic representation vector of the corresponding semantic element position to obtain the second semantic representation vector for that position. In this embodiment, a node may correspond to multiple semantic element positions. For example, a number node might correspond to the number 1000, which in turn corresponds to two semantic element positions: the position corresponding to 100 and the position corresponding to 0. In this case, the semantic representation vector corresponding to each semantic element position needs to be updated.

[0131] Figure 7 A schematic diagram illustrating the answer prediction process according to one embodiment is shown. (See also...) Figure 7 In the embodiments of this specification, the updated representation vector of each node is obtained after a predetermined number of iterations. Based on each updated representation vector, the first comprehensive representation vector corresponding to the current question and the current text is determined. Based on the first comprehensive representation vector, the answer type is first determined using a first classification model. Then, based on the first comprehensive representation vector and the answer type, the numerical reasoning answer is determined using a second classification model, which can improve the accuracy of the numerical reasoning answer.

[0132] Furthermore, the answer type includes at least one of the following:

[0133] Answer extraction, counting problems, and arithmetic expression problems.

[0134] Furthermore, the answer type is answer extraction;

[0135] The step of determining the numerical reasoning answer using a second classification model based at least on the answer type and the first comprehensive representation vector includes:

[0136] Based on the second semantic representation vectors corresponding to the positions of several semantic elements in the current problem, and the first semantic representation vectors corresponding to the positions of other semantic elements, the second problem representation vector corresponding to the current problem is determined.

[0137] The first comprehensive representation vector is multiplied bitwise with the second problem representation vector to obtain the first cross representation vector;

[0138] The first comprehensive representation vector and the first cross representation vector are concatenated and input into the second classification model to obtain the numerical reasoning answer.

[0139] Furthermore, the second classification model is used to predict the start position and end position of the answer in each semantic element position, so as to obtain the numerical reasoning answer based on the start position and end position of the answer.

[0140] Furthermore, the answer type is a counting problem;

[0141] The second classification model is used to predict numbers from 0 to 9 to obtain the numerical reasoning answer.

[0142] Furthermore, the answer type is an arithmetic expression problem;

[0143] The second classification model is used to predict the symbol of each number in the current question and the current text, including plus signs, minus signs, and 0, and to obtain a numerical reasoning answer by operating on each number and symbol.

[0144] The method provided in the embodiments of this specification first obtains the current problem and the current text, whereby the current text describes the conditions of the current problem. Then, it is determined not only that the current problem and the current text include each number, but also that they include each entity and the type corresponding to each number. Next, a relationship network graph is constructed, comprising entity nodes corresponding to each entity and number nodes corresponding to each number. Neighborhoods are formed between number nodes of the same type and between entity nodes and number nodes with a preset relationship through connecting edges. The relationship network graph establishes the relationship between entities and numbers with preset relationships. The node representation vectors iterated based on this relationship help distinguish the relationship between numbers and text. Furthermore, a relationship network graph establishes the relationships between numbers of the same type. The node representation vectors iterated based on these relationships help distinguish the types of different numbers. In addition, during the iteration process of the node vectors, the iteration is based on the question representation vector, which reflects the importance of each node in answering the question. It can be understood that the importance of nodes related to the question is higher than that of other nodes, thus effectively guiding the iteration process. Correspondingly, the node representation vectors iterated based on these relationships can reflect the importance of different nodes. Finally, based on the updated representation vectors of each node after the predetermined number of iterations, the numerical reasoning answer is determined, which can better solve complex problems and thus improve the ability of machine reading comprehension to handle complex problems through numerical reasoning.

[0145] According to another embodiment, a numerical reasoning apparatus for machine reading comprehension is also provided, which is used to execute the numerical reasoning method for machine reading comprehension provided in the embodiments of this specification. Figure 8 A schematic block diagram of a numerical reasoning apparatus in machine reading comprehension according to one embodiment is shown. Figure 8 As shown, the device 800 includes:

[0146] Acquisition unit 81 is used to acquire the current question and the current text, wherein the current text is used to describe the conditions of the current question;

[0147] The first determining unit 82 is used to determine the entities and numbers included in the current question and current text acquired by the acquiring unit 81, as well as the types corresponding to each number;

[0148] The construction unit 83 is used to construct a relational network graph, which includes entity nodes corresponding to each entity determined by the first determining unit 82 and digital nodes corresponding to each number. Neighbors are formed between digital nodes of the same type and between entity nodes and digital nodes with a preset relationship through connecting edges.

[0149] The first representation unit 84 is used to input the current question and current text acquired by the acquisition unit 81 into the language model, and obtain the first semantic representation vector corresponding to the position of each semantic element in the current question and current text through the language model;

[0150] The second representation unit 85 is used to determine the first problem representation vector corresponding to the current problem and the initial representation vector of each node in the relational network graph based on the first semantic representation vectors obtained by the first representation unit 84.

[0151] The iteration unit 86 is used to perform a predetermined number of iterations on each node in the relational network graph based on the initial representation vector of each node obtained by the second representation unit 85. Each iteration includes, for each node, performing neighbor node aggregation based on the first problem representation vector obtained by the second representation unit 85 and using an attention mechanism to obtain the updated representation vector of each node.

[0152] The second determining unit 87 is used to determine the numerical reasoning answer based on the updated representation vector of each node after a predetermined number of iterations obtained by the iterating unit 86.

[0153] Optionally, as an embodiment, the type includes at least one of the following:

[0154] Amount, time, percentage.

[0155] Optionally, as an embodiment, the entity includes at least one of the following:

[0156] Names of people, places, and items.

[0157] Optionally, as an embodiment, the second representation unit 85 is specifically used to perform mean pooling on each first semantic representation vector corresponding to each semantic element position in the current problem to obtain the first problem representation vector corresponding to the current problem.

[0158] Optionally, as an embodiment, the second representation unit 85 is specifically used to determine, for any node in the relational network graph, the positions of several semantic elements in the current question and the current text that match the content of that node, and to perform mean pooling on several first semantic representation vectors corresponding to the positions of the several semantic elements to determine the initial representation vector of that node.

[0159] Optionally, as an embodiment, the iteration unit 86 includes:

[0160] The first determining subunit is used to determine the problem driving vector corresponding to the current iteration number based on the first problem representation vector and using a neural network corresponding to the current iteration number.

[0161] The second determining subunit is used to determine the intermediate vector of each node based on the initial representation vector, the current representation vector of each node, and the problem-driving vector determined by the first determining subunit.

[0162] The transformation subunit is used to transform the intermediate vectors of each node determined by the second determining subunit using the query matrix, key matrix and value matrix respectively, to obtain the query vector, key vector and value vector corresponding to each node respectively;

[0163] The similarity calculation subunit is used to calculate the similarity between the query vector corresponding to the first node obtained by the transformation subunit and the key vector corresponding to the second node, so as to obtain the attention score from the second node to the first node; wherein, the first node and the second node are any two nodes that are neighbors in the relational network graph;

[0164] The update subunit is used to take any node as the target node, calculate the attention scores of each neighbor of the target node to the target node based on the similarity calculation subunit, perform a weighted summation on the value vectors of each neighbor obtained by the transformation subunit, and determine the update representation vector of the target node based on the summation result.

[0165] Further, the first determining subunit includes:

[0166] The first transformation module is used to pass the first problem representation vector through the first fully connected layer to obtain the first feature vector;

[0167] An activation module is used to process the first feature vector obtained by the first transformation module through an activation function to obtain a second feature vector;

[0168] The second transformation module is used to pass the second feature vector obtained by the activation module through the second fully connected layer corresponding to the current iteration number to obtain the problem-driven vector corresponding to the current iteration number.

[0169] Further, the second determining subunit includes:

[0170] The concatenation module is used to concatenate the initial representation vector of each node with the current representation vector of each node to obtain the first concatenation vector corresponding to each node.

[0171] The intermediate transformation module is used to transform the first splicing vector of each node obtained by the splicing module into a preset dimension, and then multiply it bitwise with the problem-driven vector to obtain the intermediate vector of each node.

[0172] Furthermore, the intermediate transformation module is specifically used to transform the first concatenated vector through a third fully connected layer into a preset dimension, the preset dimension being the same as the dimension of the problem-driven vector.

[0173] Optionally, as an embodiment, the second determining unit 87 includes:

[0174] The acquisition module is used to determine, for any node in the relational network graph, the positions of several semantic elements in the current question and the current text that match the content of any node, and to acquire several first semantic representation vectors corresponding to the positions of the several semantic elements.

[0175] The update module is used to update the first semantic representation vectors corresponding to the positions of the semantic elements obtained by the acquisition module according to the update representation vector of any node after the predetermined number of iterations, so as to determine the second semantic representation vectors corresponding to the positions of the semantic elements respectively.

[0176] The comprehensive representation module is used to determine the first comprehensive representation vector corresponding to the current question and the current text based on the second semantic representation vectors corresponding to the positions of several semantic elements in the current question and the current text obtained by the update module, and the first semantic representation vectors corresponding to the positions of other semantic elements.

[0177] The first determining module is used to determine the answer type corresponding to the numerical reasoning answer based on the first comprehensive representation vector obtained by the comprehensive representation module and using the first classification model.

[0178] The second determining module is used to determine the numerical reasoning answer using a second classification model, based at least on the answer type determined by the first determining module and the first comprehensive representation vector.

[0179] Furthermore, the answer type includes at least one of the following:

[0180] Answer extraction, counting problems, and arithmetic expression problems.

[0181] Furthermore, the answer type is answer extraction;

[0182] The second determining module is specifically used for:

[0183] Based on the second semantic representation vectors corresponding to the positions of several semantic elements in the current problem, and the first semantic representation vectors corresponding to the positions of other semantic elements, the second problem representation vector corresponding to the current problem is determined.

[0184] The first comprehensive representation vector is multiplied bitwise with the second problem representation vector to obtain the first cross representation vector;

[0185] The first comprehensive representation vector and the first cross representation vector are concatenated and input into the second classification model to obtain the numerical reasoning answer.

[0186] Furthermore, the second classification model is used to predict the start position and end position of the answer in each semantic element position, so as to obtain the numerical reasoning answer based on the start position and end position of the answer.

[0187] Furthermore, the answer type is a counting problem;

[0188] The second classification model is used to predict numbers from 0 to 9 to obtain the numerical reasoning answer.

[0189] Furthermore, the answer type is an arithmetic expression problem;

[0190] The second classification model is used to predict the symbol of each number in the current question and the current text, including plus signs, minus signs, and 0, and to obtain a numerical reasoning answer by operating on each number and symbol.

[0191] Using the apparatus provided in the embodiments of this specification, firstly, the acquisition unit 81 acquires the current question and the current text, the current text being used to describe the conditions of the current question; then, the first determination unit 82 not only determines that the current question and the current text include each number, but also determines each entity included therein, and the type corresponding to each number; next, the construction unit 83 constructs a relational network graph, the relational network graph including entity nodes corresponding to each entity and number nodes corresponding to each number, and neighboring nodes are formed between number nodes of the same type, and between entity nodes and number nodes with a preset relationship, through connecting edges; the relational network graph establishes the relationship between entities and numbers with preset relationships, and the iteration unit 86, based on the node representation vectors iterated by this relationship, helps to distinguish... The relationship between numbers and text is established; and relationships between numbers of the same type are established through a relationship network graph. The node representation vectors iterated based on this relationship help distinguish the types of different numbers. In addition, during the iteration process of the node vectors, the iteration is based on the question representation vector, which reflects the importance of each node in answering the question. It can be understood that the importance of nodes related to the question is higher than that of other nodes, which can effectively guide the iteration process. Accordingly, the node representation vectors iterated based on this relationship can reflect the importance of different nodes. Finally, the second determining unit 87 determines the numerical reasoning answer based on the updated representation vectors of each node after the predetermined number of iterations, which can better solve complex problems and thus improve the ability of machine reading comprehension to handle complex problems through numerical reasoning.

[0192] According to another embodiment, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed in a computer, causes the computer to perform a combination Figure 2 The method described.

[0193] According to another embodiment, a computing device is also provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements a combination... Figure 2 The method described.

[0194] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.

[0195] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.

Claims

1. A numerical reasoning method for machine reading comprehension, the method comprising: Obtain the current question and the current text, where the current text describes the conditions of the current question; Determine the current question and each entity and number included in the current text, as well as the type corresponding to each number; A relational network graph is constructed, which includes entity nodes corresponding to each entity and number nodes corresponding to each number. Neighbors are formed between number nodes of the same type and between entity nodes and number nodes with a preset relationship through connecting edges. The preset relationship is the relationship between the semantic element positions of the entity corresponding to the entity node and the number corresponding to the number node in the current question or the current text. Input the current question and the current text into a language model, and obtain the first semantic representation vector corresponding to the position of each semantic element in the current question and the current text through the language model; Based on each first semantic representation vector, determine the first problem representation vector corresponding to the current problem, and the initial representation vector of each node in the relational network graph; Based on the initial representation vector of each node, the nodes in the relational network graph are iterated a predetermined number of times. Each iteration includes, for each node, aggregating neighbor nodes based on the first problem representation vector and using an attention mechanism to obtain the updated representation vector of each node, so that the updated representation vector reflects the importance of different nodes, wherein the nodes related to the problem are more important than other nodes. The numerical reasoning answer is determined based on the updated representation vector of each node after the predetermined number of iterations.

2. The method as described in claim 1, wherein, The type includes at least one of the following: Amount, time, percentage.

3. The method as described in claim 1, wherein, The entity includes at least one of the following: Names of people, places, and items.

4. The method of claim 1, wherein, The step of determining the first question representation vector corresponding to the current question based on each first semantic representation vector includes: The first semantic representation vector corresponding to each semantic element position in the current problem is subjected to mean pooling to obtain the first problem representation vector corresponding to the current problem.

5. The method of claim 1, wherein, The step of determining the initial representation vector of each node in the relational network graph based on each first semantic representation vector includes: For any node in the relational network graph, determine the positions of several semantic elements in the current question and the current text that match the content of that node, and perform mean pooling on several first semantic representation vectors corresponding to the positions of the several semantic elements to determine the initial representation vector of that node.

6. The method of claim 1, wherein, Each iteration includes: Based on the first problem representation vector, the problem driving vector corresponding to the current iteration number is determined using a neural network corresponding to the current iteration number; Based on the initial representation vector, current representation vector, and problem-driving vector of each node, the intermediate vector of each node is determined. The intermediate vectors of each node are transformed using the query matrix, key matrix, and value matrix respectively, to obtain the query vector, key vector, and value vector corresponding to each node. The similarity between the query vector corresponding to the first node and the key vector corresponding to the second node is calculated to obtain the attention score from the second node to the first node; wherein the first node and the second node are any two nodes that are neighbors in the relational network graph. Take any node as the target node, and sum the value vectors of each neighbor according to the attention scores of each neighbor to the target node. Based on the summation result, determine the updated representation vector of the target node.

7. The method of claim 6, wherein, The step of determining the problem-driving vector corresponding to the current iteration number using a neural network based on the first problem representation vector includes: The first problem representation vector is passed through the first fully connected layer to obtain the first feature vector; The first feature vector is processed by an activation function to obtain the second feature vector; The second feature vector is passed through the second fully connected layer corresponding to the current iteration number to obtain the problem-driving vector corresponding to the current iteration number.

8. The method of claim 6, wherein, The process of determining the intermediate vector for each node based on the initial representation vector, the current representation vector, and the problem-driven vector includes: The initial representation vector of each node is concatenated with the current representation vector of each node to obtain the first concatenated vector corresponding to each node. After converting the first concatenation vector of each node into a preset dimension, it is multiplied bitwise with the problem-driven vector to obtain the intermediate vector of each node.

9. The method of claim 8, wherein, The step of converting the first concatenated vector into a preset dimension includes: The first concatenated vector is passed through a third fully connected layer to be transformed into a preset dimension, which is the same as the dimension of the problem-driven vector.

10. The method of claim 1, wherein, The step of determining the numerical reasoning answer based on the updated representation vectors of each node after the predetermined number of iterations includes: For any node in the relational network graph, determine the positions of several semantic elements in the current question and the current text that match the content of that node, and obtain several first semantic representation vectors corresponding to the positions of the several semantic elements. Based on the updated representation vector of any node after the predetermined number of iterations, update the first semantic representation vectors corresponding to the positions of the several semantic elements obtained, so as to determine the second semantic representation vectors corresponding to the positions of the several semantic elements respectively. Based on the second semantic representation vectors corresponding to the positions of several semantic elements in the current question and the current text, and the first semantic representation vectors corresponding to the positions of other semantic elements, determine the first comprehensive representation vector corresponding to the current question and the current text. Based on the first comprehensive representation vector, the answer type corresponding to the numerical reasoning answer is determined using the first classification model; The numerical reasoning answer is determined using a second classification model, based at least on the answer type and the first comprehensive representation vector.

11. The method of claim 10, wherein, The answer type includes at least one of the following: Answer extraction, counting problems, and arithmetic expression problems.

12. The method of claim 10, wherein, The answer type is answer extraction; The step of determining the numerical reasoning answer using a second classification model based at least on the answer type and the first comprehensive representation vector includes: Based on the second semantic representation vectors corresponding to the positions of several semantic elements in the current problem, and the first semantic representation vectors corresponding to the positions of other semantic elements, the second problem representation vector corresponding to the current problem is determined. The first comprehensive representation vector is multiplied bitwise with the second problem representation vector to obtain the first cross representation vector; The first comprehensive representation vector and the first cross representation vector are concatenated and input into the second classification model to obtain the numerical reasoning answer.

13. The method of claim 12, wherein, The second classification model is used to predict the start position and end position of the answer in each semantic element position, so as to obtain the numerical reasoning answer based on the start position and end position of the answer.

14. The method of claim 10, wherein, The answer type is a counting problem; The second classification model is used to predict numbers from 0 to 9 to obtain the numerical reasoning answer.

15. The method of claim 10, wherein, The answer type is an arithmetic expression question; The second classification model is used to predict the symbol of each number in the current question and the current text, including plus signs, minus signs, and 0, and to obtain a numerical reasoning answer by operating on each number and symbol.

16. A numerical reasoning device for machine reading comprehension, the device comprising: The acquisition unit is used to acquire the current question and the current text, wherein the current text is used to describe the conditions of the current question; The first determining unit is used to determine the entities and numbers included in the current question and current text acquired by the acquiring unit, as well as the types corresponding to each number; A construction unit is used to construct a relational network graph, which includes entity nodes corresponding to each entity determined by the first determining unit and number nodes corresponding to each number. Neighbors are formed between number nodes of the same type and between entity nodes and number nodes with a preset relationship through connecting edges. The preset relationship is the relationship between the semantic element positions of the entity corresponding to the entity node and the number corresponding to the number node in the current question or current text. The first representation unit is used to input the current question and current text acquired by the acquisition unit into the language model, and obtain the first semantic representation vector corresponding to the position of each semantic element in the current question and current text through the language model; The second representation unit is used to determine the first problem representation vector corresponding to the current problem and the initial representation vector of each node in the relational network graph based on the first semantic representation vectors obtained by the first representation unit. An iterative unit is used to iterate each node in the relational network graph a predetermined number of times based on the initial representation vector of each node obtained by the second representation unit. Each iteration includes, for each node, using the first problem representation vector obtained by the second representation unit and using an attention mechanism to aggregate neighbor nodes to obtain the updated representation vector of each node, so that the updated representation vector reflects the importance of different nodes, wherein the importance of nodes related to the problem is higher than that of other nodes. The second determining unit is used to determine the numerical reasoning answer based on the updated representation vector of each node after a predetermined number of iterations obtained by the iterative unit.

17. The apparatus of claim 16, wherein, The type includes at least one of the following: Amount, time, percentage.

18. The apparatus of claim 16, wherein, The entity includes at least one of the following: Names of people, places, and items.

19. The apparatus of claim 16, wherein, The second representation unit is specifically used to perform mean pooling on each first semantic representation vector corresponding to each semantic element position in the current problem to obtain the first problem representation vector corresponding to the current problem.

20. The apparatus of claim 16, wherein, The second representation unit is specifically used to determine, for any node in the relational network graph, the positions of several semantic elements in the current question and the current text that match the content of that node, and to perform mean pooling on several first semantic representation vectors corresponding to the positions of the several semantic elements to determine the initial representation vector of that node.

21. The apparatus of claim 16, wherein, The iterative unit includes: The first determining subunit is used to determine the problem driving vector corresponding to the current iteration number based on the first problem representation vector and using a neural network corresponding to the current iteration number. The second determining subunit is used to determine the intermediate vector of each node based on the initial representation vector, the current representation vector of each node and the problem-driving vector determined by the first determining subunit. The transformation subunit is used to transform the intermediate vectors of each node determined by the second determining subunit using the query matrix, key matrix and value matrix respectively, to obtain the query vector, key vector and value vector corresponding to each node respectively; The similarity calculation subunit is used to calculate the similarity between the query vector corresponding to the first node obtained by the transformation subunit and the key vector corresponding to the second node, so as to obtain the attention score from the second node to the first node; wherein, the first node and the second node are any two nodes that are neighbors in the relational network graph; The update subunit is used to take any node as the target node, calculate the attention scores of each neighbor of the target node to the target node based on the similarity calculation subunit, perform a weighted summation on the value vectors of each neighbor obtained by the transformation subunit, and determine the update representation vector of the target node based on the summation result.

22. The apparatus of claim 21, wherein, The first determining subunit includes: The first transformation module is used to pass the first problem representation vector through the first fully connected layer to obtain the first feature vector; The activation module is used to process the first feature vector obtained by the first transformation module through an activation function to obtain a second feature vector; The second transformation module is used to pass the second feature vector obtained by the activation module through the second fully connected layer corresponding to the current iteration number to obtain the problem-driven vector corresponding to the current iteration number.

23. The apparatus of claim 21, wherein, The second determining subunit includes: The concatenation module is used to concatenate the initial representation vector of each node with the current representation vector of each node to obtain the first concatenation vector corresponding to each node. The intermediate transformation module is used to transform the first splicing vector of each node obtained by the splicing module into a preset dimension, and then multiply it bitwise with the problem-driven vector to obtain the intermediate vector of each node.

24. The apparatus of claim 23, wherein, The intermediate transformation module is specifically used to transform the first concatenated vector through a third fully connected layer into a preset dimension, which is the same as the dimension of the problem-driven vector.

25. The apparatus of claim 16, wherein, The second determining unit includes: The acquisition module is used to determine, for any node in the relational network graph, the positions of several semantic elements in the current question and the current text that match the content of any node, and to acquire several first semantic representation vectors corresponding to the positions of the several semantic elements. The update module is used to update the first semantic representation vectors corresponding to the positions of the semantic elements obtained by the acquisition module according to the update representation vector of any node after the predetermined number of iterations, so as to determine the second semantic representation vectors corresponding to the positions of the semantic elements respectively. The comprehensive representation module is used to determine the first comprehensive representation vector corresponding to the current question and the current text based on the second semantic representation vectors corresponding to the positions of several semantic elements in the current question and the current text obtained by the update module, and the first semantic representation vectors corresponding to the positions of other semantic elements. The first determining module is used to determine the answer type corresponding to the numerical reasoning answer based on the first comprehensive representation vector obtained by the comprehensive representation module and using the first classification model. The second determining module is used to determine the numerical reasoning answer using a second classification model, based at least on the answer type determined by the first determining module and the first comprehensive representation vector.

26. The apparatus of claim 25, wherein, The answer type includes at least one of the following: Answer extraction, counting problems, and arithmetic expression problems.

27. The apparatus of claim 25, wherein, The answer type is answer extraction; The second determining module is specifically used for: Based on the second semantic representation vectors corresponding to the positions of several semantic elements in the current problem, and the first semantic representation vectors corresponding to the positions of other semantic elements, the second problem representation vector corresponding to the current problem is determined. The first comprehensive representation vector is multiplied bitwise with the second problem representation vector to obtain the first cross representation vector; The first comprehensive representation vector and the first cross representation vector are concatenated and input into the second classification model to obtain the numerical reasoning answer.

28. The apparatus of claim 27, wherein, The second classification model is used to predict the start position and end position of the answer in each semantic element position, so as to obtain the numerical reasoning answer based on the start position and end position of the answer.

29. The apparatus of claim 25, wherein, The answer type is a counting problem; The second classification model is used to predict numbers from 0 to 9 to obtain the numerical reasoning answer.

30. The apparatus of claim 25, wherein, The answer type is an arithmetic expression question; The second classification model is used to predict the symbol of each number in the current question and the current text, including plus signs, minus signs, and 0, and to obtain a numerical reasoning answer by operating on each number and symbol.

31. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-15.

32. A computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of claims 1-15.

Citation Information

Patent Citations

  • Knowledge map extension model, structured knowledge storage method and device

    CN109325038A

  • Address information feature extraction method based on deep neural network model

    CN110377686A

  • Question and answer processing method and device based on artificial intelligence, apparatus and storage medium

    CN110674279A

  • Numerical reasoning methods and devices in machine reading comprehension

    CN111737419B