Machine reading comprehension method and device, computer device and storage medium

By performing word serialization and feature extraction on text data, and using the BERT model and validator to identify the probability of the start and end positions of the answer, the problem of insufficient accuracy in machine reading comprehension in existing technologies is solved, and higher accuracy in answer recognition is achieved.

CN115203388BActive Publication Date: 2026-05-22TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2022-06-15
Publication Date
2026-05-22

AI Technical Summary

Technical Problem

Existing end-to-end deep learning models have a low success rate in extracting answers in segment-based machine reading comprehension, and cannot guarantee the accuracy of machine reading comprehension.

Method used

By acquiring text data containing the target question and target passage, word serialization and feature extraction are performed to obtain word sequence feature vectors. Based on the word sequence feature vectors, answer identification is performed to determine the target answer in the target passage. The existence of the answer is verified using the BERT model and a validator.

Benefits of technology

It improves the accuracy of machine reading comprehension, ensuring that the answer is determined only when it exists in the target passage, thus reducing the probability of misidentification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115203388B_ABST
    Figure CN115203388B_ABST
Patent Text Reader

Abstract

The application relates to a machine reading comprehension method and device, computer equipment, a storage medium and a computer program product. First, text data containing a target question and a target chapter are acquired, then word sequence and feature extraction processing are performed on the text data to obtain a word sequence feature vector used for probability prediction, an answer corresponding to the target question is recognized based on the word sequence feature data, that is, an answer start position probability and an answer end position probability corresponding to each word in the target chapter are obtained, then verification is performed to determine whether an answer matching the target question exists in the target chapter, and only in the case that the answer exists, the method of the application determines the target answer in the target chapter based on the answer start position probability and the answer end position probability, so that the accuracy of the machine reading comprehension process can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a machine reading comprehension method, apparatus, computer device, and storage medium. Background Technology

[0002] With the development of computer technology and artificial intelligence, Machine Reading Comprehension (MRC) technology has emerged. It requires machines to read and understand human natural language text, and based on this understanding, to answer questions related to the text. Measuring a machine's ability to understand natural language helps humans quickly focus on relevant information from large amounts of text, reducing the cost of manual information retrieval. It has significant application value in text question answering, information extraction, and dialogue systems, and is one of the research hotspots in the field of natural language processing. Segment extraction reading comprehension is an important branch of machine reading comprehension tasks. Segment extraction reading comprehension tasks require extracting a segment from a text as the answer to a question; this could be a word, a phrase, or a sentence.

[0003] Currently, machine reading comprehension problems involving segment extraction are generally solved using end-to-end deep learning models. However, these models have a low success rate in extracting answers and cannot guarantee the accuracy of machine reading comprehension. Summary of the Invention

[0004] Therefore, it is necessary to provide a machine reading comprehension method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the accuracy of segment extraction-based machine reading comprehension in response to the above-mentioned technical problems.

[0005] Firstly, this application provides a machine reading comprehension method. The method includes:

[0006] Obtain text data containing a target question and a target passage, wherein the target question matches the target passage;

[0007] The text data is processed by word serialization and feature extraction to obtain word sequence feature vectors;

[0008] Based on the word sequence feature vector, the answer to the target question is identified, and the probability of the starting position and the ending position of the answer corresponding to each word in the target text are obtained.

[0009] When the probability of the starting position of the answer and the probability of the ending position of the answer indicate that there is an answer in the target passage that matches the target question, the target answer in the target passage is determined based on the probability of the starting position of the answer and the probability of the ending position of the answer.

[0010] Secondly, this application also provides a machine reading comprehension device. The device includes:

[0011] The text data acquisition module is used to acquire text data containing a target question and a target passage, wherein the target question matches the target passage;

[0012] The feature extraction module is used to perform word serialization and feature extraction processing on the text data to obtain word sequence feature vectors;

[0013] The answer recognition module is used to identify the answer to the target question based on the word sequence feature vector, and to obtain the probability of the starting position and the ending position of the answer for each word in the target text.

[0014] The answer extraction module is used to determine the target answer in the target passage based on the answer start position probability and the answer end position probability when the answer start position probability and the answer end position probability indicate that there is an answer in the target passage that matches the target question.

[0015] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0016] Obtain text data containing a target question and a target passage, wherein the target question matches the target passage;

[0017] The text data is processed by word serialization and feature extraction to obtain word sequence feature vectors;

[0018] Based on the word sequence feature vector, the answer to the target question is identified, and the probability of the starting position and the ending position of the answer corresponding to each word in the target text are obtained.

[0019] When the probability of the starting position of the answer and the probability of the ending position of the answer indicate that there is an answer in the target passage that matches the target question, the target answer in the target passage is determined based on the probability of the starting position of the answer and the probability of the ending position of the answer.

[0020] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0021] Obtain text data containing a target question and a target passage, wherein the target question matches the target passage;

[0022] The text data is processed by word serialization and feature extraction to obtain word sequence feature vectors;

[0023] Based on the word sequence feature vector, the answer to the target question is identified, and the probability of the starting position and the ending position of the answer corresponding to each word in the target text are obtained.

[0024] When the probability of the starting position of the answer and the probability of the ending position of the answer indicate that there is an answer in the target passage that matches the target question, the target answer in the target passage is determined based on the probability of the starting position of the answer and the probability of the ending position of the answer.

[0025] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0026] Obtain text data containing a target question and a target passage, wherein the target question matches the target passage;

[0027] The text data is processed by word serialization and feature extraction to obtain word sequence feature vectors;

[0028] Based on the word sequence feature vector, the answer to the target question is identified, and the probability of the starting position and the ending position of the answer corresponding to each word in the target text are obtained.

[0029] When the probability of the starting position of the answer and the probability of the ending position of the answer indicate that there is an answer in the target passage that matches the target question, the target answer in the target passage is determined based on the probability of the starting position of the answer and the probability of the ending position of the answer.

