Method and device for determining predicted answers, and method and device for reading comprehension

By constructing graph network layers and graph convolutional network layers, combined with attention layers and sequence labeling functions, the problems of low training efficiency and low accuracy of machine reading comprehension models in existing technologies are solved, achieving more efficient and accurate answer prediction.

CN113792550BActive Publication Date: 2024-09-24BEIJING KINGSOFT DIGITAL ENTERTAINMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111110989.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-08
Publication Date
2024-09-24
Estimated Expiration
2041-04-08

AI Technical Summary

Technical Problem

In existing technologies, the training methods for machine reading comprehension models only consider the relationship between questions and answers, which is relatively simple. This results in low training efficiency and low accuracy, and cannot be effectively applied to answers from different texts.

Method used

By constructing an initial first graph network of sample text fragments and sample answers, and an initial second graph network of sample questions and sample answers, the relationships are extracted using graph convolutional network layers, and the predicted answers are determined through attention layers and sequence labeling functions until the training stopping condition is met.

Benefits of technology

It improves the accuracy and training efficiency of the reading comprehension model in performing reading comprehension tasks, and is better able to predict answers for different texts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113792550B
    Figure CN113792550B
Patent Text Reader

Abstract

The present application provides a method and device for determining a predicted answer, and a method and device for reading comprehension, wherein the method for determining the predicted answer includes: converting the value of each dimension of the target hidden layer feature vector into at least one predicted probability through a sequence labeling function, wherein each dimension of the target hidden layer feature vector corresponds to a word unit, and the at least one predicted probability corresponding to each dimension represents the probability that the predicted label of the word unit corresponding to each dimension is at least one label; determining the predicted label of the word unit corresponding to each dimension based on the at least one predicted probability corresponding to each dimension; and determining the predicted answer based on the predicted label of the word unit corresponding to each dimension. Through the above-mentioned sequence labeling method, the predicted label of each word unit can be determined, and the predicted answer can be determined based on the predicted label. When adjusting the model parameters, the predicted label of the correct predicted answer can be made closer to the correct label. This method can improve the training efficiency and usage accuracy of the reading comprehension model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of natural language processing technology, and in particular to a method and device for determining a predicted answer, a method and device for reading comprehension, a computing device, and a computer-readable storage medium. Background Art

[0002] Machine reading comprehension is a research that is dedicated to teaching machines to read human language and understand its connotation. With the development of natural language processing technology, machine reading comprehension has been widely used as a hot direction in the field of natural language processing. Machine reading comprehension tasks focus more on understanding text and learning relevant information from the text so that questions related to the text can be answered.

[0003] In the prior art, the method of training a machine to understand text is mainly to construct a model to be trained, and by training the model to be trained, a reading comprehension model that meets the requirements is obtained, so that the reading comprehension model can complete the reading comprehension task as accurately as possible. Specifically, sample questions and sample answers can be input into the model to be trained as training samples, and the model to be trained can output predicted answers. The model to be trained is optimized according to the difference between the predicted answers and the sample answers, so as to obtain the desired reading comprehension model.

[0004] However, the above method only considers the correlation between questions and answers, which is relatively simple. Some questions can be applicable to different texts, and the answers obtained for different texts are different. In addition, the above method directly determines the predicted answers based on sample questions and sample answers, and considers the sample questions and sample answers as a whole. The accuracy of the predicted answers is low, which may lead to an increase in the number of model training times. Therefore, the training efficiency of the reading comprehension model trained by the above method is low, and the accuracy of the trained reading comprehension model in performing reading comprehension tasks may be low. Summary of the invention

[0005] In view of this, the embodiment of the present application provides a method for determining a predicted answer. The present application also relates to a method for training a reading comprehension model, a reading comprehension method, a device for determining a predicted answer, a device for training a reading comprehension model, a reading comprehension device, a computing device, and a computer-readable storage medium to solve the technical defects existing in the prior art.

[0006] According to a first aspect of an embodiment of the present application, a method for training a reading comprehension model is provided, comprising:

[0007] Constructing an initial first graph network of sample text segments and sample answers through a graph construction network layer of a reading comprehension model, and constructing an initial second graph network of sample questions and the sample answers;

[0008] Input the sample text segment, the sample question and the sample answer into the text processing layer of the reading comprehension model, and add attention values ​​to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain a first graph network and a second graph network;

[0009] Inputting the first graph network and the second graph network into the graph convolutional network layer of the reading comprehension model to obtain a predicted answer;

[0010] The reading comprehension model is trained based on the difference between the predicted answer and the sample answer until a training stop condition is reached.

[0011] According to a second aspect of the embodiment of the present application, a reading comprehension method is provided, comprising:

[0012] Constructing an initial first graph network of a target text and a target answer through a graph construction network layer of a reading comprehension model, and constructing an initial second graph network of a target question and the target answer, wherein the reading comprehension model is trained by the method described in the first aspect above;

[0013] Inputting the target text, the target question and the target answer into the text processing layer of the reading comprehension model, adding attention values ​​to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain a first graph network and a second graph network;

[0014] The first graph network and the second graph network are input into the graph convolutional network layer of the reading comprehension model to obtain an answer to the target question.

[0015] According to a third aspect of an embodiment of the present application, a method for determining a predicted answer is provided, comprising:

[0016] The value of each dimension of the target hidden layer feature vector is converted into at least one prediction probability by a sequence labeling function, wherein each dimension of the target hidden layer feature vector corresponds to a word unit, and the at least one prediction probability corresponding to each dimension represents the probability that the predicted label of the word unit corresponding to each dimension is at least one label;

[0017] Determine a predicted label of a word unit corresponding to each dimension based on at least one predicted probability corresponding to each dimension;

[0018] A predicted answer is determined based on the predicted labels of the word units corresponding to each dimension.

[0019] According to a fourth aspect of the embodiments of the present application, another reading comprehension method is provided, comprising:

[0020] Constructing an initial first graph network of a target text and a target answer through a graph construction network layer of a reading comprehension model, and constructing an initial second graph network of a target question and the target answer, wherein the reading comprehension model is trained by the method described in the first aspect or the third aspect above;

[0021] Inputting the target text, the target question and the target answer into the text processing layer of the reading comprehension model, adding attention values ​​to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain a first graph network and a second graph network;

[0022] Inputting the first graph network and the second graph network into the graph convolutional network layer of the reading comprehension model to determine a target hidden layer feature vector;

[0023] The value of each dimension of the target hidden layer feature vector is converted into at least one probability by a sequence labeling function, wherein each dimension of the target hidden layer feature vector corresponds to a word unit, and the at least one probability corresponding to each dimension represents the probability that the label of the word unit corresponding to each dimension is at least one label;

[0024] Determine a label of a word unit corresponding to each dimension based on at least one probability corresponding to each dimension;

[0025] The answer to the target question is determined based on the labels of the word units corresponding to each dimension.

[0026] According to a fifth aspect of an embodiment of the present application, a device for determining a predicted answer is provided, comprising:

[0027] A first conversion module is configured to convert the value of each dimension of the target hidden layer feature vector into at least one prediction probability through a sequence labeling function, wherein each dimension of the target hidden layer feature vector corresponds to a word unit, and the at least one prediction probability corresponding to each dimension represents the probability that the predicted label of the word unit corresponding to each dimension is at least one label;

[0028] A first determination module is configured to determine a predicted label of a word unit corresponding to each dimension based on at least one predicted probability corresponding to each dimension;

[0029] The second determination module is configured to determine a predicted answer based on the predicted label of the word unit corresponding to each dimension.

[0030] According to a sixth aspect of an embodiment of the present application, a reading comprehension device is provided, comprising:

[0031] A graph network construction module, configured to construct an initial first graph network of a target text and a target answer through a graph construction network layer of a reading comprehension model, and to construct an initial second graph network of a target question and the target answer, wherein the reading comprehension model is trained by the method described in the first aspect or the third aspect above;

[0032] A text processing module is configured to input the target text, the target question and the target answer into the text processing layer of the reading comprehension model, and add attention values ​​to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain a first graph network and a second graph network;

[0033] A third determination module is configured to input the first graph network and the second graph network into the graph convolutional network layer of the reading comprehension model to determine a target hidden layer feature vector;

[0034] A second conversion module is configured to convert the value of each dimension of the target hidden layer feature vector into at least one probability through a sequence labeling function, wherein each dimension of the target hidden layer feature vector corresponds to a word unit, and the at least one probability corresponding to each dimension represents the probability that the label of the word unit corresponding to each dimension is at least one label;

[0035] a fourth determination module, configured to determine a label of a word unit corresponding to each dimension based on at least one probability corresponding to each dimension;

[0036] The fifth determination module is configured to determine the answer to the target question based on the labels of the word units corresponding to each dimension.

[0037] According to a seventh aspect of an embodiment of the present application, a training device for a reading comprehension model is provided, comprising:

[0038] A first graph network construction module, configured to construct an initial first graph network of sample text segments and sample answers through a graph construction network layer of a reading comprehension model, and to construct an initial second graph network of sample questions and the sample answers;

[0039] A first text processing module is configured to input the sample text segment, the sample question and the sample answer into the text processing layer of the reading comprehension model, and add attention values ​​to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain a first graph network and a second graph network;

[0040] A prediction module, configured to input the first graph network and the second graph network into a graph convolutional network layer of the reading comprehension model to obtain a predicted answer;

[0041] The training module is configured to train the reading comprehension model based on the difference between the predicted answer and the sample answer until a training stop condition is reached.

[0042] According to an eighth aspect of the embodiments of the present application, a reading comprehension device is provided, comprising:

[0043] A second graph network construction module is configured to construct an initial first graph network of a target text and a target answer through a graph construction network layer of a reading comprehension model, and to construct an initial second graph network of a target question and the target answer;

[0044] A second text processing module is configured to input the target text, the target question and the target answer into the text processing layer of the reading comprehension model, and add attention values ​​to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain a first graph network and a second graph network;

[0045] A determination module is configured to input the first graph network and the second graph network into the graph convolutional network layer of the reading comprehension model to determine the answer to the target question.

[0046] According to the ninth aspect of the embodiments of the present application, a computing device is provided, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein when the processor executes the instructions, the steps of the method described in the first aspect, the second aspect, the third aspect, or the fourth aspect are implemented.

[0047] According to the tenth aspect of the embodiments of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the method described in the first aspect, the second aspect, the third aspect or the fourth aspect are implemented.

[0048] According to an eleventh aspect of the embodiments of the present application, a chip is provided, which stores computer instructions. When the instructions are executed by the chip, the steps of the method described in the first aspect, the second aspect, the third aspect or the fourth aspect are implemented.

[0049] In an embodiment of the present application, an initial first graph network of sample text segments and sample answers is constructed through the graph construction network layer of the reading comprehension model, and an initial second graph network of sample questions and the sample answers is constructed; the sample text segments, the sample questions and the sample answers are input into the text processing layer of the reading comprehension model, and attention values ​​are added to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain a first graph network and a second graph network; the first graph network and the second graph network are input into the graph convolution network layer of the reading comprehension model to obtain a predicted answer; the reading comprehension model is trained based on the difference between the predicted answer and the sample answer until the training stop condition is reached. Through the method of the present application, the feature vectors of sample text segments, sample questions and sample answers can be effectively utilized to extract the correlation between the three, and the reading comprehension model is trained in combination with the correlation between the sample text segments, sample questions and sample answers, which can improve the accuracy of the reading comprehension model in performing reading comprehension tasks.

[0050] In an embodiment of the present application, the value of each dimension of the target hidden feature vector is converted into at least one prediction probability through a sequence labeling function, wherein each dimension of the target hidden feature vector corresponds to a word unit, and the at least one prediction probability corresponding to each dimension represents the probability that the predicted label of the word unit corresponding to each dimension is at least one label; the predicted label of the word unit corresponding to each dimension is determined based on the at least one prediction probability corresponding to each dimension; the predicted answer is determined based on the predicted label of the word unit corresponding to each dimension. Through the above-mentioned sequence labeling method, the predicted label of each word unit can be determined, and the predicted answer can be determined based on the predicted label. When adjusting the model parameters, the predicted label of the correct predicted answer can be made closer to the correct label. This method can improve the training efficiency and usage accuracy of the reading comprehension model. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 is a structural block diagram of a computing device provided by an embodiment of the present application;

[0052] Figure 2 is a flow chart of a method for training a reading comprehension model provided in one embodiment of the present application;

[0053] Figure 3 It is a data flow diagram between layers of a reading comprehension model during model training provided by an embodiment of the present application;

[0054] Figure 4 is a schematic diagram of an initial third graph network provided by an embodiment of the present application;

[0055] Figure 5 is a schematic diagram of an initial first graph network provided by an embodiment of the present application;

[0056] Figure 6 is a schematic diagram of an initial fourth-graph network provided by an embodiment of the present application;

[0057] Figure 7 is a schematic diagram of an initial second graph network provided by an embodiment of the present application;

[0058] Figure 8 It is a processing flow chart of a reading comprehension model training method applied to multiple-choice questions provided in one embodiment of the present application;

[0059] Fig. 9 is a flow chart of a reading comprehension method provided by an embodiment of the present application;

[0060] Fig.10 It is a data flow diagram between layers of a reading comprehension model when applied according to an embodiment of the present application;

[0061] Fig.11 is a schematic diagram of another initial first graph network provided by an embodiment of the present application;

[0062] Fig.12 is a schematic diagram of another initial second graph network provided by an embodiment of the present application;

[0063] Fig.13 It is a processing flow chart of a reading comprehension model applied to multiple-choice questions provided in one embodiment of the present application;

[0064] Fig.14 It is a structural schematic diagram of a reading comprehension model training device provided in one embodiment of the present application;

[0065] Fig.15 It is a structural schematic diagram of a reading comprehension device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0066] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.

[0067] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.

[0068] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "in response to determination".

[0069] First, the terms involved in one or more embodiments of the present application are explained.

[0070] Bert model: (Bidirectional Encoder Representations from Transformer) is a dynamic word vector technology that uses a bidirectional Transformer model to train unlabeled data sets and comprehensively considers the contextual feature information to better solve problems such as polysemy.

[0071] GCN model: Graph Convolutional Network, graph convolutional network model, can be used to extract graph features.

[0072] Word vector: A representation of a word that is designed to be processed by computers.

[0073] Word embedding: refers to the process of embedding a high-dimensional space with the number of all words into a continuous vector space with much lower dimension, where each word or phrase is mapped to a vector in the real number field.

[0074] Word unit: Before any actual processing is done on the input text, it needs to be segmented into language units such as characters, punctuation marks, numbers or letters. These language units are called word units. For English text, a word unit can be a word, a punctuation mark, a number, etc.; for Chinese text, the smallest word unit can be a character, a punctuation mark, a number, etc.

[0075] word2vec: A method for word embedding, it is an efficient word vector training method built by Mikolov based on Bengio Neural Network Language Model (NNLM). That is, by using this method, the text can be embedded and the word vector of the text can be obtained.

[0076] First word unit: In the model training stage of the reading comprehension model, the first word unit refers to the word unit obtained after word segmentation of the sample text fragment; in the stage of the reading comprehension model performing the reading comprehension task, the first word unit refers to the word unit obtained after word segmentation of the target text.

[0077] First word unit group: a word unit group composed of multiple first word units.

[0078] Second word unit: In the model training stage of the reading comprehension model, the second word unit refers to the word unit obtained after word segmentation of the sample question; in the stage of the reading comprehension model executing the reading comprehension task, the second word unit refers to the word unit obtained after word segmentation of the target question.

[0079] Second word unit group: a word unit group composed of multiple second word units.

[0080] The third word unit: In the model training stage of the reading comprehension model, the second word unit refers to the word unit obtained after word segmentation of the sample answer; in the stage of the reading comprehension model performing reading comprehension tasks, the second word unit refers to the word unit obtained after word segmentation of the target answer.

[0081] Third word unit group: a word unit group composed of multiple third word units.

[0082] First eigenvector: During the model training phase of the reading comprehension model, the first eigenvector refers to the vector obtained after word embedding processing is performed on the first word unit in the sample text segment; during the reading comprehension model's reading comprehension task execution phase, the first eigenvector refers to the vector obtained after word embedding processing is performed on the first word unit of the target text.

[0083] First eigenvector group: a eigenvector group consisting of multiple first eigenvectors.

[0084] Second eigenvector: During the model training phase of the reading comprehension model, the second eigenvector refers to the vector obtained after word embedding processing of the second word unit in the sample question; during the reading comprehension model's reading comprehension task execution phase, the first eigenvector refers to the vector obtained after word embedding processing of the second word unit in the target question.

[0085] Second eigenvector group: an eigenvector group consisting of multiple second eigenvectors.

[0086] The third eigenvector: During the model training stage of the reading comprehension model, the third eigenvector refers to the vector obtained after word embedding processing of the third word unit in the sample answer; during the reading comprehension model executing the reading comprehension task, the third eigenvector refers to the vector obtained after word embedding processing of the third word unit of the target answer.

[0087] Third eigenvector group: an eigenvector group consisting of multiple third eigenvectors.

[0088] Initial first graph network: In the model training stage of the reading comprehension model, the initial first graph network is a graph network that represents the association relationship between sample text fragments and sample answers; in the stage where the reading comprehension model performs reading comprehension tasks, the initial first graph network is a graph network that represents the association relationship between the target text and the target answer.

[0089] Initial second graph network: In the model training stage of the reading comprehension model, the initial second graph network is a graph network that represents the association relationship between sample questions and sample answers; in the stage where the reading comprehension model performs reading comprehension tasks, the initial second graph network is a graph network that represents the association relationship between target questions and target answers.

[0090] Initial third graph network: During the model training phase of the reading comprehension model, the initial third graph network is a graph network that represents the dependency relationships between word units in the sample text segment; during the reading comprehension model performing reading comprehension tasks, the initial third graph network is a graph network that represents the dependency relationships between word units in the target text.

[0091] Initial fourth graph network: In the model training stage of the reading comprehension model, the initial third graph network is a graph network that represents the dependency relationship between word units in the sample problem; in the stage where the reading comprehension model performs the reading comprehension task, the initial third graph network is a graph network that represents the dependency relationship between word units in the target problem.

[0092] First graph network: the initial first graph network including the attention values ​​of nodes and the attention values ​​of edges

[0093] Second graph network: the initial second graph network including the attention values ​​of nodes and edges

[0094] First hidden layer feature vector: the vector representation of the first graph network obtained after the first graph network is convolved through the graph convolutional network layer.

[0095] Second hidden layer feature vector: the vector representation of the second graph network obtained after the second graph network is convolved by the graph convolutional network layer.

[0096] Target hidden layer feature vector: the vector representation obtained by combining the first hidden layer feature vector and the second hidden layer feature vector.

[0097] In the present application, a method for training a reading comprehension model is provided. The present application also relates to a reading comprehension model training device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0098] Figure 1 The structure block diagram of a computing device 100 according to an embodiment of the present application is shown. The components of the computing device 100 include but are not limited to a memory 110 and a processor 120. The processor 120 is connected to the memory 110 via a bus 130, and the database 150 is used to store data.

[0099] The computing device 100 also includes an access device 140 that enables the computing device 100 to communicate via one or more networks 160. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 140 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0100] In one embodiment of the present application, the above components of the computing device 100 and Figure 1 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 1 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.

[0101] The computing device 100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 100 may also be a mobile or stationary server.

[0102] The processor 120 may execute Figure 2 Steps in the training method for the reading comprehension model shown. Figure 2A flowchart of a method for training a reading comprehension model provided according to an embodiment of the present application is shown, including steps 202 to 210.

[0103] Step 202, constructing an initial first graph network of sample text segments and sample answers through the graph construction network layer of the reading comprehension model, and constructing an initial second graph network of sample questions and the sample answers.

[0104] The reading comprehension model is used to perform reading comprehension tasks and can output the correct answer to a question given a text, a question, and a candidate answer. The sample answer is the correct answer to the sample question corresponding to the sample text segment. The sample text segment can be any text segment obtained by segmenting the sample text.

[0105] Among them, the initial first graph network is used to characterize the association relationship between sample text fragments and sample answers, and the initial second graph network is used to characterize the association relationship between sample questions and sample answers.

[0106] In some embodiments, a training data set may be constructed in advance based on a plurality of sample texts, a plurality of sample questions, and a plurality of sample answers.

[0107] As an example, there is a correspondence between multiple sample texts, multiple sample questions, and multiple sample answers. Since the sample text is usually a paragraph-level text with a large amount of data and difficult to process by a model, each sample text can be segmented or sentence-processed to obtain multiple sample text segments of each sample text. The multiple sample text segments of each sample text correspond to the sample questions and sample answers corresponding to the sample text. Then, the training data set can store multiple sample text segments, multiple sample questions, and multiple sample answers, and there is a correspondence between the sample text segments, sample questions, and sample answers. A sample text segment, a sample question, and a sample answer that have a corresponding relationship can be called a set of training data.

[0108] As another example, since the sample text is usually a chapter-level text with a large amount of data and difficult to process by a model, each sample text can be segmented or sentence-processed to obtain multiple sample text segments of each sample text. Taking the reference sample text as an example, the multiple sample text segments of the reference sample text can be called reference sample text segments, the sample questions corresponding to the reference sample text can be called reference sample questions, and the sample answers corresponding to both the reference sample text and the reference sample questions can be called reference sample answers. Then, the multiple sample text segments can be matched with the reference sample questions respectively to determine multiple first similarities, and the multiple sample text segments can be matched with the reference sample answers respectively to determine multiple second similarities, and reference sample text segments whose first similarities and second similarities are both greater than the similarity threshold are obtained. It can be considered that the obtained reference sample text segments are highly correlated with the reference sample questions, and the reference sample text segments are highly correlated with the reference sample answers. Therefore, the obtained reference sample text segments, reference sample questions, and reference sample answers can be used as a set of training data. By performing the above processing on each sample text, multiple groups of training data can be obtained, and the sample text segments in each group of training data are highly correlated with their corresponding sample questions and sample answers.

[0109] Through the above two exemplary methods, a training data set including multiple sets of training data can be created, and then multiple sets of training data can be obtained from the training data set, and the multiple sets of training data can be input into the graph construction network layer of the reading comprehension model.

[0110] For example, see Figure 3 , sample text fragments, sample questions and sample answers can be input into the graph construction network layer of the reading comprehension model, an initial first graph network is obtained based on the sample text fragments and sample answers, and an initial second graph network is obtained based on the sample questions and sample answers.

[0111] In implementation, the specific implementation of constructing an initial first graph network of sample text segments and sample answers through the graph construction network layer of the reading comprehension model, and constructing an initial second graph network of sample questions and the sample answers may include: constructing an initial third graph network based on the dependency relationship between word units in the sample text segments, and constructing an initial fourth graph network based on the dependency relationship between word units in the sample questions. Constructing the initial first graph network based on the association relationship between the initial third graph network and the sample answers, and constructing the initial second graph network based on the association relationship between the initial fourth graph network and the sample answers.

[0112] The initial third graph network is used to represent the dependency relationship between word units in the sample text segment, and the initial fourth graph network is used to represent the dependency relationship between word units in the sample question.

[0113] That is, an initial third graph network reflecting the dependency relationship between word units in the sample text segment can be constructed first, and then, based on the initial third graph network, a first graph network can be constructed according to the association relationship between the sample answer and the sample text segment. Also, an initial fourth graph network reflecting the dependency relationship between word units in the sample question can be constructed first, and then, based on the initial fourth graph network, a second graph network can be constructed according to the association relationship between the sample answer and the sample question.

[0114] In this way, the first graph network can be used to clearly describe the association between the word units of the sample text fragment and the word units of the sample answer, and the second graph network can be used to clearly describe the association between the word units of the sample question and the word units of the sample answer, so as to preliminarily obtain the association between the three and prepare for further use.

[0115] In some embodiments, the specific implementation of constructing an initial third graph network based on the dependency relationship between word units in the sample text fragment may include: taking the word units in the sample text fragment as nodes to obtain multiple nodes; based on the dependency relationship between word units in the sample text fragment, connecting the nodes with dependency relationships to obtain the initial third graph network.

[0116] That is to say, by taking the word units in the sample text fragment as nodes and the dependency relationships between the word units as edges, an initial third graph network representing the dependency relationships between the word units in the sample text fragment can be constructed. In this way, the association relationship between the word units in the sample text fragment can be preliminarily determined, which can strengthen the model's learning of the relationship between the word units in the sample text fragment.

[0117] As an example, the sample text segment may be subjected to dependency analysis using the Stanford Core NLP (Natural Language Processing) algorithm to obtain dependency relationships between multiple word units in the sample text segment.

[0118] For example, by performing dependency analysis on the sample text segment "I love my motherland" through the Stanford Core NLP algorithm, we can get "I" as the subject, "love" as the predicate, "my motherland" as the object, and the dependency relationship between "I", "love", "I", "of", "ancestor" and "country" can be obtained. For example, in the sample text segment, an "I" has a dependency relationship with "love", an "I" has a dependency relationship with "of" and "ancestor", "love" also has a dependency relationship with "ancestor", and "ancestor" has a dependency relationship with "country". Based on the above dependency relationships, we can get Figure 4 The initial third graph network shown.

[0119] In some embodiments, the specific implementation of constructing the initial first graph network based on the association relationship between the initial third graph network and the sample answers may include: based on the association relationship between the word units in the sample answers and the word units in the sample text fragments, taking the word units in the sample answers as target nodes, connecting the target nodes with the nodes in the initial third graph network to obtain the initial first graph network.

[0120] That is to say, the word units in the sample answers can be used as target nodes, and the target nodes can be connected to the nodes corresponding to the word units of the sample text fragments in the initial third graph network. In this way, an initial first graph network can be obtained that represents the association relationship between the word units of the sample text fragments and the word units of the sample answers, so that the model can initially learn the association relationship between the sample text fragments and the sample answers.

[0121] As an example, the target node corresponding to the word unit in the sample answer can be connected to the node corresponding to each word unit in the sample text segment. Or, as another example, the target node corresponding to the word unit in the sample answer can be connected to the node in the initial third graph network that has an association relationship with the target node.

[0122] For example, taking the sample text segment "I love my motherland" and the sample answer "motherland" as an example, the "ancestor" in the sample answer can be connected to each node in the initial third graph network, and the "country" in the sample answer can be connected to each node in the initial third graph network, and the network can be obtained. Figure 5 The first network shown in Figure 1, Figure 5 The bold node is the target node.

[0123] In some embodiments, the specific implementation of constructing the initial fourth graph network based on the dependency relationship between word units in the sample problem may include: taking the word units in the sample problem as nodes to obtain multiple nodes; based on the dependency relationship between word units in the sample problem, connecting the nodes with dependency relationships to obtain the initial fourth graph network.

[0124] In other words, by taking the word units in the sample problem as nodes and the dependency relationships between the word units as edges, we can construct an initial fourth graph network that represents the dependency relationships between the word units in the sample problem. In this way, we can preliminarily determine the association relationship between the word units in the sample problem, and strengthen the model's learning of the relationship between the word units in the sample problem.

[0125] As an example, the Stanford Core NLP algorithm can be used to perform dependency analysis on the sample question to obtain the dependency relationship between multiple word units in the sample question.

[0126] As an example, by using the Stanford Core NLP algorithm to perform dependency analysis on the sample question "Who do I love", we can get "I" as the subject, "love" as the predicate, "who" as the object, and the dependency relationship between "I", "love", and "who" can be obtained. For example, in the sample question, there is a dependency relationship between "I" and "love", a dependency relationship between "love" and "who", and a dependency relationship between "I" and "who". Based on the above dependency relationships, see Figure 6 , we can get Figure 6 The initial fourth graph network shown.

[0127] In some embodiments, the specific implementation of constructing the initial first graph network based on the association relationship between the initial third graph network and the sample answers may include: based on the association relationship between the word units in the sample answers and the word units in the sample text fragments, taking the word units in the sample answers as target nodes, connecting the target nodes with the nodes in the initial third graph network to obtain the initial first graph network.

[0128] In some embodiments, the specific implementation of constructing the initial second graph network based on the association relationship between the initial fourth graph network and the sample answers may include: based on the association relationship between the word units in the sample answers and the word units in the sample questions, taking the word units in the sample answers as target nodes, connecting the target nodes with the nodes in the initial fourth graph network to obtain the initial second graph network.

[0129] That is to say, the word units in the sample answers can be used as target nodes, and the target nodes can be connected to the nodes corresponding to the word units of the sample questions in the initial fourth graph network. In this way, an initial second graph network can be obtained that represents the association between the word units of the sample questions and the word units of the sample answers, so that the model can initially learn the association between the sample questions and the sample answers.

[0130] As an example, the target node corresponding to the word unit in the sample answer can be connected to the node corresponding to each word unit in the sample question. Or, as another example, the target node corresponding to the word unit in the sample answer can be connected to the node in the initial fourth graph network that has an association relationship with the target node.

[0131] For example, taking the sample question "Who do I love" and the sample answer "Motherland" as an example, the "ancestor" in the sample answer can be connected to each node in the initial fourth graph network, and the "country" in the sample answer can be connected to each node in the initial fourth graph network, and we can get Figure 7 The initial second graph network shown, Figure 7The bold node is the target node.

[0132] In the embodiments of the present application, the association between sample text segments and sample answers, as well as the association between sample text segments and sample questions can be fully utilized to train the reading comprehension model, which can improve the accuracy of the reading comprehension model in performing reading comprehension tasks.

[0133] Step 204: input the sample text segment, the sample question and the sample answer into the feature extraction layer of the reading comprehension model to obtain a first feature vector group, a second feature vector group and a third feature vector group respectively.

[0134] As an example, the feature extraction layer can be used to extract features of the input text. The first feature vector group is a feature vector group obtained after the sample text segment passes through the feature extraction layer, the second feature vector group is a feature vector group obtained after the sample question sample text segment passes through the feature extraction layer, and the third feature vector group is a feature vector group obtained after the sample answer sample text segment passes through the feature extraction layer. In addition, the first feature vector group includes multiple first feature vectors, each first feature vector corresponds to a word unit in the sample text segment, the second feature vector group includes multiple second feature vectors, each second feature vector corresponds to a word unit in the sample question, and the third feature vector group includes multiple third feature vectors, each third feature vector corresponds to a word unit in the sample answer.

[0135] For example, see Figure 3 , the sample text fragments, sample questions and sample answers can be input into the feature extraction layer of the reading comprehension model to determine the first feature vector group, the second feature vector group and the third feature vector group respectively.

[0136] In implementation, the specific realization of this step may include: performing word segmentation processing on the sample text fragment, the sample question and the sample answer to obtain a first word unit group, a second word unit group and a third word unit group respectively; performing word embedding processing on the first word unit group, the second word unit group and the third word unit group to obtain a first word vector group, a second word vector group and a third word vector group respectively; encoding the first word vector group, the second word vector group and the third word vector group to obtain the first feature vector group, the second feature vector group and the third feature vector group respectively.

[0137] In an embodiment of the present application, the feature extraction layer may include a word embedding processing function and an encoding function. As an example, the feature extraction layer may include a word embedding processing module and an encoding module.

[0138] Exemplarily, the feature extraction layer can adopt the structure of the Bert model. Since the feature vector obtained by the Bert model is a feature vector combined with the semantic information of the entire text, it can make more full use of the feature vectors of word units in sample text fragments, sample questions, and sample answers, and can improve the accuracy of the reading comprehension model.

[0139] As an example, taking the sample text fragment as an example, if the sample text fragment is Chinese text, a character can be divided into a word unit, and a punctuation mark can be divided into a word unit; if the sample text fragment is a foreign text, a word can be divided into a word unit, and a phrase can be divided into a word unit; if there are numbers in the sample text fragment, the numbers can be divided into a word unit alone.

[0140] Exemplarily, assuming that the sample text segment is "Li Bai is called the Immortal Poet", seven first word units "Li", "Bai", "be", "called", "for", "poetry", and "immortal" can be obtained.

[0141] As an example, each first word unit in the first word unit group can be embedded in a one-hot encoding manner to obtain a word vector for each first word unit, each second word unit in the second word unit group can be embedded in a word to obtain a word vector for each second word unit, and each word unit in the third word unit group can be embedded in a word to obtain a word vector for each third word unit.

[0142] As another example, each first word unit in the first word unit group can be word embedded by word2vec encoding to obtain a word vector for each first word unit, each second word unit in the second word unit group can be word embedded to obtain a word vector for each second word unit, and each word unit in the third word unit group can be word embedded to obtain a word vector for each third word unit.

[0143] As an example, by encoding each first word vector, each second word vector and each third word vector, we can obtain a vector representation of the full-text semantic information of the fused sample text fragment corresponding to each first word unit, that is, the first feature vector, and a vector representation of the full-text semantic information of the fused sample question corresponding to each second word unit, that is, the second feature vector, and a vector representation of the full-text semantic information of the fused sample answer corresponding to each third word unit, that is, the third feature vector, and then we can obtain the first feature vector group, the second feature vector group and the third feature vector group.

[0144] For example, taking the sample answer "Li Bai" as an example, inputting "Li Bai" into the feature extraction layer, "Li Bai" can be segmented to obtain word units "Li" and "Bai", word embedding processing can be performed on "Li" and "Bai" respectively, and the word vector of "Li" and the word vector of "Bai" can be obtained. The word vector of "Li" and the word vector of "Bai" are encoded to obtain the third feature vector obtained after combining the word vector of "Li" with the word vector of "Bai", and the third feature vector obtained after combining the word vector of "Bai" with the word vector of "Li" can be obtained. Assuming that the third feature vector corresponding to "Li" is x and the third feature vector corresponding to "Bai" is y, the third feature vector group can be xy. Similarly, inputting the sample text segment "Li Bai is called the Immortal Poet" into the feature extraction layer can output the first feature vector of each word in the sample text segment, and inputting the sample question "Who is the Immortal Poet" into the feature extraction layer can output the second feature vector of each word in the sample question.

[0145] Through the above feature extraction, we can obtain a first feature vector that can accurately reflect the semantics of each word unit in the sample text segment, a second feature vector that can accurately reflect the semantics of each word unit in the sample question, and a third feature vector that can accurately reflect the semantics of each word unit in the sample answer. That is, using more accurate feature vectors to train the reading comprehension model can improve the accuracy of the trained model.

[0146] It should be noted that the feature extraction layer in the embodiment of the present application can adopt the structure of the BERT model that has been preprocessed and fine-tuned using the reading comprehension task. In this way, the obtained first feature vector group, second feature vector group and third feature vector group can more accurately reflect the semantic features of the sample text fragment, the semantic features of the sample question and the semantic features of the sample answer, respectively, which can improve the training rate and usage accuracy of the model.

[0147] Step 206: Input the first feature vector group, the second feature vector group, and the third feature vector group into the attention layer of the reading comprehension model, and add attention values ​​to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain the first graph network and the second graph network.

[0148] The first graph network is an initial first graph network including attention values ​​of nodes and attention values ​​of edges. The second graph network is an initial second graph network including attention values ​​of nodes and attention values ​​of edges.

[0149] As an example, the attention layer may adopt the structure of the attention layer of the BERT model. Alternatively, the attention layer may adopt the structure of any other model including an attention mechanism, which is not limited in the embodiments of the present application.