[0030] The aforementioned machine reading comprehension method, apparatus, computer device, storage medium, and computer program product first acquire text data containing a target question and a target passage. The target question is the question that the machine reading comprehension needs to answer, while the target passage may contain the answer to the target question. Then, the text data is processed through word serialization and feature extraction to obtain a word sequence feature vector for probability prediction. Based on the word sequence feature data, the answer to the target question is identified, thus obtaining the probability of the answer's starting position and the probability of the answer's ending position for each word in the target passage. A verification can then be performed based on the obtained probability of the answer's starting and ending positions to determine whether an answer matching the target question exists in the target passage. Only when such an answer exists will the method of this application determine the target answer in the target passage based on the probability of the answer's starting and ending positions, thereby effectively improving the accuracy of the machine reading comprehension process. Attached Figure Description

[0031] Figure 1 This is a diagram illustrating the application environment of a machine reading comprehension method in one embodiment.

[0032] Figure 2 This is a flowchart illustrating a machine reading comprehension method in one embodiment;

[0033] Figure 3 This is a schematic diagram of the structure of the bidirectional encoder representation model embedding layer of the converter in one embodiment;

[0034] Figure 4 This is a schematic diagram of the structure of a syntactic dependency tree in one embodiment;

[0035] Figure 5 This is a schematic diagram of the structure of the syntactic dependency matrix in one embodiment;

[0036] Figure 6 This is a schematic diagram of the search engine interface after entering a question in one embodiment;

[0037] Figure 7 This is a schematic diagram of the search engine interface after obtaining search results in one embodiment;

[0038] Figure 8 This is a schematic diagram of the bidirectional encoder representation model of the converter in one embodiment;

[0039] Figure 9 This is a structural block diagram of a machine reading comprehension device in one embodiment;

[0040] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0041] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0042] This application relates to artificial intelligence (AI) technology. AI is the theory, methods, technology, and application systems that utilize digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to have perception, reasoning, and decision-making capabilities. AI technology is a comprehensive discipline involving a wide range of fields, encompassing both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly include computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0043] This application primarily concerns Natural Language Processing (NLP) and Machine Learning (ML) technologies within artificial intelligence. NLP is a crucial area within computer science and artificial intelligence. It studies various theories and methods for enabling effective communication between humans and computers using natural language. NLP is a science integrating linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language people use daily—and thus has a close connection to linguistic research. NLP technologies typically include text processing, semantic understanding, machine translation, question answering, and knowledge graphs. Machine learning, on the other hand, is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.

[0044] In this article, it is important to understand the following terms:

[0045] Machine reading comprehension: This involves reading comprehension question answering, requiring machines to read and understand human natural language text, and then answer questions related to the text. It measures a machine's ability to understand natural language, helping humans quickly focus on relevant information from large amounts of text and reducing the cost of manual information retrieval. It has significant application value in text question answering, information extraction, and dialogue systems, and is one of the hot research topics in natural language processing.

[0046] Extractive reading comprehension: Extractive reading comprehension is an important branch of machine reading comprehension tasks. These tasks require extracting a segment from a passage as the answer to a question; this could be a word, a phrase, or a sentence.

[0047] The machine reading comprehension method provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on another server. When a user needs to perform machine reading comprehension to identify the answer to a target question in a specified target text, they can input text data containing the target question and the target text into server 104. Server 104 then obtains the text data containing the target question and the target text; performs word serialization and feature extraction processing on the text data to obtain a word sequence feature vector; identifies the answer to the target question based on the word sequence feature vector, obtaining the probability of the answer's starting position and the probability of the answer's ending position for each word in the target text; when the probability of the answer's starting position and the probability of the answer's ending position indicate that there is an answer in the target text that matches the target question, the target answer in the target text is determined based on the probability of the answer's starting position and the probability of the answer's ending position. The terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0048] In one embodiment, such as Figure 2 As shown, a machine reading comprehension method is provided, which is applied to... Figure 1 Taking server 104 as an example, the following steps are included:

[0049] Step 201: Obtain text data containing the target question and the target text, with the target question matching the target text.

[0050] The target question is the question that the machine reading comprehension method of this application needs to answer. Specifically, it can be an interrogative text sentence, such as "Is Princess A from Fairy Tale X?". The target passage is used to answer the target question. Specifically, it can be a text paragraph at one end that may contain the text corresponding to the answer to the target question, such as "Princess A is a character in a fairy tale widely popular in region A, the most famous version of which appears in the 1824 edition of Fairy Tale X in region B." When the target passage contains the predicted answer to the target question, the machine reading comprehension method of this application can extract the text content of the predicted answer from the target passage. If the target passage does not contain the predicted answer to the target question, a result of failure to answer should be reported.

[0051] Specifically, when a user on terminal 102 needs to efficiently perform machine reading comprehension, they can first determine the target answer and the text data of the target passage, forming a set of text data. Then, they simultaneously input the text data containing the target question and the target passage to server 104 to request machine reading comprehension. In one embodiment, the user can send text data consisting of a target question and a target passage to server 104, and server 104 will then search for the target predicted answer corresponding to the target question within the target passage. In another embodiment, the user can send text data consisting of a target question and multiple target passages to server 104. In this case, the server can construct multiple text contents consisting of a target question and multiple target passages based on the input target question and multiple target passages. Then, it will search for the answer content corresponding to the target question in each target passage, and finally, by combining the multiple found answer contents, it will determine the target predicted answer corresponding to the target question.

[0052] Step 203: Perform word serialization and feature extraction on the text data to obtain word sequence feature vectors.