[0150] As an example, in this step, the first feature vector group, the second feature vector group, the third feature vector group, the initial first graph network and the initial second graph network can be input into the attention layer of the reading comprehension model, and attention values ​​are added to the nodes and edges of the initial first graph network based on the first feature vector group and the second feature vector group to obtain the first graph network, and attention values ​​are added to the nodes and edges of the initial second graph network based on the second feature vector group and the third feature vector group to obtain the second graph network. For example, see Figure 3 The first feature vector group, the second feature vector group, the third feature vector group, the initial first graph network and the initial second graph network can be input into the attention layer of the reading comprehension model, and attention values ​​are added to the nodes and edges included in the initial first graph network based on the first feature vector group and the second feature vector group to obtain the first graph network; and attention values ​​are added to the nodes and edges included in the initial second graph network based on the second feature vector group and the third feature vector group to obtain the second graph network.

[0151] Alternatively, as another example, in this step, the first feature vector group, the second feature vector group, and the third feature vector group can be input into the attention layer of the reading comprehension model, and based on the first feature vector group and the second feature vector group, the attention values ​​of the nodes and edges included in the initial first graph network are obtained, and the attention values ​​are added to the initial first graph network to obtain the first graph network; and based on the second feature vector group and the third feature vector group, the attention values ​​of the nodes and edges included in the initial second graph network are obtained, and the attention values ​​are added to the initial second graph network to obtain the second graph network.

[0152] In implementation, the specific implementation of this step may include: adding attention values ​​to the nodes and edges of the initial first graph network based on the first feature vector group and the third feature vector group through the attention layer; adding attention values ​​to the nodes and edges of the initial second graph network based on the second feature vector group and the third feature vector group through the attention layer.

[0153] As an example, the initial first graph network represents the association between sample text segments and sample answers, the first feature vector group is the feature representation of the sample text segments, and the third feature vector group is the feature representation of the sample answers, so attention values ​​can be added to the nodes and edges of the initial first graph network based on the first feature vector group and the third feature vector group. Similarly, the initial second graph network represents the association between sample questions and sample answers, the second feature vector group is the feature representation of the sample questions, and the third feature vector group is the feature representation of the sample answers, so attention values ​​can be added to the nodes and edges of the initial second graph network based on the second feature vector group and the third feature vector group.

[0154] The nodes in the initial first graph network are word units of sample text fragments and sample answers. Therefore, attention values ​​can be added to the nodes and edges of the initial first graph network in the attention layer according to the first feature vector group and the third feature vector group, which can further capture the association between the sample text fragments and the sample answers. Similarly, the nodes in the initial second graph network are word units of sample questions and sample answers. Therefore, attention values ​​can be added to the nodes and edges of the initial second graph network in the attention layer according to the second feature vector group and the third feature vector group, which can further capture the association between the sample questions and the sample answers. In this way, it is convenient for the reading comprehension model to further learn the association between sample text fragments, sample answers and sample questions, and improve the accuracy of the reading comprehension model in processing reading comprehension tasks.

[0155] In some embodiments, through the attention layer, based on the first feature vector group and the third feature vector group, the specific implementation of adding attention values ​​to the nodes and edges of the initial first graph network may include: using the first feature vector in the first feature vector group as the attention value of the first node in the initial first graph network, and the first node is the node corresponding to the word unit of the sample text fragment in the initial first graph network; using the third feature vector in the third feature vector group as the attention value of the second node in the initial first graph network, and the second node is the node corresponding to the word unit of the sample answer in the initial first graph network; based on the first feature vector group, determining the attention value between the two first nodes where an edge exists in the initial first graph network and using it as the attention value of the edge; based on the first feature vector group and the third feature vector group, determining the attention value between the first node and the second node where an edge exists in the initial first graph network and using it as the attention value of the edge.

[0156] That is to say, the first feature vector in the first feature vector group can be used as the attention value of the node corresponding to the word unit of the sample text segment in the initial first graph network, and the third feature vector in the third feature vector group can be used as the attention value of the node corresponding to the word unit of the sample answer in the initial first graph network. And the attention value of the edge between the word units of the sample text segment in the initial first graph network is determined according to the first feature vector group, and the attention value of the edge between the word unit of the sample text segment and the word unit of the sample answer in the initial first graph network is determined according to the first feature vector group and the third feature vector group. In this way, the association relationship between the word units in the sample text segment and the association relationship between the sample text segment and the sample answer can be further learned, so as to improve the accuracy of the trained reading comprehension model.

[0157] As an example, for two first nodes with an edge therebetween, attention calculation may be performed on the first feature vectors of the word units corresponding to the two first nodes, and the attention value of the edge may be obtained. Specifically, performing attention calculation on the two first feature vectors is to multiply the two first feature vectors and normalize the result to obtain the attention value. Refer to Figure 5 , Figure 5 There is an edge between "I" and "love" in

[0158] Figure 5 , and "I" and "love" are word units in the sample text segment. The first feature vector of the word unit "I" may be obtained from the first feature vector group, and the first feature vector of "love" may be obtained from the first feature vector group. The first feature vector of "I" and the first feature vector of "love" may be multiplied, and the product may be normalized to obtain the attention value of the edge between "I" and "love". Figure 5 , Figure 5 There is an edge between "I" and "ancestor" in

[0159] Figure 5 . "I" is a word unit in the sample text segment, and "ancestor" is a word unit in the sample answer. The first feature vector of the word unit "I" may be obtained from the first feature vector group, and the third feature vector of "ancestor" may be obtained from the third feature vector group. The first feature vector of "I" and the third feature vector of "ancestor" may be multiplied, and the product may be normalized to obtain the attention value of the edge between "I" and "ancestor". Figure 5

[0160] By the above method, the attention value of each edge and the attention value of each node in Figure 5 can be determined. Adding the attention values of the nodes and edges to the initial first graph network, the first graph network can be obtained.

[0160] In some embodiments, through the attention layer, based on the second feature vector group and the third feature vector group, the specific implementation of adding attention values ​​to the nodes and edges of the initial second graph network may include: using the second feature vector in the second feature vector group as the attention value of the third node in the initial second graph network, and the third node is the node corresponding to the word unit of the sample question in the initial second graph network; using the third feature vector in the third feature vector group as the attention value of the fourth node in the initial second graph network, and the fourth node is the node corresponding to the word unit of the sample answer in the initial second graph network; based on the second feature vector group, determining the attention value between the two third nodes where there is an edge in the initial second graph network and using it as the attention value of the edge; based on the third feature vector group, determining the attention value between the third node and the fourth node where there is an edge in the initial second graph network and using it as the attention value of the edge.

[0161] That is to say, the second eigenvector in the second eigenvector group can be used as the attention value of the node corresponding to the word unit of the sample question in the initial second graph network, and the third eigenvector in the third eigenvector group can be used as the attention value of the node corresponding to the word unit of the sample answer in the initial second graph network. And the attention value of the edge between the word units of the sample question in the initial second graph network is determined based on the second eigenvector group, and the attention value of the edge between the word units of the sample question and the word units of the sample answer in the initial second graph network is determined based on the second eigenvector group and the third eigenvector group. In this way, the association relationship between the word units in the sample question and the association relationship between the sample question and the sample answer can be further learned, which is convenient for improving the accuracy of the trained reading comprehension model.

[0162] As an example, for two third nodes with an edge, attention calculation can be performed on the second feature vectors of the word units corresponding to the two third nodes to obtain the attention value of the edge. Specifically, the attention calculation for the two second feature vectors is to multiply the two second feature vectors and normalize the result to obtain the attention value. For example, see Figure 7 , Figure 7 There is an edge between "I" and "who", and "I" and "who" are word units in the sample problem. The second eigenvector of the word unit "I" can be obtained from the second eigenvector group, and the second eigenvector of "who" can be obtained from the second eigenvector group. The second eigenvector of "I" and the second eigenvector of "who" can be multiplied, and the product can be normalized to obtain the attention value of the edge between "I" and "who".

[0163] As an example, for the third node and the fourth node of the edge, the attention value of the edge can be obtained by performing attention calculation on the second eigenvector of the word unit corresponding to the third node and the third eigenvector of the word unit corresponding to the fourth node. Specifically, the attention value of the edge can be obtained by multiplying the second eigenvector and the third eigenvector and normalizing the result. Figure 7 , Figure 7 There is an edge between "who" and "country", and "who" is the word unit in the sample question, and "country" is the word unit in the sample answer. The second eigenvector of the word unit "who" can be obtained from the second eigenvector group, and the third eigenvector of "country" can be obtained from the third eigenvector group. The second eigenvector of "who" and the third eigenvector of "country" can be multiplied, and the product can be normalized to obtain the attention value of the edge between "who" and "country".

[0164] Through the above method, it can be determined Figure 7 The attention value of each edge and the attention value of each node in the graph are added to the attention value of the node and the edge to obtain the second graph network.

[0165] It should be noted that in the embodiment of the present application, the attention calculation of the two feature vectors can be performed using the following formula (1).

[0166]

[0167] In formula (1), attention represents the attention value, softmax(·) is a normalization function, Q and K represent two feature vectors, respectively, and d k is a constant and T is a matrix transpose.

[0168] For example, see Figure 7 , Figure 7 There is an edge between "who" and "country", and "who" is a word unit in the sample question, and "country" is a word unit in the sample answer. The second eigenvector of the word unit "who" can be obtained from the second eigenvector group as Q, and the third eigenvector of "country" can be obtained from the third eigenvector group as K. The attention value of the edge between "who" and "country" can be determined by the above formula (1).

[0169] In an embodiment of the present application, the association relationship between sample text fragments, sample questions and sample answers can be further captured through the attention layer, and the association relationship can be converted into attention values ​​and assigned to the initial first graph network and the initial second graph network to obtain the first graph network and the second graph network, so that the model can further learn the association relationship between the sample text fragments, sample questions and sample answers, which can improve the accuracy of the trained reading comprehension model.

[0170] It should be noted that steps 204 to 206 are the specific implementation of the step of "inputting the sample text fragment, the sample question and the sample answer into the text processing layer of the reading comprehension model, adding attention values ​​to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain the first graph network and the second graph network".

[0171] Step 208: input the first graph network and the second graph network into the graph convolutional network layer of the reading comprehension model to obtain a predicted answer.

[0172] As an example, the graph convolutional network layer can be a GCN model.

[0173] For example, see Figure 3 , the first graph network and the second graph network can be input into the graph convolutional network layer of the reading comprehension model to obtain the predicted answer.

[0174] In implementation, the first graph network and the second graph network are input into the graph convolutional network layer of the reading comprehension model, and the specific implementation of obtaining the predicted answer may include: determining the first hidden layer feature vector of the first graph network and the second hidden layer feature vector of the second graph network through the graph convolutional network layer; performing weighted summation of the first hidden layer feature vector and the second hidden layer feature vector to obtain a target hidden layer feature vector; and determining the predicted answer based on the target hidden layer feature vector.

[0175] As an example, the first hidden layer feature vector is the vector representation of the first graph network obtained after the first graph network is convolved by the graph convolutional network layer, and can be considered as the graph feature vector of the first graph network. The second hidden layer feature vector is the vector representation of the second graph network obtained after the second graph network is convolved by the graph convolutional network layer, and can be considered as the graph feature vector of the second graph network. The target hidden layer feature vector is the vector representation obtained by combining the vector representations of the first graph network and the second graph network.

[0176] In some embodiments, at the graph convolutional network layer, the graph network can be convolved using the following formula (2).

[0177]

[0178] In formula (2), i represents the i-th node in the graph network, j represents the j-th node in the graph network, represents the feature vector of the ith node input to the l+1th convolutional layer, σ(·) represents the nonlinear conversion function, which can be the ReLU activation function, N i represents node i and all nodes connected to node i, represents the feature vector of the jth node input to the lth convolutional layer, C ij represents the attention value of the edge between the i-th node and the j-th node, represents the weight of the jth node in the lth convolutional layer, Represents the intercept of the j-th node in the l-th convolutional layer.

[0179] As an example, a graph convolutional network layer may include multiple convolutional layers, each convolutional layer includes a preset weight parameter matrix, and the weight of each node in each convolutional layer may be the initial weight in the weight parameter matrix. Similarly, each convolutional layer may include a preset intercept parameter matrix, and the intercept of each node in each convolutional layer may be the initial intercept in the intercept parameter matrix. In addition, in the subsequent training process, the weight parameter matrix and intercept parameter matrix of each convolutional layer may be adjusted according to the training situation.

[0180] Exemplarily, taking the first graph network as an example, assuming that the graph convolutional network layer includes two convolutional layers, then in the first convolutional layer, the feature vector of each node in the first graph network can be used as input, and the weight parameter matrix and intercept parameter matrix of the first convolutional layer can be used as preset parameters. Through the above formula (2), the feature vector of each node in the first graph network input into the second convolutional layer can be determined, that is, the feature vector obtained after each node in the first graph network is subjected to one convolution process. Then in the second convolutional layer, the feature vector of each node input into the second convolutional layer obtained above can be used as input, and the weight parameter matrix and intercept parameter matrix of the second convolutional layer can be used as preset parameters. Through the above formula (2), the feature vector of each node in the first graph network input into the third convolutional layer can be determined, that is, the feature vector obtained after each node in the first graph network is subjected to two convolution processes. The feature vectors obtained after two convolution processes on multiple nodes in the first graph network are concatenated to obtain the first hidden layer feature vector of the first graph network.

[0181] As an example, when performing weighted summation on the first hidden layer feature vector and the second hidden layer feature vector, the weight of the first hidden layer feature vector and the weight of the second hidden layer feature vector may be the same or different, and may be set by the user according to actual needs or may be set by default by the computing device. This embodiment of the present application is not limited to this.

[0182] Through the above method, the potential correlation relationship between nodes in the first graph network and the potential correlation relationship between nodes in the second graph network can be obtained, which facilitates the reading comprehension model to learn the potential correlation relationship between sample text fragments, sample questions and sample answers, thereby improving the accuracy of the model.

[0183] In some embodiments, the specific implementation of determining the predicted answer based on the target hidden layer feature vector may include: converting the value of each dimension of the target hidden layer feature vector into at least one prediction probability through a sequence labeling function, each dimension of the target hidden layer feature vector corresponds to a word unit, and the at least one prediction probability corresponding to each dimension represents the probability that the predicted label of the word unit corresponding to each dimension is at least one label; determining the predicted label of the word unit corresponding to each dimension based on the at least one prediction probability corresponding to each dimension; and determining the predicted answer based on the predicted label of the word unit corresponding to each dimension.

[0184] As an example, a sequence labeling function is a function used for sequence labeling, which can map the input vector to at least one-dimensional probability, that is, at least one probability can be obtained for each vector. Sequence labeling can be called Sequence Tagging. After determining the probability corresponding to each dimensional vector through the sequence labeling function, a preset label can be labeled for each word unit according to the probability.

[0185] As an example, the labels may be B, I, and O. Among them, B may be called Begin, indicating the beginning word of the answer, that is, the first word of the answer; I may be called Inside, indicating the middle and ending words of the answer, that is, the second to the last word of the answer; O may be called Outside, indicating a non-answer word, that is, a word that is not the answer.

[0186] It should be noted that the length of the target hidden layer feature vector is the same as the length of the sample text segment, that is, it can be considered that the dimension of the target hidden layer feature vector is the same as the number of word units in the sample text segment.

[0187] Exemplarily, assume that the sample text segment is "I love my motherland", then the target hidden layer feature vector is a 6-dimensional vector, and the 6 dimensions respectively correspond to the word units "I", "love", "I", "my", "mother", and "land". Then, each dimension in the target hidden layer feature vector is converted into 3 prediction probabilities, and each prediction probability corresponds to the possibility of the label "BIO" appearing. For example, for the word unit "I", assuming the calculated prediction probabilities are 0.2, 0.3, and 0.5 respectively, it can be determined that the probability of the prediction label "O" is the largest, so the prediction label corresponding to "I" is "O". Similarly, it can be determined that the prediction labels corresponding to the 6 word units are "O", "O", "O", "O", "B", and "I" respectively. Since the label "B" represents the starting word of the answer and the label "I" represents the middle or ending word of the answer, it can be considered that "mother" and "land" are the predicted answers.

[0188] Through the method of sequence labeling, the prediction label of each word unit can be determined, and based on the prediction label, the predicted answer can be determined. When adjusting the model parameters, the prediction label of the correct predicted answer can be made closer to the correct label. This method can improve the training efficiency and accuracy of the reading comprehension model.

[0189] As an example, the at least one label includes the starting word of the answer, the middle or ending word of the answer, and the non-answer word. The specific implementation of determining the predicted answer based on the prediction label corresponding to each dimension may include: taking the word units corresponding to the starting word of the answer and the middle or ending word of the answer as the predicted answer.

[0190] That is to say, the starting word of the answer and the middle or ending word of the answer can be concatenated to obtain the predicted answer.

[0191] Continuing the above example, the label of the word unit "mother" is B, and the label of the word unit "land" is I. The label "B" represents the starting word of the answer, and the label "I" represents the middle or ending word of the answer. Then, "motherland" can be determined as the predicted answer.

[0192] Step 210, train the reading comprehension model based on the difference between the predicted answer and the sample answer until the training stop condition is reached.

[0193] In some embodiments, the difference between the prediction function and the sample answer can be determined through a loss function, and the reading comprehension model can be trained according to the difference.

[0194] As an example, training a reading comprehension model based on difference pairs mainly involves adjusting the parameters of the graph convolutional network layer based on difference pairs, so that the predicted answer and the sample answer can be closer in subsequent training. For example, assuming the answer is "motherland", if the probability of the "O" label corresponding to "country" is the highest during training, the parameters need to be adjusted in model training so that the probability of the "I" label corresponding to "country" is the highest.

[0195] For example, see Figure 3 , the difference can be determined based on the predicted answer and the sample answer, and the parameters of the graph convolutional network layer can be adjusted based on the difference.

[0196] In some embodiments, the specific implementation of training the reading comprehension model based on the difference between the predicted answer and the sample answer until the training stop condition is reached may include: if the difference is less than a preset threshold, stopping the training of the reading comprehension model; if the difference is greater than or equal to the preset threshold, continuing to train the reading comprehension model.

[0197] It should be noted that the preset threshold can be set by the user according to actual needs, or can be set by default by the computing device, and the embodiments of the present application are not limited to this.