[0053] Word serialization refers to the process of serializing words in text data to obtain corresponding serialized data. For example, for the text data of the target question (query), the serialized representation after word serialization is Q = q1q2…q L , where q1q2…q L Each word corresponds to a word obtained from word segmentation. For the text data of the target paragraph, the serialized representation after word serialization is P = p1p2…p M Feature extraction processing refers to extracting features from the sequenced word data to construct corresponding feature vectors. These feature vectors can then be used to calculate the answer to whether a target question exists in the target text. Feature extraction processing can be implemented through embedding and encoding.

[0054] Specifically, after obtaining the text data, in order to effectively process the data in text form, it needs to be transformed to a certain extent to obtain the corresponding feature vectors before prediction. The transformation process includes word serialization and feature extraction. For word serialization, the text data can first be segmented, and then the text data can be serialized sequentially based on the segmentation results to obtain the corresponding serialized data. For feature extraction, it can be implemented using embedding combined with a Transformer. In one embodiment, the solution of this application can be implemented using the BERT (Bidirectional Encoder Representation of Transformer) model. The BERT implementing the machine reading comprehension method of this application specifically includes an input layer and an encoding interaction layer. The input layer is used to obtain the text data input by the user through terminal 102 and transforms the obtained text data into word serialized data through word serialization. The encoding interaction layer is used to perform feature extraction, specifically including an embedding layer and a transformer encoding layer. The embedding layer is used to transform the word sequence into a word vector representation, specifically including three parts: token embedding, segment embedding, and position embedding. The transformer layer can acquire long-term dependency information from the word sequence input through a self-attention mechanism. BERT is obtained by stacking 12 transformer layers, which can be used to extract feature information from the word sequence to obtain the corresponding word sequence feature vector. In another embodiment, this application can also optimize the word sequence feature vector based on syntactic dependencies, thereby improving the accuracy of answer recognition.

[0055] Step 205: Based on the word sequence feature vector, identify the answer to the target question and obtain the probability of the starting position and the ending position of the answer for each word in the target text.

[0056] Step 207: When the probability of the starting position of the answer and the probability of the ending position of the answer indicate that there is an answer in the target passage that matches the target question, determine the target answer in the target passage based on the probability of the starting position of the answer and the probability of the ending position of the answer.

[0057] The purpose of answer recognition is to extract the start and end positions of the answer within the text based on the word sequence feature vector. The word sequence feature vector is obtained through word segmentation, where each symbol represents a word. The answer start position probability refers to the probability that the current word is the start position of the target answer, while the answer end position probability refers to the probability that the current word is the end position of the target answer. The solution also includes a validator component. The validator identifies whether the answer to the target question exists within the target text using the answer start and end position probabilities. Only when the validator identifies the answer to the target question within the target text can the target answer be extracted from the target text based on the answer start and end position probabilities for each word and fed back to the terminal 102. The target answer is the content between the two words with the highest sum of their answer start and end position probabilities (including these two words), and the word corresponding to the answer start position probability must precede the word corresponding to the answer end position probability.

[0058] Specifically, the scheme of this application predicts the answer to the target question using word sequence feature vectors. After feature extraction, the prediction layer can predict the start and end positions of the answer in the passage. Specifically, the calculated final word sequence feature vectors are substituted into the normalized exponential function in the answer prediction layer. The trained normalized exponential function is used to predict the probability of the start and end positions of the answer for each word in the target passage. After obtaining the two probabilities for each word, a validator is used to verify the existence of the answer to the target question in the target passage. Only when an answer exists will the server determine the target answer in the target passage based on the probability of the start and end positions. If no answer exists, the server will output the result that no answer exists in the target passage. In one embodiment, the scheme of this application can be implemented using a BERT model, which includes an answer prediction layer and a validator to verify the existence of the answer. First, the probability of the starting position *s* and the probability of the ending position *e* corresponding to each word in the word sequence feature vector are predicted using the normalized exponential function in the answer prediction layer.

[0059]

[0060]

[0061] Among them W Y s b Y sW Y e and b Y e These are all model parameters, obtained through random initialization. This indicates that the final word sequence feature vector is obtained during the feature extraction process of the BERT model.

[0062] The loss function for training the BERT model is:

[0063]

[0064] Where y s logs is the loss at the starting position, y e log e is the loss at the termination position, y s y e These are the actual starting and ending positions of the sample answer, respectively.

[0065] Then, a validator determines whether an answer exists. The validator can be determined based on the probability of the answer's starting position (s) and the probability of the answer's ending position (e). Only if the score... has -score ne A question is considered answerable only if its probability score exceeds a preset threshold. Wherein:

[0066] score has =max(s k +e l ), 0≤k≤l≤n

[0067] score na =s0+e0

[0068] Where s0 represents the probability that the first word in the passage is the starting position of the answer, and e0 represents the probability that the first word in the passage is the ending position of the answer. k This represents the probability that the k-th word in the passage is the starting position of the answer. lThis represents the probability that the l-th word in the passage is the starting position of the answer. n represents the total number of words in the target passage. The preset probability scoring threshold can be obtained by trying different thresholds on the validation set and selecting the threshold that performs best on the validation set. When it is determined that an answer exists, the target answer is determined to be the content between the two words whose sum of the probabilities of the answer's starting position and the answer's ending position is the largest, and then the corresponding target answer is fed back to the terminal 102. In a specific embodiment, the user can input a target question and multiple target passages at once. The server 104 can use the machine reading comprehension method of this application to determine the candidate target answers for the target question for each target passage (including the case where there are no candidate target answers). Finally, based on the sum of the probabilities corresponding to each candidate target answer, the candidate target answer with the highest sum of probabilities is determined as the target answer for the target question.

[0069] The aforementioned machine reading comprehension method first acquires text data containing a target question and a target passage. The target question is the problem that the machine reading comprehension needs to answer, while the target passage may contain the answer to the target question. Then, the text data undergoes word serialization and feature extraction to obtain a word sequence feature vector for probability prediction. Based on the word sequence feature data, the answer to the target question is identified, yielding the probability of the answer's starting position and ending position for each word in the target passage. A verification is then performed based on these probabilities to determine if an answer matching the target question exists within the target passage. Only if such an answer exists will the method determine the target answer in the target passage based on the probability of the answer's starting and ending positions, thereby effectively improving the accuracy of the machine reading comprehension process.