[0198] In other words, the reading comprehension model can be trained based on the difference between the predicted answer and the sample answer. If the loss value is less than the preset threshold, it can be considered that the current model parameters have basically met the requirements, and the reading comprehension model can be considered to have been trained. Therefore, the training of the reading comprehension model can be stopped. If the loss value is greater than or equal to the preset threshold, it can be considered that the difference between the model's predicted answer and the sample answer is large, and the current model parameters cannot meet the requirements. Therefore, the reading comprehension model needs to continue to be trained.

[0199] By determining whether to continue training the reading comprehension model based on the relationship between the difference and the preset threshold, the training degree of the reading comprehension model can be more accurately grasped, thereby improving the training efficiency of the model and the accuracy of the model in processing reading comprehension tasks.

[0200] In other embodiments, reaching the training stop condition may include: recording an iterative training each time a prediction answer is obtained; counting the number of trainings of the iterative training, and if the number of trainings is greater than a threshold number, determining that the training stop condition is reached.

[0201] It should be noted that the number threshold can be set by the user according to actual needs, or it can be set by default by the computing device, and the embodiments of the present application are not limited to this.

[0202] As an example, each time a predicted answer is obtained, it indicates that an iterative training has been performed. One can be added to the recorded iterative training times. After each iterative training, the training times are counted. If the training times are greater than the times threshold, it indicates that the training of the reading comprehension model is sufficient, that is, the training stop condition is reached. Continuing the training may not achieve better results, so the training can be stopped. If the training times are less than or equal to the times threshold, it indicates that the reading comprehension model has been trained too few times, and the reading comprehension model may not have been trained to meet actual needs. Therefore, training can continue based on the difference between the predicted answer and the sample answer.

[0203] By determining whether to continue training the reading comprehension model based on the correspondence between the number of iterative training times and the number threshold, unnecessary iterative training can be reduced, the consumption of computing resources caused by iterative training can be reduced, and the training efficiency of the model can be improved.

[0204] In an embodiment of the present application, an initial first graph network of sample text segments and sample answers is constructed through the graph construction network layer of the reading comprehension model, and an initial second graph network of sample questions and the sample answers is constructed; the sample text segments, the sample questions and the sample answers are input into the text processing layer of the reading comprehension model, and attention values ​​are added to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain a first graph network and a second graph network; the first graph network and the second graph network are input into the graph convolution network layer of the reading comprehension model to obtain a predicted answer; the reading comprehension model is trained based on the difference between the predicted answer and the sample answer until the training stop condition is reached. Through the method of the present application, the feature vectors of sample text segments, sample questions and sample answers can be effectively utilized to extract the correlation between the three, and the reading comprehension model is trained in combination with the correlation between the sample text segments, sample questions and sample answers, which can improve the accuracy of the reading comprehension model in performing reading comprehension tasks.

[0205] The following combination Figure 8 Taking the application of the reading comprehension model training method provided in this application in a reading comprehension task as an example, the training method of the reading comprehension model is further described. Figure 8 A processing flow chart of a training method for a reading comprehension model applied to multiple-choice questions provided in an embodiment of the present application is shown, which may specifically include the following steps:

[0206] Step 802, obtaining sample text segments, sample questions and sample answers.

[0207] For example, assuming the sample text segment is “I love my motherland”, the sample question is a multiple-choice question, and assuming the sample question is “Who do I love”, and the options include “motherland”, “father”, “mother”, and “family”, then the sample answer is “motherland”.

[0208] Step 804, input the sample text segment, sample question and sample answer into the graph construction network layer of the reading comprehension model, and construct an initial third graph network based on the dependency relationship between word units in the sample text segment.

[0209] In implementation, the words in the sample text segment can be used as nodes to obtain multiple nodes, and based on the dependency relationship between the word units in the sample text segment, the nodes with dependency relationships are connected to obtain the initial third graph network.

[0210] For example, see Figure 4 ,The nodes of the initial third graph network include the word units "I", "love", "I", "of", "ancestor" and "country" in the sample text fragment. According to the dependency relationship between these six word units, it can be determined that there is an edge between "I" and "love", there is an edge between "I" and "of" and "ancestor" respectively, there is an edge between "love" and "ancestor", and there is an edge between "ancestor" and "country".

[0211] Step 806, based on the association relationship between the word units in the sample answer and the word units in the sample text fragment, take the word units in the sample answer as target nodes, connect the target nodes with the nodes in the initial third graph network, and obtain the initial first graph network.

[0212] For example, see Figure 5 , "ancestor" can be determined as a target node, "country" can be determined as a target node, the target node "ancestor" can be connected to each node in the initial third graph network, and the target node "country" can be connected to each node in the initial third graph network, and the initial first graph network can be obtained.

[0213] Step 808, input the sample text fragments, sample questions and sample answers into the graph construction network layer of the reading comprehension model, and construct an initial fourth graph network based on the dependency relationship between word units in the sample questions.

[0214] In implementation, the words in the sample question can be used as nodes to obtain multiple nodes; based on the dependency relationship between the word units in the sample question, the nodes with dependency relationship are connected to obtain the initial fourth graph network.

[0215] For example, see Figure 6,The nodes of the initial fourth graph network include the word units "I", "love" and "who" in the sample question. According to the dependency relationship between these three word units, it can be determined that there is an edge between "I" and "love" and "who", and there is an edge between "love" and "who".

[0216] Step 810, based on the association relationship between the word units in the sample answer and the word units in the sample question, take the word units in the sample answer as target nodes, connect the target nodes with the nodes in the initial fourth graph network, and obtain the initial second graph network.

[0217] For example, see Figure 7 , "ancestor" can be determined as a target node, "country" can be determined as a target node, the target node "ancestor" can be connected to each node in the initial fourth graph network, and the target node "country" can be connected to each node in the initial fourth graph network, and the initial second graph network can be obtained.

[0218] It should be noted that steps 802 to 810 are subordinate descriptions of step 202, and their implementation process is the same as that of step 202. For specific implementation, please refer to the relevant description of step 202, which will not be repeated in this embodiment.

[0219] Step 812, segmenting the sample text segment to obtain a first word unit group, segmenting the sample question to obtain a second word unit group, and segmenting the sample answer to obtain a third word unit group.

[0220] Continuing with the above example, after word segmentation of the sample text fragment, we can get the first word unit group, which are "I", "love", "I", "of", "ancestor", and "country". Similarly, word segmentation of the sample question can get the second word unit group, which are "I", "love", and "who". Word segmentation of the sample answer can get the third word unit group, which are "ancestor" and "country".

[0221] Step 814, performing word embedding processing on the first word unit group, the second word unit group and the third word unit group to obtain a first word vector group, a second word vector group and a third word vector group, respectively.

[0222] Taking the sample answer "motherland" as an example, the feature extraction layer can obtain the vector representation of each word in the text "motherland". Assume that the third word vector corresponding to "ancestor" is x and the third word vector corresponding to "country" is y. Similarly, the word embedding process of the sample text segment "I love my motherland" can output the first word vector of each word in the sample text segment, and the word embedding process of the sample question "who do I love" can output the second word vector of each word in the sample question.

[0223] Step 816: Encode the first word vector group, the second word vector group, and the third word vector group to obtain the first feature vector group, the second feature vector group, and the third feature vector group respectively.

[0224] Continuing with the above example, encoding the words "ancestor" and "country" in the sample answer can respectively obtain the third feature vector of "ancestor" and the third feature vector of "country". Similarly, encoding the words "I", "love", and "who" in the sample question can respectively obtain the first feature vector of "I", the first feature vector of "love", and the first feature vector of "who". Encoding the words "I", "love", "I", "of", "ancestor", and "country" in the sample text fragment can respectively obtain the second feature vector of "I", the second feature vector of "love", the second feature vector of "I", the second feature vector of "of", the second feature vector of "ancestor", and the second feature vector of "country".

[0225] It should be noted that steps 812 - 816 are subordinate descriptions of step 204, and their implementation processes are the same as those of step 204. For specific implementation, refer to the relevant description of step 204, which will not be elaborated herein.

[0226] Step 818: Through the attention layer, based on the first feature vector group and the third feature vector group, add attention values to the nodes and edges of the initial first graph network to obtain the first graph network.

[0227] As an example, the first feature vector in the first feature vector group can be used as the attention value of the first node in the initial first graph network, where the first node is the node corresponding to the word unit of the sample text fragment in the initial first graph network; the third feature vector in the third feature vector group can be used as the attention value of the second node in the initial first graph network, where the second node is the node corresponding to the word unit of the sample answer in the initial first graph network; based on the first feature vector group, determine the attention value between two first nodes with an edge in the initial first graph network and use it as the attention value of the edge; based on the first feature vector group and the third feature vector group, determine the attention value between the first node and the second node with an edge in the initial first graph network and use it as the attention value of the edge.

[0228] Exemplarily, referring to Figure 5 for two first nodes with an edge, Figure 5There is an edge between "I" and "love" in , and "I" and "love" are word units in the sample text segment. The first feature vector of the word unit "I" can be obtained from the first feature vector group, and the first feature vector of "love" can be obtained from the first feature vector group. The first feature vector of "I" and the first feature vector of "love" can be multiplied, and the product can be normalized to obtain the attention value of the edge between "I" and "love". For the first node and the second node with an edge, Figure 5 There is an edge between "I" and "ancestor" in , where "I" is a word unit in the sample text segment and "ancestor" is a word unit in the sample answer. The first feature vector of the word unit "I" can be obtained from the first feature vector group, and the third feature vector of "ancestor" can be obtained from the third feature vector group. The first feature vector of "I" and the third feature vector of "ancestor" can be multiplied, and the product can be normalized to obtain the attention value of the edge between "I" and "ancestor".

[0229] By the above method, it is possible to determine Figure 5 the attention value of each edge and the attention value of each node in . Adding the attention values of the nodes and edges to the initial first graph network, the first graph network can be obtained.

[0230] Step 820: Through the attention layer, based on the second feature vector group and the third feature vector group, add attention values to the nodes and edges of the initial second graph network to obtain the second graph network.

[0231] As an example, use the second feature vector in the second feature vector group as the attention value of the third node in the initial second graph network, where the third node is the node corresponding to the word unit of the sample question in the initial second graph network; use the third feature vector in the third feature vector group as the attention value of the fourth node in the initial second graph network, where the fourth node is the node corresponding to the word unit of the sample answer in the initial second graph network; based on the second feature vector group, determine the attention value between two third nodes with an edge in the initial second graph network and use it as the attention value of the edge; based on the third feature vector group, determine the attention value between the third node and the fourth node with an edge in the initial second graph network and use it as the attention value of the edge.

[0232] Exemplarily, referring to Figure 7 , for two third nodes with an edge, Figure 7There is an edge between "I" and "who" in the sentence, and "I" and "who" are word units in the sample problem. The second feature vector of the word unit "I" can be obtained from the second feature vector group, and the second feature vector of "who" can be obtained from the second feature vector group. The second feature vector of "I" and the second feature vector of "who" can be multiplied, and the product can be normalized to obtain the attention value of the edge between "I" and "who". For the third and fourth nodes where there are edges, Figure 7 There is an edge between "who" and "country", and "who" is the word unit in the sample question, and "country" is the word unit in the sample answer. The second eigenvector of the word unit "who" can be obtained from the second eigenvector group, and the third eigenvector of "country" can be obtained from the third eigenvector group. The second eigenvector of "who" and the third eigenvector of "country" can be multiplied, and the product can be normalized to obtain the attention value of the edge between "who" and "country".

[0233] Through the above method, it can be determined Figure 7 The attention value of each edge and the attention value of each node in the graph are added to the attention value of the node and the edge to obtain the second graph network.

[0234] It should be noted that step 812 to step 820 are subordinate descriptions of step 206, and their implementation process is the same as that of step 206. For specific implementation, please refer to the relevant description of step 206, which will not be repeated in this embodiment.

[0235] Step 822: input the first graph network and the second graph network into the graph convolutional network layer of the reading comprehension model, and determine the first hidden layer feature vector of the first graph network and the second hidden layer feature vector of the second graph network through the graph convolutional network layer.

[0236] Step 824: Perform a weighted summation on the first hidden layer feature vector and the second hidden layer feature vector to obtain a target hidden layer feature vector.

[0237] Step 826: Convert the value of each dimension of the target hidden layer feature vector into at least one prediction probability through a sequence labeling function.

[0238] Among them, each dimension of the target hidden layer feature vector corresponds to a word unit, and at least one prediction probability corresponding to each dimension represents the probability that the predicted label of the word unit corresponding to each dimension is at least one label. In addition, the length of the target hidden layer feature vector is the same as the length of the sample text segment, that is, it can be considered that the dimension of the target hidden layer feature vector is the same as the number of word units in the sample text segment.

[0239] Exemplarily, assume that the target hidden layer feature vector is a 6-dimensional vector, and the 6 dimensions respectively correspond to the word units "I", "love", "I", "my", "ancestors", "country". Then, each dimension in the target hidden layer feature vector is converted into 3 prediction probabilities, and each probability corresponds to the possibility of the label "BIO" appearing. For example, for the word unit "I", assume that the calculated prediction probabilities are 0.2, 0.3, and 0.5 respectively.

[0240] Step 828: Determine the prediction label of the word unit corresponding to each dimension based on at least one prediction probability corresponding to each dimension.

[0241] Continuing with the above example, since 0.5 is the largest, it can be determined that the prediction label corresponding to "I" is "O".

[0242] Step 830: Use the word unit corresponding to the start word of the corresponding answer and the word unit corresponding to the middle and end words of the corresponding answer as the predicted answer.

[0243] Continuing with the above example, assume that the predicted labels corresponding to the 6 word units are determined to be "O", "O", "O", "O", "B", and "I" respectively. Since the label "B" indicates the start word of the answer and the label "I" indicates the middle and end words of the answer, it can be considered that "ancestors" and "country" are the predicted answers.

[0244] It should be noted that steps 822 - 830 are the subordinate descriptions of step 208, and their implementation processes are the same as those of step 208. For specific implementations, refer to the relevant descriptions of step 208, which will not be elaborated here in this embodiment.

[0245] Step 832: Train the reading comprehension model based on the difference between the predicted answer and the sample answer.

[0246] Step 834: If the loss value is less than the preset threshold, stop training the reading comprehension model.

[0247] Step 836: If the loss value is greater than or equal to the preset threshold, continue training the reading comprehension model.

[0248] It should be noted that steps 832 - 836 are the subordinate descriptions of step 210, and their implementation processes are the same as those of step 210. For specific implementations, refer to the relevant descriptions of step 210, which will not be elaborated here in this embodiment.

[0249] In the embodiment of the present application, the initial first graph network of the sample text segment and the sample answer is constructed by the graph construction network layer of the reading comprehension model, and the initial second graph network of the sample question and the sample answer is constructed; the sample text segment, the sample question and the sample answer are input into the feature extraction layer of the reading comprehension model to obtain the first feature vector group, the second feature vector group and the third feature vector group respectively; the first feature vector group, the second feature vector group and the third feature vector group are input into the attention layer of the reading comprehension model, and the attention values ​​are added to the nodes and edges included in the initial first graph network and the initial second graph network respectively, so as to obtain the first graph network and the second graph network; the first graph network and the second graph network are input into the graph convolution network layer of the reading comprehension model to obtain the predicted answer; the reading comprehension model is trained based on the difference between the predicted answer and the sample answer until the training stop condition is reached. Through the method of the present application, the feature vectors of the sample text segment, the sample question and the sample answer can be effectively utilized to extract the correlation between the three, and the reading comprehension model is trained in combination with the correlation between the sample text segment, the sample question and the sample answer, so as to improve the accuracy of the reading comprehension model in performing the reading comprehension task.

[0250] See also Fig. 9 , Fig. 9 A flowchart of a reading comprehension method provided according to an embodiment of the present application is shown, including steps 902 to 908.

[0251] Step 902, constructing an initial first graph network of the target text and the target answer through the graph construction network layer of the reading comprehension model, and constructing an initial second graph network of the target question and the target answer.

[0252] As an example, if the target question is a multiple-choice question, the target answer may be a text obtained by concatenating multiple options; if the target question is a short-answer question, the target answer may be a keyword in the target text.

[0253] For example, suppose the target text is "Li Bai wrote countless poems in his life and was called the Immortal Poet", the target question is a multiple-choice question, and the target question is "Which poet is called the Immortal Poet", and the three options are "Li Bai", "Du Fu" and "Su Shi", then these three options can be spliced ​​together as the target answer, and the target answer can be "Li Bai Du Fu Su Shi".

[0254] For example, assuming that the target question is a short-answer question, and the target question is "Which poet is called the Immortal Poet", and the target text is "'Song of the Wine' expresses the open-minded, optimistic, self-confident spirit and indignation at social reality in bold language. It is the work of the Immortal Poet Li Bai", then keywords can be extracted from the target text to obtain "Song of the Wine", "open-minded, unrestrained", "optimistic and self-confident", "Imperial Poet" and "Li Bai", and then "Song of the Wine is open-minded, unrestrained, optimistic and self-confident, the Immortal Poet Li Bai" can be taken as the target answer.

[0255] As an example, the initial first graph network is used to characterize the association relationship between the target text and the target answer, and the initial second graph network is used to characterize the association relationship between the target question and the target answer.

[0256] For example, see Fig.10 , the target text, target question and target answer can be input into the graph construction network layer of the reading comprehension model, an initial first graph network is obtained based on the target text and the target answer, and an initial second graph network is obtained based on the target question and the target answer.

[0257] In implementation, if the text length of the target text is less than the length threshold, the specific implementation of constructing the initial first graph network of the target text and the target answer through the graph construction network layer of the reading comprehension model, and constructing the initial second graph network of the target question and the target answer may include: constructing an initial third graph network based on the dependency relationship between word units in the target text, and constructing an initial fourth graph network based on the dependency relationship between word units in the target question. Constructing the initial first graph network based on the association relationship between the initial third graph network and the target answer, and constructing the initial second graph network based on the association relationship between the initial fourth graph network and the target answer.

[0258] The initial third graph network is used to represent the dependency relationship between word units in the target text, and the initial fourth graph network is used to represent the dependency relationship between word units in the target question.

[0259] That is, if the text length of the target text is less than the length threshold, the reading comprehension model can process the target text by first constructing an initial third graph network reflecting the dependency relationship between word units in the target text, and then constructing a first graph network based on the initial third graph network according to the association relationship between the target answer and the target text. Also, first construct an initial fourth graph network reflecting the dependency relationship between word units in the target question, and then construct a second graph network based on the initial fourth graph network according to the association relationship between the target answer and the target question.

[0260] It should be noted that the length threshold can be set by the user according to actual needs, or it can be set by the device by default, and the embodiments of the present application are not limited to this.

[0261] In some embodiments, the specific implementation of constructing an initial third graph network based on the dependency relationship between word units in the target text may include: taking the word units in the target text as nodes to obtain multiple nodes; based on the dependency relationship between word units in the target text, connecting the nodes with dependency relationships to obtain the initial third graph network.

[0262] That is to say, by taking word units in the target text as nodes and the dependency relationships between word units as edges, an initial third graph network representing the dependency relationships between word units in the target text can be constructed.

[0263] As an example, the Stanford Core NLP algorithm may be used to perform dependency analysis on the target text, and the dependency relationship between multiple word units in the target text may be obtained.

[0264] For example, taking the target text "I love my motherland" as an example, the Stanford Core NLP algorithm is used to perform dependency analysis on the target text "I love my motherland", and we can get "I" as the subject, "love" as the predicate, "my motherland" as the object, and we can get the dependency relationship between "I", "love", "I", "of", "ancestor" and "country". For example, in the target text, an "I" has a dependency relationship with "love", an "I" has a dependency relationship with "of" and "ancestor", "love" also has a dependency relationship with "ancestor", and "ancestor" has a dependency relationship with "country". Based on the above dependency relationships, we can get Figure 4 The initial third graph network shown.

[0265] In some embodiments, the specific implementation of constructing the initial first graph network based on the association relationship between the initial third graph network and the target answer may include: based on the association relationship between the word units in the target answer and the word units in the target text, taking the word units in the target answer as target nodes, connecting the target nodes with the nodes in the initial third graph network to obtain the initial first graph network.

[0266] That is to say, the word unit in the target answer can be used as the target node, and the target node can be connected to the node corresponding to the word unit of the target text in the initial third graph network. In this way, an initial first graph network can be obtained that represents the association relationship between the word unit of the target text and the word unit of the target answer.

[0267] As an example, the target node corresponding to the word unit in the target answer can be connected to the node corresponding to each word unit in the target text. Or, as another example, the target node corresponding to the word unit in the target answer can be connected to the node in the initial third graph network that has an association relationship with the target node.

[0268] For example, taking the target text as "I love my motherland" and the target question as a multiple-choice question, assuming that the options include "motherland" and "hometown", the target answer is "motherland hometown", and the word unit in the target answer can be used as the target node, and the "ancestor" in the target answer is connected to each node in the initial third graph network, and the "country" in the target answer is connected to each node in the initial third graph network, and the "home" in the target answer is connected to each node in the initial third graph network. Connect "township" in the target answer is connected to each node in the initial third graph network, and you can get Fig.11 The first network shown in Figure 1, Fig.11 The bold node is the target node.

[0269] In some embodiments, the specific implementation of constructing the initial fourth graph network based on the dependency relationship between word units in the target problem may include: taking the word units in the target problem as nodes to obtain multiple nodes; based on the dependency relationship between word units in the target problem, connecting the nodes with dependency relationships to obtain the initial fourth graph network.

[0270] That is to say, by taking the word units in the target problem as nodes and the dependency relationships between the word units as edges, an initial fourth graph network representing the dependency relationships between the word units in the target problem can be constructed.

[0271] As an example, the Stanford Core NLP algorithm can be used to perform dependency analysis on the target question to obtain the dependency relationship between multiple word units in the target question.

[0272] As an example, by performing dependency analysis on the target question "Who do I love" through the Stanford Core NLP algorithm, we can get "I" as the subject, "love" as the predicate, "who" as the object, and the dependency relationship between "I", "love" and "who" can be obtained. For example, in the target question, there is a dependency relationship between "I" and "love", between "love" and "who", and between "I" and "who". Based on the above dependency relationships, see Figure 6 , we can get Figure 6 The initial fourth graph network shown.

[0273] In some embodiments, the specific implementation of constructing the initial second graph network based on the association relationship between the initial fourth graph network and the target answer may include: based on the association relationship between the word units in the target answer and the word units in the target question, taking the word units in the target answer as target nodes, connecting the target nodes with the nodes in the initial fourth graph network to obtain the initial second graph network.

[0274] That is to say, the word unit in the target answer can be used as the target node, and the target node can be connected to the node corresponding to the word unit of the target question in the initial fourth graph network. In this way, an initial second graph network can be obtained that represents the association relationship between the word unit of the target question and the word unit of the target answer.

[0275] As an example, the target node corresponding to the word unit in the target answer can be connected to the node corresponding to each word unit in the target question. Or, as another example, the target node corresponding to the word unit in the target answer can be connected to the node in the initial fourth graph network that has an association relationship with the target node.

[0276] For example, taking the target question as "Who do I love" and the target answer as "homeland", the word unit in the target answer can be used as the target node, and the "ancestor" in the target answer is connected to each node in the initial fourth graph network, and the "country" in the target answer is connected to each node in the initial fourth graph network, and the "home" in the target answer is connected to each node in the initial fourth graph network. Connect "township" in the target answer is connected to each node in the initial fourth graph network, and you can get Fig.12 The initial second graph network shown, Fig.12 The bold node is the target node.

[0277] In the embodiments of the present application, the association between the target text and the target answer, as well as the association between the target text and the target question, can be fully utilized to train the reading comprehension model, which can improve the accuracy of the reading comprehension model in performing reading comprehension tasks.

[0278] It should be noted that the above is an example of the target text length being less than the length threshold. If the target text is a paragraph-level text, that is, the target text length is greater than or equal to the length threshold, the reading comprehension model may not be able to process the target text. Therefore, the target text can be segmented or sentence-processed to obtain multiple target text segments, and then the initial first graph network of each target text segment and the target question can be constructed by the above method. For example, if the target text is divided into three target text segments, three first graph networks can be constructed.

[0279] Step 904: input the target text, the target question, and the target answer into the feature extraction layer of the reading comprehension model to obtain a first feature vector group, a second feature vector group, and a third feature vector group, respectively.

[0280] Among them, the feature extraction layer can be used to extract the features of the input text.

[0281] As an example, the first feature vector group is a feature vector group obtained after the target text passes through the feature extraction layer, the second feature vector group is a feature vector group obtained after the target question target text passes through the feature extraction layer, and the third feature vector group is a feature vector group obtained after the target answer target text passes through the feature extraction layer. In addition, the first feature vector group includes multiple first feature vectors, each of which corresponds to a word unit in the target text, the second feature vector group includes multiple second feature vectors, each of which corresponds to a word unit in the target question, and the third feature vector group includes multiple third feature vectors, each of which corresponds to a word unit in the target answer.

[0282] For example, see Fig.10 , the target text, the target question, and the target answer can be input into the feature extraction layer of the reading comprehension model to determine the first feature vector group, the second feature vector group, and the third feature vector group, respectively.

[0283] In implementation, if the text length of the target text is less than the length threshold, the specific implementation of this step may include: performing word segmentation processing on the target text, the target question and the target answer to obtain a first word unit group, a second word unit group and a third word unit group respectively; performing word embedding processing on the first word unit group, the second word unit group and the third word unit group to obtain a first word vector group, a second word vector group and a third word vector group respectively; encoding the first word vector group, the second word vector group and the third word vector group to obtain the first feature vector group, the second feature vector group and the third feature vector group respectively.

[0284] In an embodiment of the present application, the feature extraction layer may include a word embedding processing function and an encoding function. As an example, the feature extraction layer may include a word embedding processing module and an encoding module.

[0285] Exemplarily, the feature extraction layer can adopt the structure of the Bert model. Since the feature vector obtained by the Bert model is a feature vector combined with the semantic information of the full text, it can make more full use of the feature vectors of word units in the target text, target question, and target answer, and can improve the accuracy of the reading comprehension model.

[0286] As an example, taking the target text as an example, if the target text is Chinese text, a character can be divided into a word unit, and a punctuation mark can be divided into a word unit; if the target text is a foreign text, a word can be divided into a word unit, and a phrase can be divided into a word unit; if there are numbers in the target text, the numbers can be divided into a word unit alone.

[0287] For example, assuming that the target text is "Li Bai wrote countless poems in his life and was called the Immortal Poet", we can get the multiple first word units of "Li", "Bai", "one", "life", "write", "poem", "no", "number", "," "be", "called", "for", "poem", and "immortal".

[0288] As an example, each first word unit in the first word unit group can be embedded in a one-hot encoding manner to obtain a word vector for each first word unit, each second word unit in the second word unit group can be embedded in a word to obtain a word vector for each second word unit, and each word unit in the third word unit group can be embedded in a word to obtain a word vector for each third word unit.

[0289] As another example, each first word unit in the first word unit group can be word embedded by word2vec encoding to obtain a word vector for each first word unit, each second word unit in the second word unit group can be word embedded to obtain a word vector for each second word unit, and each word unit in the third word unit group can be word embedded to obtain a word vector for each third word unit.

[0290] As an example, by encoding each first word vector, each second word vector and each third word vector, we can obtain the vector representation of the fused target text full-text semantic information corresponding to each first word unit, that is, the first feature vector, and the vector representation of the fused target question full-text semantic information corresponding to each second word unit, that is, the second feature vector, and the vector representation of the fused target answer full-text semantic information corresponding to each third word unit, that is, the third feature vector, and then we can obtain the first feature vector group, the second feature vector group and the third feature vector group.

[0291] For example, if the target question is "Who do I love", input "Who do I love" into the feature extraction layer, "Who do I love" can be segmented to obtain word units "I", "love" and "who", and "I", "love" and "who" can be word embedded respectively to obtain the word vector of "I", the word vector of "love" and the word vector of "who", and the word vector of "I", "love" and "who" can be encoded to obtain the third feature vector obtained by combining the word vectors of "I" with the word vectors of the two words "love" and "who", and the third feature vector obtained by combining the word vectors of "love" with the word vectors of the two words "I" and "who", and the third feature vector obtained by combining the word vectors of "who" with the word vectors of the two words "I" and "love". Similarly, inputting the target text "I love my motherland" into the feature extraction layer can output the first feature vector of each word in the target text, and inputting the target answer "homeland" into the feature extraction layer can output the second feature vector of each word in the target answer.

[0292] In the embodiment of the present application, the feature extraction layer can adopt the structure of the BERT model that has been preprocessed and fine-tuned using the reading comprehension task. In this way, the obtained first feature vector group, second feature vector group and third feature vector group can more accurately reflect the semantics of the target text, the semantics of the target question and the semantics of the target answer, respectively, which can improve the training rate and usage accuracy of the model.

[0293] It should be noted that the above is explained by taking the text length of the target text as an example that is less than the length threshold. When the text length of the target text is less than the length threshold, the reading comprehension model can process the target text, so the target text can be directly segmented. In other embodiments, if the target text is a chapter-level text, that is, the text length of the target text is greater than or equal to the length threshold, the reading comprehension model may not be able to process the target text. Therefore, the target text can be segmented or sentence-processed first to obtain multiple target text segments, and then the first feature vector group of each target text segment is extracted through the feature extraction layer. For example, if the target text is divided into three target text segments, three first feature vector groups can be extracted, and the three first feature vector groups are respectively used to represent the semantics of the three target text segments. In addition, the method for extracting the first feature vector group of the target text segment is the same as the method for extracting the first feature vector group of the target text described above, and this embodiment will not be repeated here.

[0294] Step 906: Input the first feature vector group, the second feature vector group, and the third feature vector group into the attention layer of the reading comprehension model, and add attention values ​​to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain the first graph network and the second graph network.

[0295] The first graph network is an initial first graph network including attention values ​​of nodes and attention values ​​of edges. The second graph network is an initial second graph network including attention values ​​of nodes and attention values ​​of edges.

[0296] As an example, the attention layer may adopt the structure of the attention layer of the BERT model. Alternatively, the attention layer may adopt the structure of any other model including an attention mechanism, which is not limited in the embodiments of the present application.

[0297] As an example, in this step, the first feature vector group, the second feature vector group, the third feature vector group, the initial first graph network and the initial second graph network can be input into the attention layer of the reading comprehension model, and attention values ​​are added to the nodes and edges of the initial first graph network based on the first feature vector group and the second feature vector group to obtain the first graph network, and attention values ​​are added to the nodes and edges of the initial second graph network based on the second feature vector group and the third feature vector group to obtain the second graph network. For example, see Fig.10 The first feature vector group, the second feature vector group, the third feature vector group, the initial first graph network and the initial second graph network can be input into the attention layer of the reading comprehension model, and attention values ​​are added to the nodes and edges included in the initial first graph network based on the first feature vector group and the second feature vector group to obtain the first graph network; and attention values ​​are added to the nodes and edges included in the initial second graph network based on the second feature vector group and the third feature vector group to obtain the second graph network.

[0298] Alternatively, as another example, in this step, the first feature vector group, the second feature vector group, and the third feature vector group can be input into the attention layer of the reading comprehension model, and based on the first feature vector group and the second feature vector group, the attention values ​​of the nodes and edges included in the initial first graph network are obtained, and the attention values ​​are added to the initial first graph network to obtain the first graph network; and based on the second feature vector group and the third feature vector group, the attention values ​​of the nodes and edges included in the initial second graph network are obtained, and the attention values ​​are added to the initial second graph network to obtain the second graph network.

[0299] In implementation, if the text length of the target text is less than the length threshold, the specific implementation of this step may include: adding attention values ​​to the nodes and edges of the initial first graph network based on the first feature vector group and the third feature vector group through the attention layer; adding attention values ​​to the nodes and edges of the initial second graph network based on the second feature vector group and the third feature vector group through the attention layer.

[0300] As an example, the initial first graph network represents the association between the target text and the target answer, the first feature vector group is the feature representation of the target text, and the third feature vector group is the feature representation of the target answer, so attention values ​​can be added to the nodes and edges of the initial first graph network based on the first feature vector group and the third feature vector group. Similarly, the initial second graph network represents the association between the target question and the target answer, the second feature vector group is the feature representation of the target question, and the third feature vector group is the feature representation of the target answer, so attention values ​​can be added to the nodes and edges of the initial second graph network based on the second feature vector group and the third feature vector group.

[0301] In some embodiments, through the attention layer, based on the first feature vector group and the third feature vector group, the specific implementation of adding attention values ​​to the nodes and edges of the initial first graph network may include: using the first feature vector in the first feature vector group as the attention value of the first node in the initial first graph network, and the first node is the node corresponding to the word unit of the target text in the initial first graph network; using the third feature vector in the third feature vector group as the attention value of the second node in the initial first graph network, and the second node is the node corresponding to the word unit of the target answer in the initial first graph network; based on the first feature vector group, determining the attention value between the two first nodes where an edge exists in the initial first graph network and using it as the attention value of the edge; based on the first feature vector group and the third feature vector group, determining the attention value between the first node and the second node where an edge exists in the initial first graph network and using it as the attention value of the edge.

[0302] That is, the first feature vector in the first feature vector group can be used as the attention value of the node corresponding to the word unit of the target text in the initial first graph network, and the third feature vector in the third feature vector group can be used as the attention value of the node corresponding to the word unit of the target answer in the initial first graph network. And the attention value of the edge between the word units of the target text in the initial first graph network is determined according to the first feature vector group, and the attention value of the edge between the word unit of the target text and the word unit of the target answer in the initial first graph network is determined according to the first feature vector group and the third feature vector group.

[0303] As an example, for two first nodes with an edge, attention calculation can be performed on the first feature vectors of the word units corresponding to the two first nodes to obtain the attention value of the edge. Specifically, the attention calculation for the two first feature vectors is to multiply the two first feature vectors and normalize the result to obtain the attention value. For example, see Fig.11 , Fig.11There is an edge between "I" and "love", and "I" and "love" are word units in the target text. The first feature vector of the word unit "I" can be obtained from the first feature vector group, and the first feature vector of "love" can be obtained from the first feature vector group. The first feature vector of "I" and the first feature vector of "love" can be multiplied, and the product can be normalized to obtain the attention value of the edge between "I" and "love".

[0304] As an example, for the first node and the second node with an edge, attention calculation can be performed on the first feature vector of the word unit corresponding to the first node and the third feature vector of the word unit corresponding to the second node, and the attention value of the edge can be obtained. Specifically, the attention calculation for the first feature vector and the third feature vector is to multiply the first feature vector and the third feature vector and normalize the result to obtain the attention value. For example, see Fig.11 , Fig.11 There is an edge between "I" and "home", and "I" is a word unit in the target text, and "home" is a word unit in the target answer. The first feature vector of the word unit "I" can be obtained from the first feature vector group, and the third feature vector of "home" can be obtained from the third feature vector group. The first feature vector of "I" and the third feature vector of "home" can be multiplied, and the product can be normalized to obtain the attention value of the edge between "I" and "home".

[0305] Through the above method, it can be determined Fig.11 The attention value of each edge and the attention value of each node in the network are added to the attention value of the node and the edge to obtain the first graph network.