[0070] In one embodiment, step 203 includes: performing word segmentation on the text data to obtain the text segmentation result; performing word serialization on the text data based on the text segmentation result to obtain word sequence data; and performing embedding encoding on the word sequence data to obtain the word sequence feature vector corresponding to the word sequence data.

[0071] Word segmentation is fundamental to natural language processing (NLP), and its accuracy directly determines the quality of subsequent part-of-speech tagging, syntactic analysis, word vectorization, and text analysis. English sentences use spaces to separate words, and except for certain specific words like "how many" and "New York," word segmentation is generally unnecessary. However, Chinese is different; it naturally lacks separators, requiring readers to segment words and break sentences manually. Therefore, word segmentation is essential for Chinese NLP to ensure the effectiveness of subsequent processing. Word segmentation can be implemented using algorithms, including dictionary-based rule matching and statistical machine learning methods. This application's solution specifically utilizes statistical machine learning to segment text data. Word serialization involves serializing the words in the text data to obtain the corresponding serialized data. Embedding and encoding processes consist of embedding and encoding. The embedding layer converts the word sequence into word vector representations, while the encoding layer uses a self-attention mechanism to extract long-term dependencies from the word sequence input. The final word sequence feature vector is obtained through embedding and encoding.

[0072] Specifically, the text data processing process includes three steps: word segmentation, word serialization, and encoding. Upon obtaining text data, the first step is word segmentation, which breaks down continuous text into word strings composed of multiple words. In one embodiment, word segmentation can be implemented using deep learning. By inputting the text data into a trained deep learning word segmentation model, the model segments the text data based on deep learning methods, yielding the corresponding word segmentation results. For example, for the sentence "Princess A is a character in a fairy tale widely popular in region A, the most famous version of which appears in the 1824 edition of 'Fairy Tale X' in region B," after word segmentation, the corresponding word segmentation results are: "Princess A," "is," "widely," "popular," "in," "region A," "of," "one," "fairy tale," "in," "character," "," "among," "most famous," "of," "story," "version," "appears in," "region B," "1824," "of," and "Fairy Tale X," etc. After obtaining the text segmentation results, word serialization can be used to serialize each word in the segmentation results. For example, for the text data of the target question part, the serialized representation after word serialization is Q=q1q2…q L , where q1q2…q L Each word corresponds to a word obtained from word segmentation. For the text data of the target passage, the serialized representation after word serialization is P = p1p2…p MMeanwhile, to construct the standard input for subsequent models, the two word sequences, the target question and the target passage, are concatenated into a single word sequence, represented as X = [CLS]q1q2…q L [SEP]p1p2…p M [SEP] has a total length of n = L + M + 3. [CLS] represents the first part of the sentence, and [SEP] distinguishes between two text contents. After obtaining the word sequence, embedding and encoding processes can be performed sequentially, implemented through an embedding layer and a converter encoding layer, respectively. The specific structure of the embedding layer can be found in [reference needed]. Figure 3 The embedding layer can transform a word sequence X into a word vector representation E, which includes three parts: token embedding, fragment embedding, and position embedding. For an input word sequence X = x1x2…x n The word vector matrix is ​​represented as in Let d represent the embedding vector of the i-th word, where d represents the dimension of the embedding vector.

[0073] E = Embedding(X)

[0074] The converter encoding layer can acquire long-term dependency information from the word sequence input through a self-attention mechanism. It can be used to extract feature information from the word sequence by stacking multiple converter layers, such as for word vector matrices. The output of the i-th layer Transformer is formally represented as: in This represents the feature of the j-th word. The Transformer operation is represented as:

[0075]

[0076] The word sequence feature vector of the input sequence can be represented as:

[0077] H = {h1,h2,…,h} n}

[0078] Among them, Q i =H i W i Q K i =H i W i K V i =H i W i V W i Q W i K W iV This represents the corresponding parameter matrix. In this embodiment, through word segmentation, word serialization, and embedding encoding, the input text data can be effectively transformed into a feature vector of word sequences, thereby effectively identifying the probability of the start position and the probability of the end position of the answer, ensuring the accuracy of machine reading comprehension.

[0079] In one embodiment, the process of performing word serialization on the text data based on the text segmentation results to obtain word sequence data includes: performing word serialization on the text segmentation results corresponding to the target question to obtain first word sequence data; performing word serialization on the text segmentation results corresponding to the target chapter to obtain second word sequence data; and concatenating the first word sequence data and the second word sequence data through a preset flag to obtain word serialization data.

[0080] Since the target question and the target passage are two distinct text segments, word segmentation is performed separately on each segment, resulting in two different segmentation results. Similarly, word serialization is performed on these two segmented texts, yielding two separate word serialization sequences. The first sequence represents the target question portion of the text, while the second sequence represents the target passage portion. Preset flags are used to connect these different word sequences and must be set according to the model type. For example, for the BERT model, the initial flag is [CLS], and the flag connecting the different word sequences is [SEP].

[0081] Specifically, after obtaining two segmented text results corresponding to the text data through text segmentation, the segmented data still needs to be serialized. This process can serialize the text segmentation results corresponding to the target question and the text segmentation results corresponding to the target passage separately, obtaining the first word sequence data and the second word sequence data. For the text data of the target question part, the serialized representation after word serialization is Q=q1q2…q L , where q1q2…q L Each word corresponds to a word obtained from word segmentation. For the text data of the target passage, the serialized representation after word serialization is P = p1p2…p M Meanwhile, to construct the standard input for subsequent models, the word sequences of the target question and the target passage can be concatenated into a single word sequence using preset flags. For example, for the BERT model, concatenating the first word sequence data with the second word sequence data yields a word sequenced data represented as X = [CLS]q1q2…q L [SEP]p1p2…p M[SEP], whose total length is n = L + M + 3. In this embodiment, by serializing different text contents and concatenating the serialized text data, text data can be effectively converted into serialized text data, ensuring the validity of the model input data obtained from the conversion.