[0306] In some embodiments, through the attention layer, based on the second feature vector group and the third feature vector group, the specific implementation of adding attention values ​​to the nodes and edges of the initial second graph network may include: using the second feature vector in the second feature vector group as the attention value of the third node in the initial second graph network, and the third node is the node corresponding to the word unit of the target question in the initial second graph network; using the third feature vector in the third feature vector group as the attention value of the fourth node in the initial second graph network, and the fourth node is the node corresponding to the word unit of the target answer in the initial second graph network; based on the second feature vector group, determining the attention value between the two third nodes where there is an edge in the initial second graph network and using it as the attention value of the edge; based on the third feature vector group, determining the attention value between the third node and the fourth node where there is an edge in the initial second graph network and using it as the attention value of the edge.

[0307] That is, the second eigenvector in the second eigenvector group can be used as the attention value of the node corresponding to the word unit of the target question in the initial second graph network, and the third eigenvector in the third eigenvector group can be used as the attention value of the node corresponding to the word unit of the target answer in the initial second graph network. And the attention value of the edge between the word units of the target question in the initial second graph network is determined according to the second eigenvector group, and the attention value of the edge between the word unit of the target question and the word unit of the target answer in the initial second graph network is determined according to the second eigenvector group and the third eigenvector group.

[0308] As an example, for two third nodes with an edge, attention calculation can be performed on the second feature vectors of the word units corresponding to the two third nodes to obtain the attention value of the edge. Specifically, the attention calculation for the two second feature vectors is to multiply the two second feature vectors and normalize the result to obtain the attention value. For example, see Fig.12 , Fig.12 There is an edge between "I" and "who", and "I" and "who" are word units in the target question. The second eigenvector of the word unit "I" can be obtained from the second eigenvector group, and the second eigenvector of "who" can be obtained from the second eigenvector group. The second eigenvector of "I" and the second eigenvector of "who" can be multiplied, and the product can be normalized to obtain the attention value of the edge between "I" and "who".

[0309] As an example, for the third node and the fourth node of the edge, the attention value of the edge can be obtained by performing attention calculation on the second eigenvector of the word unit corresponding to the third node and the third eigenvector of the word unit corresponding to the fourth node. Specifically, the attention value of the edge can be obtained by multiplying the second eigenvector and the third eigenvector and normalizing the result. Fig.12 , Fig.12 There is an edge between "who" and "home", and "who" is the word unit in the target question, and "home" is the word unit in the target answer. The second eigenvector of the word unit "who" can be obtained from the second eigenvector group, and the third eigenvector of "home" can be obtained from the third eigenvector group. The second eigenvector of "who" and the third eigenvector of "home" can be multiplied, and the product can be normalized to obtain the attention value of the edge between "who" and "home".

[0310] Through the above method, it can be determined Fig.12 The attention value of each edge and the attention value of each node in the graph are added to the attention value of the node and the edge to obtain the second graph network.

[0311] In the embodiment of the present application, the attention calculation can be performed on the two feature vectors using the above formula (1). For the specific implementation, please refer to the relevant description of step 206, which will not be described in detail in the embodiment of the present application.

[0312] It should be noted that the above is explained by taking the text length of the target text as less than the length threshold, that is, the first feature vector group corresponds to the target text to determine the first graph network as an example. In other embodiments, for a target text, if the target text is divided into multiple target text segments, the first feature vector group is the feature vector group of the target text segments, then attention values ​​can be added to the nodes and edges of the initial first graph network corresponding to the target text segment based on the first feature vector group of each target text segment and the third feature vector group of the target answer.

[0313] For example, if the target text is divided into three target text segments, three first feature vector groups can be extracted to generate three initial first graph networks. For the reference initial first graph network, the reference initial first graph network is generated based on the reference target text segment and the target answer, then the reference initial first graph network can be added with attention values ​​for the nodes and edges according to the first feature vector group of the reference target text segment and the third feature vector group of the target answer, to obtain the reference first graph network. Among them, the reference target text segment is any one of the multiple text segments, and the reference initial first graph network corresponds to the reference target text segment, and the reference first graph network corresponds to the reference target text segment. Similarly, three first graph networks can be obtained in the above manner. In addition, the implementation process of adding attention values ​​to the nodes and edges of the initial first graph network corresponding to the target text segment is the same as the implementation process of adding attention values ​​to the nodes and edges of the initial first graph network mentioned above. For details, please refer to the relevant description of the above-mentioned embodiment of this step, and this embodiment will not be repeated here.

[0314] It should be noted that steps 904 to 906 are the specific implementation of the step of "inputting the target text, the target question and the target answer into the text processing layer of the reading comprehension model, adding attention values ​​to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain the first graph network and the second graph network".

[0315] Step 908: Input the first graph network and the second graph network into the graph convolutional network layer of the reading comprehension model to obtain the answer to the target question.

[0316] As an example, the graph convolutional network layer can be a GCN (Graph Convolutional Network) model.

[0317] For example, see Fig.10, the first graph network and the second graph network can be input into the graph convolutional network layer of the reading comprehension model to get the answer.

[0318] In implementation, if the text length of the target text is less than the length threshold, the first graph network is a graph network that reflects the association between the target text and the target answer, and the first graph network and the second graph network are input into the graph convolutional network layer of the reading comprehension model. The specific implementation of obtaining the answer may include: determining the first hidden layer feature vector of the first graph network and the second hidden layer feature vector of the second graph network through the graph convolutional network layer; performing weighted summation of the first hidden layer feature vector and the second hidden layer feature vector to obtain the target hidden layer feature vector; and determining the answer based on the target hidden layer feature vector.

[0319] The first hidden layer feature vector is a vector representation of the first graph network obtained after the first graph network is convolved by the graph convolutional network layer. The second hidden layer feature vector is a vector representation of the second graph network obtained after the second graph network is convolved by the graph convolutional network layer.

[0320] As an example, the first graph network can be input into the graph convolutional network layer for convolution processing to obtain a first hidden layer feature vector, and the second graph network can be input into the graph convolutional network layer for convolution processing to obtain a second hidden layer feature vector.

[0321] It should be noted that, at the graph convolutional network layer, the graph network can be convolved using the above formula (2). For specific implementation, please refer to the relevant description of step 208, which will not be described in detail in the embodiment of the present application.

[0322] As an example, when performing weighted summation on the first hidden layer feature vector and the second hidden layer feature vector, the weight of the first hidden layer feature vector and the weight of the second hidden layer feature vector may be the same or different, and may be set by the user according to actual needs or may be set by default by the computing device. This embodiment of the present application is not limited to this.

[0323] In some embodiments, the specific implementation of determining the answer based on the target hidden layer feature vector may include: converting the value of each dimension of the target hidden layer feature vector into at least one probability through a sequence labeling function, each dimension of the target hidden layer feature vector corresponds to a word unit, and the at least one probability corresponding to each dimension represents the probability that the label of the word unit corresponding to each dimension is at least one label; determining the label of the word unit corresponding to each dimension based on the at least one probability corresponding to each dimension; and determining the answer based on the label of the word unit corresponding to each dimension.

[0324] As an example, a sequence labeling function is a function used when performing sequence labeling, which can map an input vector to at least one-dimensional probability, that is, at least one probability can be obtained for each vector.

[0325] Exemplarily, the target hidden layer feature vector may be used as the input of the sequence labeling function, and the probability corresponding to each dimension of the target hidden layer feature vector may be obtained through calculation of the sequence labeling function.

[0326] As an example, the labels may be B, I, and O. B represents the beginning word of the answer, that is, the first word of the answer; I represents the middle and ending word of the answer, that is, the second to the last word of the answer; and O represents a non-answer word, that is, a word that is not the answer.

[0327] It should be noted that the length of the target hidden layer feature vector is the same as the length of the target text.

[0328] Exemplarily, taking the target text "I love my motherland" as an example, the target hidden feature vector is a 6-dimensional vector, and the 6 dimensions correspond to the word units I, love, me, of, ancestor, and country, respectively. Then, each dimension in the target hidden feature vector is converted into 3 probabilities, and each probability corresponds to the possibility of the label "BIO" appearing. For example, for the word unit "love", assuming that the calculated probabilities are 0.2, 0.3, and 0.5 respectively, it can be determined that the probability of the label "O" is the largest, and the label corresponding to "love" is "O". Similarly, assuming that the labels corresponding to the 6 word units are determined to be "O", "O", "O", "O", "B", and "I". Since the label "B" represents the beginning word of the answer and the label "I" represents the middle and ending word of the answer, it can be considered that "ancestor" and "country" are the answers.

[0329] As an example, the at least one label includes an answer start word, an answer middle end word, and a non-answer word. The specific implementation of determining the answer based on the label of the word unit corresponding to each dimension may include: using the word unit corresponding to the answer start word and the word unit corresponding to the answer middle end word as the answer.

[0330] In other words, you can concatenate the beginning word of the answer and the ending word in the middle of the answer to get the answer.

[0331] Continuing with the above example, we can identify “motherland” as the answer.

[0332] It should be noted that the above is explained by taking the case where the text length of the target text is less than the length threshold, that is, the first graph network corresponds to the entire target text. In other embodiments, for a target text, if the target text is split into multiple target text segments, the first graph network corresponds to the target text segment, and the answer obtained by inputting the first graph network and the second graph network into the graph convolutional network layer corresponds to the target text segment, but the answer is not necessarily the correct answer to the target question. Therefore, in this case, each target text segment can get an answer, then multiple answers can be obtained, and then the correct answer to the target question can be determined from the multiple answers.

[0333] As an example, the target answer that appears most frequently among the multiple answers can be used as the answer to the target question. For example, assuming that the target text is divided into 10 target text segments, each of the first graph network and the second graph network is input into the graph convolutional network layer for processing, 10 answers can be obtained, and the 10 answers include the target answer, and the target answer that appears most frequently among the 10 answers can be used as the answer to the target question.

[0334] Through the method of the present application, the feature vectors of the target text, target question and target answer can be effectively utilized to extract the correlation between the three. The answer to the target question can be determined through a reading comprehension model in combination with the correlation between the sample text, the target question and the target answer, thereby improving the accuracy of the reading comprehension model in performing reading comprehension tasks.

[0335] The following combination Fig.13 Taking the application of the reading comprehension method provided in this application in a reading comprehension task as an example, the training method of the reading comprehension model is further explained. Fig.13 A processing flow chart of a reading comprehension method for multiple-choice questions provided by an embodiment of the present application is shown, which may specifically include the following steps:

[0336] Step 1302: Obtain target text, target question, and target answer.

[0337] In the embodiment of the present application, there is no limitation on the form of the target question and the text length of the target text. This embodiment only illustrates the reading comprehension method by taking the target question as a multiple-choice question and the text length of the target text being less than a length threshold as an example.

[0338] For example, the target text is "I love my motherland", the target question is "Who do I love", and the target answer is two options, namely "homeland".

[0339] Step 1304: Input the target text, target question and target answer into the graph construction network layer of the reading comprehension model, and construct an initial third graph network based on the dependency relationship between word units in the target text.

[0340] For example, taking the target text "I love my motherland" as an example, through the Stanford Core NLP algorithm, the target text "I love my motherland" is subjected to dependency analysis, and it can be obtained that "I" is the subject, "love" is the predicate, "my motherland" is the object, and the dependency relationship between "I", "love", "I", "of", "ancestor" and "country" can be obtained. For example, in the target text, an "I" has a dependency relationship with "love", an "I" has a dependency relationship with "of" and "ancestor", "love" also has a dependency relationship with "ancestor", and "ancestor" has a dependency relationship with "country". Based on the above dependency relationships, it can be obtained Figure 4 The initial third graph network shown.

[0341] Step 1306: Based on the association relationship between the word units in the target answer and the word units in the target text, the word units in the target answer are used as target nodes, and the target nodes are connected to the nodes in the initial third graph network to obtain the initial first graph network.

[0342] Continuing with the above example, we can use the word unit in the target answer as the target node, connect the "ancestor" in the target answer to each node in the initial third graph network, connect the "country" in the target answer to each node in the initial third graph network, connect the "home" in the target answer to each node in the initial third graph network, and connect the "township" in the target answer to each node in the initial third graph network. We can get Fig.11 The first network shown in Figure 1, Fig.11 The bold node is the target node.

[0343] Step 1308: Input the target text, target question and target answer into the graph construction network layer of the reading comprehension model, and construct an initial fourth graph network based on the dependency relationship between word units in the target question.

[0344] Continuing with the above example, by using the Stanford Core NLP algorithm to perform dependency analysis on the target question "Who do I love", we can get "I" as the subject, "love" as the predicate, "who" as the object, and the dependency relationship between "I", "love", and "who" can be obtained. For example, in the target question, there is a dependency relationship between "I" and "love", a dependency relationship between "love" and "who", and a dependency relationship between "I" and "who". Based on the above dependency relationships, see Figure 6 , we can get Figure 6 The initial fourth graph network shown.

[0345] Step 1310: Based on the association relationship between the word units in the target answer and the word units in the target question, using the word units in the target answer as target nodes, connect the target nodes to the nodes in the initial fourth graph network to obtain the initial second graph network.

[0346] Continuing with the above example, the word units in the target answer can be used as target nodes. Connect "ancestor" in the target answer to each node in the initial fourth graph network respectively, connect "country" in the target answer to each node in the initial fourth graph network respectively, connect "home" in the target answer to each node in the initial fourth graph network respectively, and connect "hometown" in the target answer to each node in the initial fourth graph network respectively, and the initial second graph network as shown can be obtained. Fig.12 The bold nodes in are the target nodes. Fig.12

[0347] Step 1312: Input the target text, target question, and target answer into the feature extraction layer of the reading comprehension model. Perform word segmentation on the target text to obtain the first word unit group, perform word segmentation on the target question to obtain the second word unit group, and perform word segmentation on the target answer to obtain the third word unit group.

[0348] Continuing with the above example, after word segmentation of the target text, the first word unit group can be obtained, which are "I", "love", "my", "ancestor", "country" respectively. Similarly, after word segmentation of the target question, the second word unit group can be obtained, which are "I", "love", "who" respectively. After word segmentation of the target answer, the third word unit group can be obtained, which are "ancestor", "country", "home", and "hometown" respectively.

[0349] Step 1314: Perform word embedding processing on the first word unit group, the second word unit group, and the third word unit group to obtain the first word vector group, the second word vector group, and the third word vector group respectively.

[0350] Continuing with the above example, perform word embedding processing on each first word unit in the first word unit group, and the first word vector of "I", the first word vector of "love", the first word vector of "my", the first word vector of "ancestor", the first word vector of "country" can be obtained respectively. Similarly, perform word embedding processing on each second word unit in the second word unit group, and the second word vector of "I", the second word vector of "love", the second word vector of "who" can be obtained respectively. Perform word embedding processing on each third word unit in the third word unit group, and the third word vector of "ancestor", the third word vector of "country", the third word vector of "home", the third word vector of "hometown" can be obtained respectively.

[0351] Step 1316, encode the first word vector group, the second word vector group, and the third word vector group to obtain a first feature vector group, a second feature vector group, and a third feature vector group, respectively.

[0352] Continuing with the above example, by encoding the word vectors of "I", "love", and "who", we can obtain the third feature vector of "I" combined with the word vectors of "love" and "who", and the third feature vector of "love" combined with the word vectors of "I" and "who". Similarly, we can obtain the second feature vector of each word unit in the target question and the third feature vector of each word unit in the target answer.

[0353] Step 1318, through the attention layer, based on the first feature vector group and the third feature vector group, add attention values ​​to the nodes and edges of the initial first graph network to obtain the first graph network.

[0354] Continuing with the above example, we can Fig.11 The feature vector of each node in is used as the attention value of each node. Fig.11 There is an edge between "I" and "love" in the target text, and "I" and "love" are word units in the target text. The first feature vector of the word unit "I" can be obtained from the first feature vector group, and the first feature vector of "love" can be obtained from the first feature vector group. The first feature vector of "I" and the first feature vector of "love" can be multiplied, and the product can be normalized to obtain the attention value of the edge between "I" and "love". There is an edge between "I" and "home", and "I" is a word unit in the target text, and "home" is a word unit in the target answer. The first feature vector of the word unit "I" can be obtained from the first feature vector group, and the third feature vector of "home" can be obtained from the third feature vector group. The first feature vector of "I" and the third feature vector of "home" can be multiplied, and the product can be normalized to obtain the attention value of the edge between "I" and "home".

[0355] Through the above method, it can be determined Fig.11 The attention value of each edge and the attention value of each node in the network are added to the attention value of the node and the edge to obtain the first graph network.

[0356] Step 1320, through the attention layer, based on the second feature vector group and the third feature vector group, add attention values ​​to the nodes and edges of the initial second graph network to obtain the second graph network.

[0357] Continuing with the above example, we can Fig.11The feature vector of each node in is used as the attention value of each node. Fig.12 There is an edge between "I" and "who" in the question, and "I" and "who" are word units in the target question. The second eigenvector of the word unit "I" can be obtained from the second eigenvector group, and the second eigenvector of "who" can be obtained from the second eigenvector group. The second eigenvector of "I" and the second eigenvector of "who" can be multiplied, and the product can be normalized to obtain the attention value of the edge between "I" and "who". There is an edge between "who" and "home", and "who" is a word unit in the target question, and "home" is a word unit in the target answer. The second eigenvector of the word unit "who" can be obtained from the second eigenvector group, and the third eigenvector of "home" can be obtained from the third eigenvector group. The second eigenvector of "who" and the third eigenvector of "home" can be multiplied, and the product can be normalized to obtain the attention value of the edge between "who" and "home".

[0358] Through the above method, it can be determined Fig.12 The attention value of each edge and the attention value of each node in the graph are added to the attention value of the node and the edge to obtain the second graph network.

[0359] Step 1322: Input the first graph network and the second graph network into the graph convolutional network layer of the reading comprehension model, and determine the first hidden layer feature vector of the first graph network and the second hidden layer feature vector of the second graph network through the graph convolutional network layer.

[0360] As an example, the first graph network can be input into the graph convolutional network layer for convolution processing to obtain a first hidden layer feature vector, and the second graph network can be input into the graph convolutional network layer for convolution processing to obtain a second hidden layer feature vector.

[0361] Step 1324: Perform a weighted summation on the first hidden layer feature vector and the second hidden layer feature vector to obtain a target hidden layer feature vector.

[0362] Step 1326: Convert the value of each dimension of the target hidden layer feature vector into at least one prediction probability through a sequence labeling function.

[0363] As an example, a sequence labeling function is a function used when performing sequence labeling, which can map an input vector to at least one-dimensional probability, that is, at least one probability can be obtained for each vector.

[0364] Exemplarily, the target hidden layer feature vector may be used as the input of the sequence labeling function, and the probability corresponding to each dimension of the target hidden layer feature vector may be obtained through calculation of the sequence labeling function.

[0365] Continuing with the above example, the target text is "I love my motherland", which consists of 6 word units. Then the target hidden layer feature vector is a 6-dimensional vector, and the 6 dimensions respectively correspond to the word units "I", "love", "my", "mother", "land". Each dimension in the target hidden layer feature vector is converted into 3 prediction probabilities, and each probability corresponds to the possibility of the label "BIO" appearing. For example, for the word unit "land", assuming the calculated prediction probabilities are 0.5, 0.3, and 0.2 respectively, then 0.5 is the probability that the label of the word unit "land" is "B", 0.3 is the probability that the label of the word unit "land" is "I", and 0.2 is the probability that the label of the word unit "land" is "O". For the word unit "mother", assuming the calculated prediction probabilities are 0.3, 0.6, and 0.1 respectively, then 0.3 is the probability that the label of the word unit "mother" is "B", 0.6 is the probability that the label of the word unit "mother" is "I", and 0.1 is the probability that the label of the word unit "mother" is "O".

[0366] Step 1328: Determine the predicted label of the word unit corresponding to each dimension based on at least one prediction probability corresponding to each dimension.

[0367] Continuing with the above example, since 0.5 is the largest among the prediction probabilities corresponding to the word unit "land", and 0.5 is the probability that the label of the word unit "land" is "B", it can be determined that the predicted label corresponding to "land" is "B". Among the prediction probabilities corresponding to the word unit "mother", 0.6 is the largest, and 0.6 is the probability that the label of the word unit "mother" is "I", so it can be determined that the predicted label corresponding to "mother" is "I".

[0368] Step 1330: Use the word unit corresponding to the beginning word of the corresponding answer and the word unit corresponding to the middle and ending words of the corresponding answer as the answer to the target question.

[0369] Continuing with the above example, assuming the labels corresponding to the 6 word units "I", "love", "my", "mother", "land" are "O", "O", "O", "O", "B", "I" respectively. Since the label "B" indicates the beginning word of the answer and the label "I" indicates the middle and ending words of the answer, it can be determined that the answer to the target question is "motherland".

[0370] Through the method of the present application, the feature vectors of the target text, target question, and target answer can be effectively utilized to extract the correlation relationship among the three. By combining the correlation relationship among the target text, target question, and target answer, the answer to the target question is determined through the reading comprehension model, which can improve the accuracy of the reading comprehension model in performing the reading comprehension task.

[0371] Corresponding to the above method embodiment, the present application also provides an embodiment of a training device for a reading comprehension model. Fig.14 Shows a schematic structural diagram of a training device for a reading comprehension model provided by an embodiment of the present application. As Fig.14As shown, the device may include:

[0372] A first graph network construction module 1402 is configured to construct an initial first graph network of sample text segments and sample answers through a graph construction network layer of a reading comprehension model, and to construct an initial second graph network of sample questions and the sample answers;

[0373] A first text processing module 1404 is configured to input the sample text segment, the sample question and the sample answer into the text processing layer of the reading comprehension model, and add attention values ​​to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain a first graph network and a second graph network;

[0374] A prediction module 1406 is configured to input the first graph network and the second graph network into a graph convolutional network layer of the reading comprehension model to obtain a predicted answer;

[0375] The training module 1408 is configured to train the reading comprehension model based on the difference between the predicted answer and the sample answer until a training stop condition is reached.

[0376] Optionally, the first text processing module 1404 is configured to:

[0377] Inputting the sample text segment, the sample question and the sample answer into the feature extraction layer of the reading comprehension model to obtain a first feature vector group, a second feature vector group and a third feature vector group respectively;

[0378] The first feature vector group, the second feature vector group, and the third feature vector group are input into the attention layer of the reading comprehension model, and attention values ​​are added to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain the first graph network and the second graph network.

[0379] Optionally, the first text processing module 1404 is configured to:

[0380] Performing word segmentation processing on the sample text segment, the sample question, and the sample answer to obtain a first word unit group, a second word unit group, and a third word unit group respectively;

[0381] Performing word embedding processing on the first word unit group, the second word unit group, and the third word unit group to obtain a first word vector group, a second word vector group, and a third word vector group, respectively;

[0382] The first word vector group, the second word vector group, and the third word vector group are encoded to obtain the first feature vector group, the second feature vector group, and the third feature vector group, respectively.

[0383] Optionally, the first graph network construction module 1402 is configured to:

[0384] constructing an initial third graph network based on dependency relationships between word units in the sample text segments, and constructing an initial fourth graph network based on dependency relationships between word units in the sample questions;

[0385] The initial first graph network is constructed based on the association relationship between the initial third graph network and the sample answers, and the initial second graph network is constructed based on the association relationship between the initial fourth graph network and the sample answers.

[0386] Optionally, the first graph network construction module 1402 is configured to:

[0387] Taking word units in the sample text segment as nodes, a plurality of nodes are obtained;

[0388] Based on the dependency relationship between word units in the sample text segment, the nodes with dependency relationship are connected to obtain the initial third graph network.

[0389] Optionally, the first graph network construction module 1402 is configured to:

[0390] Based on the association between the word units in the sample answer and the word units in the sample text fragment, the word units in the sample answer are used as target nodes, and the target nodes are connected to the nodes in the initial third graph network to obtain the initial first graph network.

[0391] Optionally, the first graph network construction module 1402 is configured to:

[0392] Taking the word units in the sample question as nodes, a plurality of nodes are obtained;

[0393] Based on the dependency relationship between word units in the sample question, the nodes with dependency relationship are connected to obtain the initial fourth graph network.

[0394] Optionally, the first graph network construction module 1402 is configured to:

[0395] Based on the association between the word units in the sample answers and the word units in the sample questions, the word units in the sample answers are used as target nodes, and the target nodes are connected to the nodes in the initial fourth graph network to obtain the initial second graph network.

[0396] Optionally, the first text processing module 1404 is configured to:

[0397] By means of the attention layer, adding attention values ​​to nodes and edges of the initial first graph network based on the first feature vector group and the third feature vector group;

[0398] By means of the attention layer, attention values ​​are added to the nodes and edges of the initial second graph network based on the second feature vector group and the third feature vector group.

[0399] Optionally, the first text processing module 1404 is configured to:

[0400] Using a first feature vector in the first feature vector group as an attention value of a first node in the initial first graph network, where the first node is a node corresponding to a word unit of the sample text segment in the initial first graph network;

[0401] Using the third eigenvector in the third eigenvector group as the attention value of the second node in the initial first graph network, where the second node is the node corresponding to the word unit of the sample answer in the initial first graph network;

[0402] Based on the first feature vector group, determining an attention value between two first nodes having an edge in the initial first graph network and using the attention value of the edge as the attention value of the edge;

[0403] Based on the first feature vector group and the third feature vector group, an attention value between a first node and a second node where an edge exists in the initial first graph network is determined and used as the attention value of the edge.

[0404] Optionally, the first text processing module 1404 is configured to:

[0405] Using the second feature vector in the second feature vector group as the attention value of the third node in the initial second graph network, where the third node is the node corresponding to the word unit of the sample question in the initial second graph network;

[0406] Using the third eigenvector in the third eigenvector group as the attention value of the fourth node in the initial second graph network, the fourth node being the node corresponding to the word unit of the sample answer in the initial second graph network;

[0407] Based on the second feature vector group, determining an attention value between two third nodes where an edge exists in the initial second graph network and using the attention value as the attention value of the edge;

[0408] Based on the third feature vector group, an attention value between a third node and a fourth node where an edge exists in the initial second graph network is determined and used as the attention value of the edge.

[0409] Optionally, the prediction module 1406 is configured to:

[0410] Determining a first hidden layer feature vector of the first graph network and a second hidden layer feature vector of the second graph network through the graph convolutional network layer;

[0411] Performing a weighted summation on the first hidden layer feature vector and the second hidden layer feature vector to obtain a target hidden layer feature vector;

[0412] The predicted answer is determined based on the target hidden layer feature vector.

[0413] Optionally, the prediction module 1406 is configured to:

[0414] The value of each dimension of the target hidden layer feature vector is converted into at least one prediction probability through a sequence labeling function, wherein each dimension of the target hidden layer feature vector corresponds to a word unit, and the at least one prediction probability corresponding to each dimension represents the probability that the prediction label of the word unit corresponding to each dimension is at least one label;

[0415] Determine a predicted label of a word unit corresponding to each dimension based on at least one predicted probability corresponding to each dimension;

[0416] The predicted answer is determined based on the predicted labels of the word units corresponding to each dimension.

[0417] Optionally, the prediction module 1406 is configured to:

[0418] The at least one label includes an answer start word, an answer middle end word, and a non-answer word, and a word unit corresponding to the answer start word and a word unit corresponding to the answer middle end word are used as the predicted answer.

[0419] Optionally, the training module 1408 is configured to:

[0420] If the difference is less than a preset threshold, stop training the reading comprehension model;

[0421] If the difference is greater than or equal to the preset threshold, continue training the reading comprehension model.

[0422] Optionally, the training module 1408 is configured to:

[0423] Each time a prediction answer is obtained, record it for an iterative training;

[0424] The training times of the iterative training are counted, and if the training times are greater than a times threshold, it is determined that the training stop condition is met.

[0425] In an embodiment of the present application, an initial first graph network of sample text segments and sample answers is constructed through the graph construction network layer of the reading comprehension model, and an initial second graph network of sample questions and the sample answers is constructed; the sample text segments, the sample questions and the sample answers are input into the text processing layer of the reading comprehension model, and attention values ​​are added to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain a first graph network and a second graph network; the first graph network and the second graph network are input into the graph convolution network layer of the reading comprehension model to obtain a predicted answer; the reading comprehension model is trained based on the difference between the predicted answer and the sample answer until the training stop condition is reached. Through the method of the present application, the feature vectors of sample text segments, sample questions and sample answers can be effectively utilized to extract the correlation between the three, and the reading comprehension model is trained in combination with the correlation between the sample text segments, sample questions and sample answers, which can improve the accuracy of the reading comprehension model in performing reading comprehension tasks.

[0426] The above is a schematic scheme of a reading comprehension model training device of this embodiment. It should be noted that the technical scheme of the reading comprehension model training device and the technical scheme of the above-mentioned reading comprehension model training method belong to the same concept, and the details of the technical scheme of the reading comprehension model training device that are not described in detail can all be referred to the description of the technical scheme of the above-mentioned reading comprehension model training method.

[0427] Corresponding to the above method embodiment, the present application also provides a reading comprehension device embodiment, Fig.15 FIG. 1 shows a schematic diagram of the structure of a reading comprehension device provided by an embodiment of the present application. Fig.15 As shown, the device may include:

[0428] A second graph network construction module 1502 is configured to construct an initial first graph network of a target text and a target answer through a graph construction network layer of a reading comprehension model, and to construct an initial second graph network of a target question and the target answer;

[0429] The second text processing module 1504 is configured to input the target text, the target question and the target answer into the text processing layer of the reading comprehension model, and add attention values ​​to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain the first graph network and the second graph network;

[0430] The determination module 1506 is configured to input the first graph network and the second graph network into the graph convolutional network layer of the reading comprehension model to determine the answer to the target question.

[0431] Optionally, the second text processing module 1504 is configured to:

[0432] Inputting the target text, the target question and the target answer into the feature extraction layer of the reading comprehension model to obtain a first feature vector group, a second feature vector group and a third feature vector group respectively;

[0433] The first feature vector group, the second feature vector group, and the third feature vector group are input into the attention layer of the reading comprehension model, and attention values ​​are added to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain the first graph network and the second graph network.

[0434] Optionally, the second text processing module 1504 is configured to:

[0435] Performing word segmentation processing on the target text, the target question, and the target answer to obtain a first word unit group, a second word unit group, and a third word unit group respectively;

[0436] Performing word embedding processing on the first word unit group, the second word unit group, and the third word unit group to obtain a first word vector group, a second word vector group, and a third word vector group, respectively;

[0437] The first word vector group, the second word vector group, and the third word vector group are encoded to obtain the first feature vector group, the second feature vector group, and the third feature vector group, respectively.

[0438] Optionally, the second graph network construction module 1502 is configured to:

[0439] constructing an initial third graph network based on dependency relationships between word units in the target text, and constructing an initial fourth graph network based on dependency relationships between word units in the target question;

[0440] The initial first graph network is constructed based on the association relationship between the initial third graph network and the target answer, and the initial second graph network is constructed based on the association relationship between the initial fourth graph network and the target answer.

[0441] Optionally, the second graph network construction module 1502 is configured to:

[0442] Taking word units in the target text as nodes, obtaining a plurality of nodes;

[0443] Based on the dependency relationship between word units in the target text, the nodes with dependency relationship are connected to obtain the initial third graph network.

[0444] Optionally, the second graph network construction module 1502 is configured to:

[0445] Based on the association between the word units in the target answer and the word units in the target text, the word units in the target answer are used as target nodes, and the target nodes are connected to the nodes in the initial third graph network to obtain the initial first graph network.

[0446] Optionally, the second graph network construction module 1502 is configured to:

[0447] Taking the word units in the target question as nodes, a plurality of nodes are obtained;

[0448] Based on the dependency relationship between word units in the target question, the nodes with dependency relationship are connected to obtain the initial fourth graph network.

[0449] Optionally, the second graph network construction module 1502 is configured to:

[0450] Based on the association between the word units in the target answer and the word units in the target question, the word units in the target answer are used as target nodes, and the target nodes are connected to the nodes in the initial fourth graph network to obtain the initial second graph network.

[0451] Optionally, the second text processing module 1504 is configured to:

[0452] By means of the attention layer, adding attention values ​​to nodes and edges of the initial first graph network based on the first feature vector group and the third feature vector group;

[0453] By means of the attention layer, attention values ​​are added to the nodes and edges of the initial second graph network based on the second feature vector group and the third feature vector group.

[0454] Optionally, the second text processing module 1504 is configured to:

[0455] Using a first feature vector in the first feature vector group as an attention value of a first node in the initial first graph network, where the first node is a node corresponding to a word unit of the target text in the initial first graph network;

[0456] Using the third eigenvector in the third eigenvector group as the attention value of the second node in the initial first graph network, where the second node is the node corresponding to the word unit of the target answer in the initial first graph network;

[0457] Based on the first feature vector group, determining an attention value between two first nodes having an edge in the initial first graph network and using the attention value of the edge as the attention value of the edge;

[0458] Based on the first feature vector group and the third feature vector group, an attention value between a first node and a second node where an edge exists in the initial first graph network is determined and used as the attention value of the edge.

[0459] Optionally, the second text processing module 1504 is configured to:

[0460] Using the second feature vector in the second feature vector group as the attention value of the third node in the initial second graph network, where the third node is the node corresponding to the word unit of the target question in the initial second graph network;

[0461] Using the third eigenvector in the third eigenvector group as the attention value of the fourth node in the initial second graph network, the fourth node being the node corresponding to the word unit of the target answer in the initial second graph network;

[0462] Based on the second feature vector group, determining an attention value between two third nodes where an edge exists in the initial second graph network and using the attention value as the attention value of the edge;

[0463] Based on the third feature vector group, an attention value between a third node and a fourth node where an edge exists in the initial second graph network is determined and used as the attention value of the edge.

[0464] Optionally, the determination module 1506 is configured to:

[0465] Determining a first hidden layer feature vector of the first graph network and a second hidden layer feature vector of the second graph network through the graph convolutional network layer;

[0466] Performing a weighted summation on the first hidden layer feature vector and the second hidden layer feature vector to obtain a target hidden layer feature vector;

[0467] The answer is determined based on the target hidden layer feature vector.

[0468] Optionally, the determining module 1506 is configured to:

[0469] The value of each dimension of the target hidden layer feature vector is converted into at least one probability by a sequence labeling function, wherein each dimension of the target hidden layer feature vector corresponds to a word unit, and the at least one probability corresponding to each dimension represents the probability that the label of the word unit corresponding to each dimension is at least one label;

[0470] Determine a label of a word unit corresponding to each dimension based on at least one probability corresponding to each dimension;

[0471] The answer is determined based on the label of the word unit corresponding to each dimension.

[0472] Optionally, the determination module 1506 is configured to:

[0473] The at least one label includes an answer start word, an answer middle end word, and a non-answer word, and a word unit corresponding to the answer start word and a word unit corresponding to the answer middle end word are used as the answer.

[0474] In an embodiment of the present application, an initial first graph network of a target text and a target answer is constructed through a graph construction network layer of a reading comprehension model, and an initial second graph network of a target question and the target answer is constructed; the target text, the target question, and the target answer are input into the text processing layer of the reading comprehension model, and attention values ​​are added to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain a first graph network and a second graph network; the first graph network and the second graph network are input into the graph convolution network layer of the reading comprehension model to obtain the answer to the target question. Through the method of the present application, the feature vectors of the target text, the target question, and the target answer can be effectively utilized, and the correlation between the three can be extracted. The answer to the target question can be determined through the reading comprehension model in combination with the correlation between the target text, the target question, and the target answer, which can improve the accuracy of the reading comprehension model in performing reading comprehension tasks.

[0475] The above is a schematic scheme of a reading comprehension device of this embodiment. It should be noted that the technical scheme of the reading comprehension device and the technical scheme of the above reading comprehension method belong to the same concept, and the details not described in detail in the technical scheme of the reading comprehension device can be referred to the description of the technical scheme of the above reading comprehension method.