[0082] In one embodiment, the word sequence data is embedded and encoded to obtain the word sequence feature vector corresponding to the word sequence data, which includes: embedding the word sequence data to obtain the word sequence representation corresponding to the word sequence data; extracting feature information from the word sequence representation through a self-attention mechanism to obtain an initial word sequence feature vector; and optimizing the initial word sequence feature vector based on syntactic dependency relations to obtain the word sequence feature vector.

[0083] Embedding, a distributed representation method, transforms raw input data into a linear combination of features. In this application, embedding is used to convert word sequence data into word vector representations. The main function of the self-attention mechanism is to find the degree of correlation between each vector and other vectors (including itself). This application's scheme obtains long-term dependency information in the word sequence input based on the self-attention mechanism of the converter encoding layer. The converter encoding layer contains multiple converter layers, obtaining the initial word sequence feature vector through multi-layer processing. Syntactic dependency relations specifically refer to the syntactic dependencies between words. Every language has dependency relations between sentence components, and the dependency grammar relations differ between languages. General dependency grammar relations can be used for dependency parsing. Intuitively, dependency parsing identifies grammatical components such as "subject-verb-object" and "attributive-adverbial-complement" in sentences and analyzes the relationships between these components. Syntactic dependency relations can better capture the syntactic structure information between words, thereby improving the representation effect of word sequence feature vectors. Some typical syntactic dependency relations are shown in Table 1 below.

[0084] Table 1: Typical Syntactic Dependency Relations

[0085]

[0086]

[0087] Specifically, after obtaining the word sequence data, these word sequence feature data can be embedded and encoded. Embedding and encoding specifically includes two processes: embedding and encoding. Furthermore, to improve the expressive effect of the feature vector, this application's scheme also introduces syntactic dependency analysis to the word sequence feature vector, thereby improving the expressive effect of the final word sequence feature vector. The embedding and encoding process and the syntactic dependency analysis process are two independent processes; combining them yields an optimized word sequence feature vector. In one embodiment, this application's scheme uses the BERT model to achieve machine reading comprehension processing. In this case, the embedding and encoding process can be implemented through the embedding and encoding layer in the BERT model. First, the word sequence data is embedded through the embedding layer to obtain the corresponding vector representation, which includes three parts: label embedding, fragment embedding, and position embedding. The label embedding layer is used to convert each word in the word sequence into a fixed-dimensional vector. The fragment embedding layer is used to handle the classification task of input sentence pairs, distinguishing the vector representations of the two sentences in the sentence pair. The position embedding layer is used to learn the sequential attributes of the input word sequence. For the input word sequence X = x1x2…x… n The word vector matrix is ​​represented as in Let d represent the embedding vector of the i-th word, where d represents the dimension of the embedding vector.

[0088] E = Embedding(X)

[0089] After obtaining the vector representations corresponding to the word sequences, further transformer encoding processing can be performed. The transformer layer can acquire long-term dependency information from the word sequence input through a self-attention mechanism. BERT has 12 stacked transformer layers, which can be used to extract feature information from the word sequence, given the word vector matrix. The output of the i-th layer Transformer is formally represented as: in This represents the feature of the j-th word. The Transformer operation is represented as:

[0090]

[0091] The input sequence can be represented as follows:

[0092] H = {h1,h2,…,h} n} (3)

[0093] Among them, Q i =H i W i Q K i =HiW i k V i=HiW i V W i Q W i K W i V This represents the corresponding parameter matrix. Simultaneously, during the embedding encoding process, syntactic dependency relations in the word sequence X can be extracted. These syntactic dependency relations are then used to optimize the word sequence, resulting in the final word sequence feature vector:

[0094]

[0095] This representation can be used to identify the answer to the target question and obtain the corresponding probability prediction result. In this embodiment, the final word sequence feature vector is obtained through embedding processing, self-attention encoding processing, and syntactic dependency relations. This effectively ensures the validity of the obtained word sequence feature vector, thereby guaranteeing the accuracy of answer recognition in machine reading comprehension and ensuring the recognition effect.

[0096] In one embodiment, optimizing the initial word sequence feature vector based on syntactic dependency relations to obtain the word sequence feature vector includes: constructing a syntactic dependency tree based on text data; generating a syntactic dependency matrix based on the syntactic dependency tree; generating a syntactic dependency vector corresponding to the word sequence feature vector based on the syntactic dependency matrix; and combining the initial word sequence feature vector with the syntactic dependency vector to obtain the word sequence feature vector.

[0097] The syntactic dependency tree refers to the tree structure obtained by splitting text data after syntactic analysis. For the text data consisting of the target question "Is Princess A from Fairy Tale X?" and the target passage "Princess A is a character in a fairy tale widely popular in region A, the most famous version of which appears in the 1824 edition of Fairy Tale X in region B", the specific syntactic dependency tree can be found in [reference needed]. Figure 4 As shown. The syntactic dependency matrix, on the other hand, is a matrix constructed directly from the syntactic dependency tree, used to represent the syntactic dependency relationships in text data. For details on the syntactic dependency matrix, please refer to... Figure 5 As shown.

[0098] Specifically, the solution in this application improves the accuracy of machine reading comprehension by analyzing syntactic dependency relations. The process of analyzing syntactic dependency relations first requires building a syntactic dependency tree, which can be constructed based on the input text data. The syntactic dependency tree effectively displays the syntactic dependency relations between words obtained from word segmentation in the text data. After obtaining the syntactic dependency tree, it can be abstractly represented as a syntactic dependency matrix. In the syntactic dependency matrix, if there is a syntactic dependency relationship between two words, their corresponding element is 1; otherwise, it is 0. In one embodiment, it is assumed that the input word serialization data is X = {x1, x2, ..., x...} n}, x i The set of ancestor nodes is P. i Then the syntactic dependency matrix It can be represented as:

[0099]

[0100] in, s j It is s i The ancestor node.

[0101]

[0102] The syntactic dependency vector corresponding to the input serialized data can be represented as:

[0103] H′={h′1,h′2,…,h′ n}

[0104] After obtaining the syntactic dependency vector corresponding to the serialized data, this syntactic dependency vector can be further combined with the initial word sequence feature vector H = {h1, h2, ..., h...} obtained by embedding encoding. n By combining these features, we obtain the final word sequence feature vector. in Calculated using the following formula:

[0105]

[0106]

[0107] In this embodiment, the word sequence feature vector is optimized by using syntactic dependency relations, thereby effectively adding the syntactic dependency relations in the text data to the word sequence feature vector, which can effectively improve the representation effect of the word sequence feature vector, thereby improving the accuracy of answer recognition in the machine reading comprehension process.

[0108] In one embodiment, the method further includes: obtaining a first verification score based on the sum of the probability values ​​of the starting position and the ending position of the answer corresponding to the first word in the target passage; obtaining a second verification score based on the sum of the probability values ​​of the starting position and the ending position of the answer corresponding to the answer with the highest probability in the target passage; and determining that there is an answer in the target passage that matches the target question when the difference between the second verification score and the first verification score is greater than a preset probability score threshold.

[0109] The first and second verification scores form the foundational data for the validator used in this application. The validator is specifically used to identify whether an answer exists within a text, thereby improving the ability to reject texts without answers. The preset probability score threshold is data obtained through training and summarizing. Different thresholds were tested on the verification set, and the threshold that performed best on the verification set was selected as the preset probability score threshold for practical application.

[0110] Specifically, before obtaining the final target answer, the solution in this application also needs to verify whether the target answer exists within the target text. The preset validator can verify the existence of the answer by calculating the probability of the start position and the probability of the end position of the answer corresponding to each word in the target text. First verification score. na The score is determined by the sum of the probabilities of the starting and ending positions of the answer corresponding to the first word in the target passage. The corresponding calculation formula is: score na =s0+e0. The second verification score is determined by the sum of the probabilities of the starting and ending positions of the answer corresponding to the most probable answer in the target passage. The specific formula for calculating the second verification score is: score has =max(s k +e l ), 0≤k≤l≤n. The validator is based on the score of the difference between the probabilities of the two. has -score na To perform an existence verification of the answer, only if the score has -score na Only when the score exceeds a preset probability threshold can it be determined that the target passage contains an answer that matches the target question; otherwise, it is determined that the target passage does not contain an answer that matches the target question. In existing technologies where a validator is not available, a second verification score is typically used instead. has To get the target answer, just need the score has If the answer exceeds a certain preset threshold, it can be considered the target answer. This application introduces a first verification score. na Compare it with the second verification scorehas By combining these methods to verify the existence of the answers, the extracted answers were further verified and screened, thereby effectively identifying usable target answers and improving the recognition effect of machine reading comprehension.

[0111] In one embodiment, the method further includes: constructing a question-answer pair based on the target question and the target answer; and submitting the constructed question-answer pair to a preset question-answer database.

[0112] In this context, a question-answer pair refers to a set of text data that simultaneously contains a question and its corresponding answer. A pre-set question-answer database contains multiple different question-answer pairs and can be associated with a frequently-asked questions (FAQ) system. In this system, when a user enters a question, the system can efficiently provide the corresponding answer. Enriching the pre-set question-answer database can effectively improve the coverage of the FAQ system.

[0113] Specifically, the machine reading comprehension method of this application can be used to construct a question-and-answer database. It extracts answers to common questions within a specific domain using machine reading comprehension, constructs question-and-answer pairs within the same domain, and then stores these pairs in a preset question-and-answer database. In one embodiment, the preset question-and-answer database is associated with a common question-and-answer system in that domain. When a user encounters a problem, they can directly input the question or click on a recommended question on the prompt interface. After the user inputs a question, the common question-and-answer system can perform a related search based on the user's input, extract the corresponding answer from the preset question-and-answer database, and then provide the answer back to the user, completing a question-and-answer session and improving the efficiency of question-and-answering. It also ensures the coverage of the questions. In another embodiment, the solution of this application can also be applied to a search engine. When a user searches for answers to a question through a search engine, the preset question-and-answer database can directly provide the corresponding answer, ensuring the timeliness of question feedback and the overall coverage of the questions and answers.

[0114] This application also provides an application scenario in which the above-described machine reading comprehension method is applied. Specifically, the machine reading comprehension method is applied in this scenario as follows:

[0115] When users need to improve the search engine coverage of their browsers, they need to expand the search engine's question-and-answer database. Expanding the database requires building a large number of high-quality question-and-answer pairs, which can extract text content from online sources as answers. Therefore, the machine reading comprehension method described in this application can be used to achieve the final machine reading comprehension processing. The search engine interface after entering the question and the search results interface can be found in [reference needed]. Figure 6 as well as Figure 7As shown, the solution in this application is specifically used to expand the question-answering database of a search engine. The machine reading comprehension method in this application can be implemented using the BERT model; the specific model structure can be found in [reference needed]. Figure 8 As shown, the network structure includes five layers: input layer, encoding-interaction layer, syntactic-dependent-attention layer, answer prediction layer, and output layer. The encoding-interaction layer runs parallel to the syntactic-dependent-attention layer. When constructing question-answer pairs, text data containing one question and one passage can be used as the processing object. The model first performs word segmentation on the input text, and then serializes the segmented results. The question part of the word sequence is formally represented as Q = q1q2…q L The word sequence of a passage is represented as P = p1p2…p M Here, L and M represent the word sequence lengths of the question and the passage, respectively. To construct the standard input for the model, the two word sequences are concatenated into a single word sequence, denoted as X = [CLS]q1q2…q L [SEP]p1p2…p M [SEP], with a total length of n = L + M + 3. Then, in the embedding layer of the encoding interaction layer, the word sequence X is transformed into a word vector representation E, which includes three parts: token embedding, content embedding, and position embedding, for the input word sequence X = x1x2…x n The word vector matrix is ​​represented as in Let be the embedding vector of the i-th word, and d represent the dimension of the embedding vector. Then, it is encoded in the transformer encoding layer of the encoder-transformer interaction layer. The transformer layer can obtain long-term dependency information from the word sequence input through a self-attention mechanism. BERT is obtained by stacking 12 Transformer layers and can be used to extract feature information from word sequences, given a word vector matrix. The output of the i-th layer Transformer is formally represented as: in This represents the feature of the j-th word.

[0116] The initial word sequence feature vector of the input sequence can be represented as: H = {h1, h2, ..., h n When extracting features through the encoding interaction layer, a syntactic dependency structure in the text can also be extracted simultaneously through a syntactic dependency self-attention layer. First, a syntactic dependency tree is constructed based on the text data; a syntactic dependency matrix is ​​generated based on the syntactic dependency tree; based on the syntactic dependency matrix, syntactic dependency vectors corresponding to the word sequence data are generated; the syntactic dependency self-attention layer generates a syntactic dependency matrix through the syntactic dependency tree. Suppose the input token sequence is X = {x1, x2, ..., x} n}, x iThe set of ancestor nodes is P. i Then the syntactic dependency matrix It can be represented as:

[0117]

[0118] in, s j It is s i The ancestor nodes of the input sequence. The syntactic dependency vector of the input sequence can be represented as: H′={h′1,h′2,…,h′} n The initial word sequence feature vector is combined with the syntactic dependency vector to obtain the word sequence feature vector. in After obtaining the final word sequence feature vector, answer prediction can be performed in the answer prediction layer based on this feature vector. This yields the answer probability for each word in the text. The answer prediction layer is designed to predict the start and end positions of the answer within the text based on the features extracted from the input text. The answer prediction layer is represented as follows:

[0119] in, This represents the output of the final aggregation layer, where s and e represent the probabilities of each word being the start and end positions, respectively. Simultaneously, this application uses a validator to reject passages without answers. Only when the score... has -score na A question is considered answerable only when the value exceeds a certain threshold.

[0120] score has =max(s k +e l ), 0≤k≤l≤n

[0121] score na =s0+e0

[0122] Once a question is determined to be answerable, the target answer within the target text is identified based on the probability of the answer's starting and ending positions. A question-answer pair is then constructed based on the target question and answer. This process is repeated to expand the question-answer database, ensuring the search engine's question retrieval efficiency and improving the overall coverage of browser search questions and answers.

[0123] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0124] Based on the same inventive concept, this application also provides a machine reading comprehension apparatus for implementing the machine reading comprehension method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more machine reading comprehension apparatus embodiments provided below can be found in the limitations of the machine reading comprehension method described above, and will not be repeated here.

[0125] In one embodiment, such as Figure 9 As shown, a machine reading comprehension device is provided, comprising:

[0126] The text data acquisition module 902 is used to acquire text data containing the target question and the target text, with the target question matching the target text.

[0127] The feature extraction module 904 is used to perform word serialization and feature extraction processing on text data to obtain word sequence feature vectors.

[0128] The answer recognition module 906 is used to identify the answer to the target question based on the word sequence feature vector, and to obtain the probability of the starting position and the ending position of the answer corresponding to each word in the target text.

[0129] The answer extraction module 908 is used to determine the target answer in the target passage based on the answer start position probability and the answer end position probability when the answer start position probability and the answer end position probability represent that there is an answer in the target passage that matches the target question.

[0130] The aforementioned machine reading comprehension device first acquires text data containing a target question and a target passage. The target question is the question that the machine reading comprehension needs to answer, while the target passage may contain the answer to the target question. Then, the text data is processed through word serialization and feature extraction to obtain a word sequence feature vector for probability prediction. Based on the word sequence feature data, the answer to the target question is identified, thus obtaining the probability of the answer's starting position and ending position for each word in the target passage. A verification is then performed based on the obtained answer's starting and ending position probabilities to determine whether an answer matching the target question exists in the target passage. Only when such an answer exists will the method of this application determine the target answer in the target passage based on the answer's starting and ending position probabilities, thereby effectively improving the accuracy of the machine reading comprehension process.

[0131] In one embodiment, the feature extraction module 904 is mainly used for: performing word segmentation on the text data to obtain the text segmentation result; performing word serialization on the text data based on the text segmentation result to obtain word sequence data; and performing embedding encoding on the word sequence data to obtain the word sequence feature vector corresponding to the word sequence data.

[0132] In one embodiment, the feature extraction module 904 is further configured to: perform word serialization processing on the text segmentation results corresponding to the target question to obtain first word sequence data; perform word serialization processing on the text segmentation results corresponding to the target chapter to obtain second word sequence data; and concatenate the first word sequence data and the second word sequence data through a preset flag to obtain word serialization data.

[0133] In one embodiment, the feature extraction module 904 is further configured to: perform embedding processing on the word sequence data to obtain the word sequence representation corresponding to the word sequence data; extract feature information from the word sequence representation through a self-attention mechanism to obtain an initial word sequence feature vector; and optimize the initial word sequence feature vector based on syntactic dependency relations to obtain a word sequence feature vector.