[0476] It should be noted that the components in the device claim should be understood as the functional modules that must be established to implement the steps of the program flow or the steps of the method, and the functional modules are not actually divided or separated. The device claim defined by such a group of functional modules should be understood as the functional module architecture of the solution mainly implemented by the computer program recorded in the specification, and should not be understood as the physical device that mainly implements the solution by hardware.

[0477] In one embodiment of the present application, a computing device is also provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein when the processor executes the instructions, the steps of the training method of the reading comprehension model are implemented, or the steps of the reading comprehension method described above are implemented.

[0478] The above is a schematic scheme of a computing device of the present embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned reading comprehension model training method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be found in the description of the technical scheme of the above-mentioned reading comprehension model training method. Alternatively, the technical scheme of the computing device and the technical scheme of the above-mentioned reading comprehension method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be found in the description of the technical scheme of the above-mentioned reading comprehension method.

[0479] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the training method of the reading comprehension model as described above, or implement the steps of the reading comprehension method as described above.

[0480] The above is a schematic scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned method for training a reading comprehension model belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be found in the description of the technical scheme of the above-mentioned method for training a reading comprehension model. Alternatively, the technical scheme of the storage medium and the technical scheme of the above-mentioned method for reading comprehension belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be found in the description of the technical scheme of the above-mentioned method for reading comprehension.

[0481] An embodiment of the present application discloses a chip storing computer instructions, which, when executed by a processor, implement the steps of the training method of the reading comprehension model as described above, or implement the steps of the reading comprehension method as described above.

[0482] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0483] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0484] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0485] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0486] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.

Claims

1. A method for determining a predicted answer, It is characterized in that The method comprises: Determine, by means of a graph convolutional network layer, a first hidden layer feature vector of a first graph network and a second hidden layer feature vector of a second graph network, wherein the first graph network is an initial first graph network including attention values ​​of nodes and attention values ​​of edges, the second graph network is an initial second graph network including attention values ​​of nodes and attention values ​​of edges, the initial first graph network is a graph network representing an association relationship between a text segment and an answer, and the initial second graph network is a graph network representing an association relationship between a question and the answer; Performing a weighted summation on the first hidden layer feature vector and the second hidden layer feature vector to obtain a target hidden layer feature vector; The value of each dimension of the target hidden layer feature vector is converted into at least one prediction probability through a sequence labeling function, wherein each dimension of the target hidden layer feature vector corresponds to a word unit, and the at least one prediction probability corresponding to each dimension represents the probability that the prediction label of the word unit corresponding to each dimension is at least one label, wherein the at least one label includes an answer start word, an answer middle end word, and a non-answer word; Determine a predicted label of a word unit corresponding to each dimension based on at least one predicted probability corresponding to each dimension; The word unit corresponding to the beginning word of the answer and the word unit corresponding to the middle and ending word of the answer are used as the predicted answer.

2. The method according to claim 1, It is characterized in that The graph convolutional network layer is a GCN model.

3. The method according to claim 1 or 2, It is characterized in that The graph convolutional network layer performs convolution processing on the first graph network by the following formula: Among them, represents the th node in the first graph network, represents the th node in the first graph network, represents the feature vector of the th node input to the th convolutional layer, represents the nonlinear conversion function, which is the ReLU activation function, represents the node and all nodes connected to the node, represents the feature vector of the th node input to the th convolutional layer, represents the attention value of the edge between the th node and the th node, represents the weight of the th node in the th convolutional layer, and represents the intercept of the th node in the th convolutional layer.

4. The method according to claim 1 or 2, It is characterized in that The graph convolutional network layer includes a plurality of convolutional layers, wherein the convolutional layers include a preset weight parameter matrix, and the weight of each node in each convolutional layer is an initial weight in the weight parameter matrix; Alternatively, the convolution layer includes a preset intercept parameter matrix, and the intercept of each node in each convolution layer is an initial intercept in the intercept parameter matrix.

5. The method according to claim 1, It is characterized in that Before determining the first hidden layer feature vector of the first graph network and the second hidden layer feature vector of the second graph network through the graph convolutional network layer, the method further includes: Constructing an initial first graph network of sample text segments and sample answers through a graph construction network layer of a reading comprehension model, and constructing an initial second graph network of sample questions and the sample answers; Input the sample text segment, the sample question and the sample answer into the text processing layer of the reading comprehension model, and add attention values ​​to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain a first graph network and a second graph network; After determining the predicted answer based on the predicted label of the word unit corresponding to each dimension, the method further includes: The reading comprehension model is trained based on the difference between the predicted answer and the sample answer until a training stop condition is reached.

6. The method according to claim 5, It is characterized in that The text processing layer includes a feature extraction layer and an attention layer; the sample text segment, the sample question and the sample answer are input into the text processing layer of the reading comprehension model, and attention values ​​are added to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain the first graph network and the second graph network, including: Inputting the sample text segment, the sample question and the sample answer into the feature extraction layer of the reading comprehension model to obtain a first feature vector group, a second feature vector group and a third feature vector group respectively; The first feature vector group, the second feature vector group, and the third feature vector group are input into the attention layer of the reading comprehension model, and attention values ​​are added to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain the first graph network and the second graph network.

7. The method according to claim 6, It is characterized in that The feature extraction layer adopts the structure of the Bert model.

8. The method according to claim 6, It is characterized in that The attention layer adopts the structure of the attention layer of the Bert model.

9. The method according to claim 6, It is characterized in that Inputting the sample text segment, the sample question and the sample answer into the feature extraction layer of the reading comprehension model to obtain a first feature vector group, a second feature vector group and a third feature vector group respectively, including: Performing word segmentation processing on the sample text segment, the sample question, and the sample answer to obtain a first word unit group, a second word unit group, and a third word unit group respectively; Performing word embedding processing on the first word unit group, the second word unit group, and the third word unit group to obtain a first word vector group, a second word vector group, and a third word vector group, respectively; The first word vector group, the second word vector group, and the third word vector group are encoded to obtain the first feature vector group, the second feature vector group, and the third feature vector group, respectively.

10. The method according to claim 9, It is characterized in that The sample text segment, the sample question and the sample answer are segmented to obtain a first word unit group, a second word unit group and a third word unit group, respectively, including: If the sample text segment is a Chinese text, a character, a punctuation mark, and a number are respectively divided into a word unit, and the word units obtained by dividing the sample text segment form the first word unit group; or if the sample text segment is a foreign text, a word or a phrase is divided into a word unit, and the word units obtained by dividing the sample text segment form the first word unit group; If the sample question is a Chinese text, a character, a punctuation mark, and a number are respectively divided into a word unit, and the word units obtained by dividing the sample question form the second word unit group; or if the sample question is a foreign text, a word or a phrase is divided into a word unit, and the word units obtained by dividing the sample question form the second word unit group; If the sample answer is a Chinese text, a character, a punctuation mark, and a number are respectively divided into a word unit, and the word units obtained by dividing the sample answer constitute the third word unit group; or, if the sample answer is a foreign text, a word or a phrase is divided into a word unit, and the word units obtained by dividing the sample answer constitute the third word unit group.

11. The method according to claim 9, It is characterized in that The first word unit group, the second word unit group, and the third word unit group are subjected to word embedding processing to obtain a first word vector group, a second word vector group, and a third word vector group, respectively, including: Perform word embedding processing on each first word unit in the first word unit group by using one-hot encoding or word2vec encoding to obtain the first word vector group; Perform word embedding processing on each second word unit in the second word unit group by using one-hot encoding or word2vec encoding to obtain the second word vector group; Each third word unit in the third word unit group is subjected to word embedding processing by adopting one-hot encoding or word2vec encoding to obtain the third word vector group.

12. The method according to claim 9, It is characterized in that Encoding the first word vector group, the second word vector group, and the third word vector group to obtain the first feature vector group, the second feature vector group, and the third feature vector group, respectively, includes: Each first word vector, each second word vector, and each third word vector are encoded to obtain a first feature vector of each first word unit, a second feature vector of each second word unit, and a third feature vector of each third word unit, respectively, wherein the first feature vector of each first word unit is a vector representation of the full-text semantic information of the fused sample text fragment corresponding to each first word unit, the second feature vector of each second word unit is a vector representation of the full-text semantic information of the fused sample question corresponding to each second word unit, and the third feature vector of each third word unit is a vector representation of the full-text semantic information of the fused sample answer corresponding to each third word unit.

13. The method according to claim 5, It is characterized in that Constructing an initial first graph network of sample text segments and sample answers through the graph construction network layer of the reading comprehension model, and constructing an initial second graph network of sample questions and the sample answers, including: constructing an initial third graph network based on dependency relationships between word units in the sample text segments, and constructing an initial fourth graph network based on dependency relationships between word units in the sample questions; The initial first graph network is constructed based on the association relationship between the initial third graph network and the sample answers, and the initial second graph network is constructed based on the association relationship between the initial fourth graph network and the sample answers.

14. The method according to claim 13, It is characterized in that Constructing an initial third graph network based on the dependency relationship between word units in the sample text segment, including: Taking word units in the sample text segment as nodes, a plurality of nodes are obtained; Based on the dependency relationship between word units in the sample text segment, the nodes with dependency relationship are connected to obtain the initial third graph network.

15. The method according to claim 13 or 14, It is characterized in that Constructing the initial first graph network based on the association relationship between the initial third graph network and the sample answers includes: Based on the association between the word units in the sample answer and the word units in the sample text fragment, the word units in the sample answer are used as target nodes, and the target nodes are connected to the nodes in the initial third graph network to obtain the initial first graph network.

16. The method of claim 13, It is characterized in that Constructing an initial fourth graph network based on the dependency relationship between word units in the sample problem, including: Taking the word units in the sample question as nodes, a plurality of nodes are obtained; Based on the dependency relationship between word units in the sample question, the nodes with dependency relationship are connected to obtain the initial fourth graph network.

17. The method according to claim 13, 14 or 16, It is characterized in that The dependency relationship is calculated by the Stanford Core NLP algorithm.

18. The method according to claim 13 or 16, It is characterized in that Constructing the initial second graph network based on the association relationship between the initial fourth graph network and the sample answers includes: Based on the association between the word units in the sample answers and the word units in the sample questions, the word units in the sample answers are used as target nodes, and the target nodes are connected to the nodes in the initial fourth graph network to obtain the initial second graph network.

19. The method of claim 6, It is characterized in that Inputting the first feature vector group, the second feature vector group, and the third feature vector group into the attention layer of the reading comprehension model, respectively adding attention values ​​to the nodes and edges included in the initial first graph network and the initial second graph network, to obtain the first graph network and the second graph network, including: By means of the attention layer, adding attention values ​​to nodes and edges of the initial first graph network based on the first feature vector group and the third feature vector group; By means of the attention layer, attention values ​​are added to the nodes and edges of the initial second graph network based on the second feature vector group and the third feature vector group.

20. The method of claim 19, It is characterized in that Adding attention values ​​to nodes and edges of the initial first graph network based on the first feature vector group and the third feature vector group through the attention layer includes: Using a first feature vector in the first feature vector group as an attention value of a first node in the initial first graph network, where the first node is a node corresponding to a word unit of the sample text segment in the initial first graph network; Using the third eigenvector in the third eigenvector group as the attention value of the second node in the initial first graph network, where the second node is the node corresponding to the word unit of the sample answer in the initial first graph network; Based on the first feature vector group, determining an attention value between two first nodes having an edge in the initial first graph network and using the attention value of the edge as the attention value of the edge; Based on the first feature vector group and the third feature vector group, an attention value between a first node and a second node where an edge exists in the initial first graph network is determined and used as the attention value of the edge.

21. The method of claim 20, It is characterized in that The calculation method of the attention value includes: For two first nodes with an edge, performing attention calculation on the first feature vectors of the word units corresponding to the two first nodes to obtain the attention value of the edge; or, For a first node and a second node having an edge, attention calculation is performed on a first feature vector of a word unit corresponding to the first node and a third feature vector of a word unit corresponding to the second node to obtain an attention value of the edge.

22. The method of claim 19, It is characterized in that Adding attention values ​​to nodes and edges of the initial second graph network based on the second feature vector group and the third feature vector group through the attention layer includes: Using the second feature vector in the second feature vector group as the attention value of the third node in the initial second graph network, where the third node is the node corresponding to the word unit of the sample question in the initial second graph network; Using the third eigenvector in the third eigenvector group as the attention value of the fourth node in the initial second graph network, the fourth node being the node corresponding to the word unit of the sample answer in the initial second graph network; Based on the second feature vector group, determining an attention value between two third nodes where an edge exists in the initial second graph network and using the attention value as the attention value of the edge; Based on the third feature vector group, an attention value between a third node and a fourth node where an edge exists in the initial second graph network is determined and used as the attention value of the edge.

23. The method of claim 22, It is characterized in that The calculation method of the attention value includes: For two third nodes where there is an edge, attention calculation is performed on the second feature vectors of the word units corresponding to the two third nodes to obtain the attention value of the edge; or, For the third node and the fourth node where there is an edge, attention calculation is performed on the second feature vector of the word unit corresponding to the third node and the third feature vector of the word unit corresponding to the fourth node to obtain the attention value of the edge.

24. The method according to any one of claims 19 to 23, It is characterized in that The calculation formula of the attention value is: Among them, represents the attention value, softmax(·) is a normalization function, and represent two eigenvectors, is a constant, and is a matrix transpose.

25. The method of claim 5, It is characterized in that The reading comprehension model is trained based on the difference between the predicted answer and the sample answer until a training stop condition is reached, including: If the difference is less than a preset threshold, stop training the reading comprehension model; If the difference is greater than or equal to the preset threshold, continue training the reading comprehension model.

26. The method of claim 5, It is characterized in that The training stop conditions are met, including: Each time a prediction answer is obtained, record it for an iterative training; The training times of the iterative training are counted, and if the training times are greater than a times threshold, it is determined that the training stop condition is met.

27. A reading comprehension method, It is characterized in that The method comprises: Constructing an initial first graph network of a target text and a target answer through a graph construction network layer of a reading comprehension model, and constructing an initial second graph network of a target question and the target answer, wherein the reading comprehension model is trained by any one of the methods of claims 5-26; Inputting the target text, the target question and the target answer into the text processing layer of the reading comprehension model, adding attention values ​​to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain a first graph network and a second graph network; Inputting the first graph network and the second graph network into the graph convolutional network layer of the reading comprehension model to determine a target hidden layer feature vector; The value of each dimension of the target hidden layer feature vector is converted into at least one probability by a sequence labeling function, wherein each dimension of the target hidden layer feature vector corresponds to a word unit, and the at least one probability corresponding to each dimension represents the probability that the label of the word unit corresponding to each dimension is at least one label; Determine a label of a word unit corresponding to each dimension based on at least one probability corresponding to each dimension; The answer to the target question is determined based on the labels of the word units corresponding to each dimension.

28. A device for determining a predicted answer, It is characterized in that The device comprises: A first conversion module is configured to determine a first hidden layer feature vector of a first graph network and a second hidden layer feature vector of a second graph network through a graph convolutional network layer, wherein the first graph network is an initial first graph network including node attention values ​​and edge attention values, the second graph network is an initial second graph network including node attention values ​​and edge attention values, the initial first graph network is a graph network representing the association relationship between a text segment and an answer, and the initial second graph network is a graph network representing the association relationship between a question and the answer; weighted summing the first hidden layer feature vector and the second hidden layer feature vector to obtain a target hidden layer feature vector; converting the value of each dimension of the target hidden layer feature vector into at least one prediction probability through a sequence labeling function, wherein each dimension of the target hidden layer feature vector corresponds to a word unit, and the at least one prediction probability corresponding to each dimension represents the probability that the predicted label of the word unit corresponding to each dimension is at least one label, wherein the at least one label includes an answer start word, an answer middle end word, and a non-answer word; A first determination module is configured to determine a predicted label of a word unit corresponding to each dimension based on at least one predicted probability corresponding to each dimension; The second determination module is configured to determine the predicted answer based on the predicted label of the word unit corresponding to each dimension; the second determination module is further configured to use the word unit corresponding to the beginning word of the answer and the word unit corresponding to the middle and ending word of the answer as the predicted answer.

29. A reading comprehension device, It is characterized in that The device comprises: A graph network construction module, configured to construct an initial first graph network of a target text and a target answer through a graph construction network layer of a reading comprehension model, and to construct an initial second graph network of a target question and the target answer, wherein the reading comprehension model is trained by any one of the methods of claims 5-26; A text processing module is configured to input the target text, the target question and the target answer into the text processing layer of the reading comprehension model, and add attention values ​​to the nodes and edges included in the initial first graph network and the initial second graph network, respectively, to obtain a first graph network and a second graph network; A third determination module is configured to input the first graph network and the second graph network into the graph convolutional network layer of the reading comprehension model to determine a target hidden layer feature vector; A second conversion module is configured to convert the value of each dimension of the target hidden layer feature vector into at least one probability through a sequence labeling function, wherein each dimension of the target hidden layer feature vector corresponds to a word unit, and the at least one probability corresponding to each dimension represents the probability that the label of the word unit corresponding to each dimension is at least one label; a fourth determination module, configured to determine a label of a word unit corresponding to each dimension based on at least one probability corresponding to each dimension; The fifth determination module is configured to determine the answer to the target question based on the labels of the word units corresponding to each dimension.

30. A computing device comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, It is characterized in that When the processor executes the instructions, it implements the steps of the method for determining the predicted answer as described in any one of claims 1-26, or implements the steps of the reading comprehension method as described in claim 27, or includes the device as described in claim 28 or 29.

31. A computer-readable storage medium storing computer instructions, It is characterized in that When the instruction is executed by the processor, it implements the steps of the method for determining the predicted answer as described in any one of claims 1-26, or implements the steps of the reading comprehension method as described in claim 27, or includes the device as described in claim 28 or 29.