[0134] In one embodiment, the feature extraction module 904 is further configured to: construct a syntactic dependency tree based on the text data; generate a syntactic dependency matrix based on the syntactic dependency tree; generate a syntactic dependency vector corresponding to the word sequence data based on the syntactic dependency matrix; and combine the initial word sequence feature vector with the syntactic dependency vector to obtain the word sequence feature vector.

[0135] In one embodiment, the device further includes a verifier module, configured to: obtain a first verification score based on the sum of the probability values ​​of the starting position and the ending position of the answer corresponding to the first word in the target passage; obtain a second verification score based on the sum of the probability values ​​of the starting position and the ending position of the answer corresponding to the answer with the highest probability in the target passage; and determine that there is an answer in the target passage that matches the target question when the difference between the second verification score and the first verification score is greater than a preset probability score threshold.

[0136] In one embodiment, the apparatus further includes a question-answer pair construction module, configured to: construct a question-answer pair based on a target question and a target answer; and submit the constructed question-answer pair to a preset question-answer database.

[0137] The modules in the aforementioned machine reading comprehension device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0138] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores machine reading comprehension-related data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a machine reading comprehension method.

[0139] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0140] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0141] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0142] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the computer device to perform the steps in the above method embodiments.

[0143] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0144] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0145] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0146] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A machine reading comprehension method, characterized in that, The method includes: Obtain text data containing a target question and a target passage, wherein the target question matches the target passage; The text data is segmented to obtain a word segmentation result; the text data is then serialized into word sequence data based on the word segmentation result; the word sequence data is embedded to obtain a word sequence representation corresponding to the word sequence data; feature information in the word sequence representation is extracted using a self-attention mechanism to obtain an initial word sequence feature vector; the initial word sequence feature vector is optimized based on syntactic dependency relations to obtain a word sequence feature vector. Based on the word sequence feature vector, the answer to the target question is identified, and the probability of the starting position and the ending position of the answer corresponding to each word in the target text are obtained. When the probability of the starting position of the answer and the probability of the ending position of the answer indicate that there is an answer in the target passage that matches the target question, the target answer in the target passage is determined based on the probability of the starting position of the answer and the probability of the ending position of the answer.

2. The method according to claim 1, characterized in that, The step of performing word sequence processing on the text data based on the text segmentation results to obtain word sequence data includes: The text segmentation results corresponding to the target problem are subjected to word serialization processing to obtain the first word sequence data; The word segmentation results corresponding to the target text are processed by word serialization to obtain the second word sequence data; The first word sequence data and the second word sequence data are concatenated by a preset flag to obtain word sequence data.

3. The method according to claim 1, characterized in that, The optimization of the initial word sequence feature vector based on syntactic dependency relations to obtain the word sequence feature vector includes: Construct a syntactic dependency tree based on the text data; Generate a syntactic dependency matrix based on the aforementioned syntactic dependency tree; Based on the syntactic dependency matrix, generate the syntactic dependency vector corresponding to the word sequence data; The initial word sequence feature vector is combined with the syntactic dependency vector to obtain the word sequence feature vector.

4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: The first verification score is obtained by summing the probability values ​​of the starting position and ending position of the answer corresponding to the first word in the target passage. The second verification score is obtained by summing the probability values ​​of the starting position and the ending position of the answer corresponding to the answer with the highest probability in the target passage. When the difference between the second verification score and the first verification score is greater than a preset probability score threshold, it is determined that there is an answer in the target chapter that matches the target question.

5. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Construct question-answer pairs based on the target question and the target answer; The constructed question-and-answer pairs are submitted to a preset question-and-answer database.

6. A machine reading comprehension device, characterized in that, The device includes: The text data acquisition module is used to acquire text data containing a target question and a target passage, wherein the target question matches the target passage; The feature extraction module is used to perform word segmentation on the text data to obtain the word segmentation result; perform word serialization on the text data based on the word segmentation result to obtain word sequence data; perform embedding on the word sequence data to obtain the word sequence representation corresponding to the word sequence data; extract feature information from the word sequence representation through a self-attention mechanism to obtain an initial word sequence feature vector; and optimize the initial word sequence feature vector based on syntactic dependency relations to obtain a word sequence feature vector. The answer recognition module is used to identify the answer to the target question based on the word sequence feature vector, and to obtain the probability of the starting position and the ending position of the answer for each word in the target text. The answer extraction module is used to determine the target answer in the target passage based on the answer start position probability and the answer end position probability when the answer start position probability and the answer end position probability indicate that there is an answer in the target passage that matches the target question.

7. The apparatus according to claim 6, characterized in that, The feature extraction module is specifically used for: performing word serialization processing on the text segmentation results corresponding to the target problem to obtain first word sequence data; performing word serialization processing on the text segmentation results corresponding to the target chapter to obtain second word sequence data; and concatenating the first word sequence data and the second word sequence data through a preset flag to obtain word sequence data.

8. The apparatus according to claim 6, characterized in that, The feature extraction module is specifically used for: constructing a syntactic dependency tree based on the text data; generating a syntactic dependency matrix based on the syntactic dependency tree; generating a syntactic dependency vector corresponding to the word sequence data based on the syntactic dependency matrix; and combining the initial word sequence feature vector with the syntactic dependency vector to obtain a word sequence feature vector.

9. The apparatus according to any one of claims 6 to 8, characterized in that, It also includes a verifier module, used to: obtain a first verification score based on the sum of the probability values ​​of the starting position and the ending position of the answer corresponding to the first word in the target passage; obtain a second verification score based on the sum of the probability values ​​of the starting position and the ending position of the answer corresponding to the answer with the highest probability in the target passage; and determine that there is an answer in the target passage that matches the target question when the difference between the second verification score and the first verification score is greater than a preset probability score threshold.

10. The apparatus according to any one of claims 6 to 8, characterized in that, It also includes a question-answer pair construction module, used to: construct question-answer pairs based on the target question and the target answer; and submit the constructed question-answer pairs to a preset question-answer database.

11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.