Unified machine reading comprehension method based on recombinant adversarial

By reorganizing the adversarial unified machine reading comprehension method, multi-type problems are converted into single-choice decisions, and candidate representation is enhanced through encoding layers and adversarial learning, which solves the poor performance of existing models in multi-type and multi-candidate scenarios. questions, achieving greater reading comprehension accuracy and adaptability.

CN114912419BActive Publication Date: 2024-09-06NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210407939.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-19
Publication Date
2024-09-06
Estimated Expiration
2042-04-19

AI Technical Summary

Technical Problem

Existing machine reading comprehension models cannot effectively and uniformly handle multiple types of questions and scenarios with a variable number of candidates, resulting in poor performance in real reading comprehension tasks.

Method used

A unified machine reading comprehension method based on reorganization adversarial is proposed. Different types of questions are converted into single-choice decision forms through the reorganization layer, and the encoding layer and fusion layer are used to enhance the vector representation of candidates. The adversarial learning mechanism is combined with the adversarial learning mechanism to avoid vector convergence and achieve Differential representation of different candidates.

Benefits of technology

It significantly improves the accuracy and discrimination ability of reading comprehension in multi-type and multi-candidate scenarios, can effectively solve problems with diverse question types and an unspecified number of candidates, and improves the adaptability and performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114912419B
    Figure CN114912419B
Patent Text Reader

Abstract

The present invention belongs to the field of natural language processing, and discloses a unified machine reading comprehension method based on reorganization confrontation, obtaining questions of diversified types and unspecified number of candidate items; reorganizing questions and candidate items to form combined candidate items, and judging whether the new candidate items are valid or not based on the reference text, and uniformly converting the judgment questions, multiple-choice questions and matching questions in the actual reading comprehension scene into single-choice judgment questions; jointly encoding the combined candidate items obtained by reorganization and the reference text, and obtaining the vector representation of the reorganized candidate items after interaction with the reference text and other reorganized candidate items; integrating the reference text information related to the reorganized candidate item vector representation; treating each candidate item vector as a separate sample, and making a probability judgment on whether it is valid or not, and outputting the result. The present invention converts multiple-choice questions into true or false judgments of each candidate item; the two mechanisms of fusion layer and adversarial learning improve the ability to distinguish different candidates.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of natural language processing, and in particular relates to a unified machine reading comprehension method based on reorganization adversary. Background Art

[0002] The ability of a machine to perform reading comprehension is an important criterion for measuring its intelligence level. Among them, selective machine reading comprehension, because most of its candidates are synonymous rewrites of the reference text content, places higher requirements on the semantics of the machine's understanding of the text. The most advanced method for solving selective machine reading comprehension currently mainly customizes the model structure in a single question type scenario. However, in real reading comprehension scenarios, the same article is often examined from different angles, resulting in multiple types of questions and an unspecified number of corresponding candidates. In view of this, it is not difficult to find that previous customized models cannot be expanded to cover real scenario needs due to excessive consideration of the characteristics of a single problem scenario.

[0003] Machine reading comprehension (MRC) is an important basic task in natural language processing, which helps to further improve the intelligence level of machines. In this task, the machine needs to answer specific questions based on a full understanding of the provided reference text (sentences, paragraphs or articles). Depending on whether the answer appears in the relevant documents, MRC can be further divided into two types: extractive machine reading comprehension (EMRC) and multi-choice machine reading comprehension (MCMRC). EMRC needs to extract text fragments that can answer the question from the original text as the predicted answer, and some tasks will provide additional candidates. Unlike the former, the content of the candidates in MCMRC is mostly synonymous rewriting or summary of the original content, so it puts more stringent requirements on the machine's understanding ability when performing reading comprehension.

[0004] Existing research on MCMRC can be roughly divided into three categories: The first method designs an attention mechanism to achieve interaction between text, questions, and candidates, thereby promoting the discovery and fusion of information so that the model can predict results more accurately. The second method is based on a pre-trained language model. The first stage is pre-training on pre-training corpus, and the second stage is fine-tuning in the downstream specific MCMRC tasks. In addition to the above two methods, technical means such as cognitive science, evidence sentence screening, and graph neural networks have also been introduced into MCMRC in order to achieve better results.

[0005] Specifically, the representative method ALBERT (non-patent literature: A Lite BERT for Self-supervised Learning of Language Representations) first pre-trains on general corpus through self-supervised tasks; secondly, it designs classifiers based on the characteristics of downstream tasks, such as four classifiers on the four-choice single-choice datasets RACE (non-patent literature Race: Large-scale reading comprehension dataset from examinations) and DREAM (non-patent literature DREAM: A Challenge Dataset and Models for Dialogue-Based Reading Comprehension) or three classifiers on the three-choice dataset ReClo (non-patent literature ReClor: A Reading Comprehension Dataset Requiring Logical Reasoning); finally, it uses the classifier to predict the results and fine-tune the pre-trained model. ALBERT has successfully achieved SOTA results on various tasks by customizing the classifier and other structures for specific types of datasets.

[0006] It is worth noting that in real reading comprehension scenarios, the same article will be examined from different angles, which may lead to a mixture of multiple types of questions, such as multiple-choice questions, true-or-false questions, and matching questions. Along with the diversification of question types comes the uncertainty of the number of candidate options. There may be two candidates for true or false judgment, four candidates for the traditional four-choice question, and an indefinite number of candidates in matching questions. For example, the reading comprehension data set TQA, which is derived from the science textbooks for middle school students, contains 1,076 reference texts and 26,260 questions, with an average of 24 questions per article. In order to fully examine the students' mastery of the text, the types of after-class questions involve multiple dimensions such as true-or-false questions, multiple-choice questions, and matching questions, and the question types are interspersed and distributed without obvious blocks.

[0007] Therefore, how to make the model adaptively solve mixed-type reading comprehension tasks remains a challenging problem. Existing methods need to design a combined input mode of text, questions and candidates based on the question type during encoding. For example, multiple-choice questions require the concatenation of text, questions and candidates as input, while judgment questions only need to match text and questions without considering candidates. In addition, when making the final probability prediction, it is necessary to design the output form of the classifier according to the number of candidates, that is, binary classification, four-classification or other. Although these problems can be alleviated to a certain extent by designing additional type discriminators to determine the question type and then classifying the processing method, the model framework under this design needs to be customized according to changes in the question type and the number of candidates, and cannot cope with dynamically changing real-world scenarios. Therefore, mixed-type reading comprehension tasks driven by real scenarios still need further special research.

[0008] Existing models for solving MCMRC-related tasks can be divided into three categories according to different design ideas: those based on attention mechanisms, those based on pre-trained language models, and other models. Traditional models collect and summarize evidence (text fragments) related to the question in the article, and then match the evidence with candidate items to select the best answer. Zhu Haichao, Wei Furu, Qin Bing, et al. proposed in the non-patent literature Hierarchical Attention Flow for Multiple-Choice Reading Comprehension that this simple matching retrieval mode does not make full use of the information in the text, so they designed a hierarchical attention flow framework based on neural networks to make full use of candidate items to model the word-level and sentence-level interactions between reference text, questions, and candidate items. Wang Shuohang, Yu Mo, Jiang Jing et al. regard questions and candidates as two sequences in the non-patent document ACo-Matching Model for Multi-choice Reading Comprehension. For each character in the reference text, two attention weighted vectors from the question and the candidate are calculated. Then, the position information of the question and the candidate answer matching the specific context of the reference text are encoded and jointly matched with the given text, so as to realize the information aggregation from the word level to the sentence level, and then from the sentence level to the document level. Chen Zhipeng, Cui Yiming, Ma Wentao et al. first encode the reference text, question and candidate items into word representations enhanced by additional POS tags and matching features in the non-patent document Convolutional Spatial Attention Model for Reading Comprehension with Multiple-Choice Questions. Then, the representation of the candidate items is enriched by combining the reference text and question information, and a convolutional neural network is used to dynamically extract spatial related information between adjacent regions under different window sizes to form spatial attention. Duan Liguo, Gao Jianyig, Li Aiping and others obtained the comprehensive semantics of articles and questions in the non-patent literature A Study on Solution Strategy of Option-Problems in Machine Reading Comprehension. On the basis of four commonly used attention methods, namely concatenation, bilinear, dot product and difference, they integrated the attention of query2context and context2query to strengthen the key information of articles and questions and weaken irrelevant information.

[0009] With the emergence of BERT, pre-trained language models have been proven to have strong performance in machine language understanding. Therefore, researchers consider using it as the encoding layer of the model to design a structure combined with an attention mechanism. Ran Qiu, Li Peng, Hu Weiwei, et al. proposed a comparison network that displays comparison candidates at the character level in the non-patent literature Option Comparison Network for Multiple-choice Reading Comprehension. First, BERT is used to encode the candidates into vector sequences as their features. Then, for each candidate, an attention-based mechanism in the vector space is used to compare it with other candidates one by one at the word level to identify their relevance. Zhang Shuailiang, Zhao Hai, Wu Yuwei, et al. also proposed a dual co-matching network in the non-patent literature DCMN+: Dual Co-Matching Network for Multi-Choice Reading Comprehension, using BERT as the encoder. It bidirectionally merges all pairwise relationships between the <reference text, question, candidate> triples and uses a gating mechanism to fuse representations from both directions. In addition, two reading strategies commonly used by humans are integrated. One is text sentence selection, which helps extract evidence from reference text and then matches the evidence with candidate items. The other is candidate item interaction, which encodes comparative information into each candidate item. This type of method focuses on designing attention mechanisms to explore the relationship between reference text, questions, and candidate items. However, different types of questions have different characteristics and require targeted designs. For example, in judgment questions, it is not necessary to design the interaction between candidate items ("right" or "wrong") and reference text and questions.

[0010] As mentioned above, with the emergence of BERT, the field of natural language processing has entered the era of pre-trained language models. In addition to being the encoding module of the overall model, the pre-trained language model can also directly fine-tune the vector representation for downstream tasks of MCMRC. Devlin J, Chang Ming-Wei, Lee K et al. proposed the auto-encoding language model BERT in the non-patent document A Co-Matching Model for Multi-choice Reading Comprehension. The overall framework is based on a 12-layer transformer encoder. Two self-supervisory tasks, random masks and prediction of corresponding position characters and sentence continuity prediction, are designed to pre-train the model on general corpus. Finally, a classifier with the same number of candidate items predicts the probability of each candidate item. Yang Zhilin, Dai Zihang, Yang Yiming et al. believed in the non-patent document XLNet: Generalized Autoregressive Pretraining for Language Understanding that the mask mechanism in BERT will lead to inconsistent data input in the two stages of training and fine-tuning, so XLNET was proposed. The mask mechanism was abandoned and a two-stream self-attention mechanism was proposed. Inside the Transformer, n-1 words are randomly selected from the previous and next words of the selected word and placed in the previous position of the word, and the input of other words is hidden through the attention mask, so as to combine the strengths of the autoencoder and autoregressive models. Liu Yinhan, OttM, Goyal N, et al. designed RoBERTa in the non-patent document RoBERTa: A Robustly Optimized BERT Pretraining Approach, which mainly improved BERT in three aspects: 1) After experimental verification, the sentence continuity prediction task was deleted; 2) A dynamic mask scheme was proposed, and random masking was performed after the sentence was input into the model; 3) The batch-size of each round of training was expanded.Lan Zhenzhong, Chen Mingda, Goodman S et al. proposed ALBERT in the non-patent document ALBERT: A Lite BERT for Self-supervised Learning of Language Representations with the original intention of making the model lighter, faster to train and more effective. They used matrix decomposition to first map the word one-hot vector to a low-dimensional space and then to the hidden layer. Secondly, all encoding layers shared parameters. Finally, a self-supervised task based on topic association was designed to predict whether the order of two sentences was swapped.

[0011] Although this type of method has achieved good results on various MCMRC lists, fine-tuning requires designing specific input and output forms based on the specific tasks of the downstream. This feature makes it impossible to directly use the pre-trained language model in scenarios where the option types are not fixed.

[0012] In addition to the two main research paths mentioned above, researchers have also explored how to solve MCMRC in other directions. In the non-patent literature Improving Machine Reading Comprehension with General Reading Strategies, Sun Kai, Yu Dian, Yu Dong, et al. were inspired by reading strategies that have been proven to effectively improve the comprehension level of human readers in cognitive science research, and proposed three relatively independent reading strategies to improve MCMRC: 1) repeated reading, comprehensively considering the positive and reverse order of the input sequence; 2) highlighting, adding trainable word vector representations to the text representation of tags related to questions and candidates; 3) self-evaluation, generating questions and options directly from the text in an unsupervised manner to evaluate the model effect. Wang Hai, Yu Dian, Sun Kai, et al. are committed to discovering evidence sentences in text in the non-patent literature Evidence Sentence Extraction for Machine Reading Comprehension. Due to the lack of real evidence sentence labels in most cases, distant supervision is used to generate imprecise labels, which are then used to train the evidence sentence extractor. The noisy labels are then cleaned using a deep probabilistic logic learning framework to improve quality, and then sentence-level and cross-sentence language indicators are combined for semi-supervised training. Huang Yinya, Fang Meng, Cao Yu, et al. proposed a discourse-aware graph network for reasoning based on the discourse structure of text in the non-patent literature DAGN: Discourse-Aware Graph Network for Logical Reasoning. The model first encodes discourse information into a logical graph, where the basic discourse units are nodes and discourse relations are edges. Secondly, graph neural networks are used to learn high-level discourse features to represent text, and finally the discourse features are combined with contextual tag features from a pre-trained language model.

[0013] Although these models have achieved good performance on different MCMRC tasks, due to the limitations of these tasks themselves, they cannot be directly transferred to application scenarios with multiple types of problems and an unspecified number of candidate items under a unified framework. Summary of the invention

[0014] The unified machine reading comprehension method based on reorganization adversarial proposed in the present invention can better solve the above problems for MCMRC related problems by converting all types of questions into right or wrong judgments of each option. The present invention proposes a unified machine reading comprehension framework based on reorganization adversarial, using a unified framework to solve mixed-type reading comprehension problems. First, the candidate items are recombined through the reorganization layer to integrate all types of questions into one form; secondly, the interaction between the reference text and the reorganized candidate items is fully realized through the encoding layer and the fusion layer, so that the vector representation of the reorganized candidate items contains more supporting text information; finally, random perturbations are added during the training process through adversarial learning to avoid vector convergence problems, thereby obtaining differential representations of the reorganized candidate items. The experimental results on the reading comprehension dataset derived from the science textbooks of middle school students show that the designed method can better solve the problems of diversified problem types and unspecified number of candidate items.

[0015] To this end, this paper studies a unified model framework for hybrid machine reading comprehension, which proposes a recombinant adversarial model ( r Ecombination a dversarial m odel, RAM), designed a model framework to cope with reading comprehension scenarios with multiple types of questions and an unspecified number of candidate items. In view of the pain point that existing methods cannot be applied to new questions, RAM constructed a new reading comprehension framework, which uniformly converted all questions into single-choice judgment forms, and solved the above two problems by judging the correctness of each option. Specifically, RAM first splits the candidate items and combines them with the questions one by one to form interrogative sentences. Subsequently, the reference text and the newly generated candidate items are combined to transform different types of questions into judgment questions that predict the probability of validity of each new candidate item with the support of the reference text. This transformation overcomes the difficulty of existing research that cannot uniformly perform reading comprehension of multiple types of questions. In order to further enrich the information capacity in the candidate items, RAM designed to incorporate the attention interaction results of the reference text and the candidate items into the vector representation of the candidate items after encoding, so that the judgment of the probability of validity is more reliable. In addition, under this framework, since the new candidate items under the same question contain the same components (questions), the content of the original candidate items may be smoothed during vector encoding, which leads to the problem that the vector representation of the new candidate items tends to be consistent. To this end, we propose to use adversarial learning in the training phase. By randomly perturbing the vector representation, we force it to pay more attention to different parts of the new candidate items during the learning process and expand the differences in the vector representation of the new candidate items. Finally, the model based on RAM achieved superior test performance on public datasets.

[0016] Specifically, the unified machine reading comprehension method based on reorganization confrontation disclosed in the present invention includes the following steps:

[0017] Get questions with a variety of types and an unspecified number of candidate items;

[0018] Reorganize questions and candidates to form combined candidates, and judge whether the new candidates are valid or not based on the reference text, and convert the true and false questions, multiple-choice questions and matching questions in actual reading comprehension scenarios into single-choice judgment questions;

[0019] Co-encode the combined candidate items obtained by the recombination and the reference text to obtain the vector representation of the recombinant candidate items after interaction with the reference text and other recombinant candidate items;

[0020] Incorporating relevant reference text information into the vector representation of the reorganized candidate items to enrich the information contained in the vector representation of the reorganized candidate items;

[0021] Treat each candidate vector as a separate sample, make a probability judgment on whether it is true or not, and output the result.

[0022] Furthermore, the step of converting the true-or-false questions, multiple-choice questions, and matching questions in the actual reading comprehension scenario into single-choice judgment questions includes:

[0023] Split the candidate items and combine them with the questions one by one to form interrogative sentences;

[0024] Combine the reference text with the newly generated candidates to transform different types of questions into judgment questions that predict the probability of each new candidate being true with the support of the reference text.

[0025] Furthermore, the mathematical form of the judgment question is:<P,Q,A> Triplet,

[0026] Where P represents the reference text, which is in the form of a sentence, paragraph or whole article; Q represents the question in natural language form, A = {a 1 , a 2 , ..., a n} represents the set of candidate items corresponding to a specific question, n represents the number of candidate items, among which there is only one correct answer.

[0027] Furthermore, for any input question, the candidate items are split and concatenated to the question to form new candidate items with the same number as the original candidate items, which is specifically expressed as:

[0028] C={c 1 , c 2 , ..., c n}={Q+a 1 , Q+a 2, ..., Q+a n}

[0029] Among them, C represents the reorganized candidate set;

[0030] The reference text P is used as background knowledge to combine with the candidate items so that the machine can judge whether the factual statements in the candidate items are true. The specific combination form is as follows:

[0031] P,c 1 , c 2 , ..., c n

[0032] The above formula concatenates all candidate items, considers the information contained in the reference text P, and pays attention to the key information in other candidate items to discover the association relationship between different candidate items.

[0033] Furthermore, the co-coding of the combined candidate items obtained by reorganization and the reference text includes:

[0034] The pre-trained language model RoBERTa is used as a word segmenter to perform word segmentation and vocabulary mapping of the text to obtain the encoding of the text and candidate items. The specific input form is as follows:

[0035] [CLS]P[SEP]c 1 [SEP]c 2 [SEP]...[SEP]c n [SEP]

[0036] Among them, [CLS] represents the special character that marks the starting position of the input text in RoBERTa, [SEP] represents the spacing character between different texts in RoBERTa, and n is the number of texts;

[0037] Get word vector representations of reference text and candidate items:

[0038] E=(e 1 ,e 2 ,...,e m )∈R m×d

[0039] Among them, E represents the word vector encoding of the input text sequence, e m Represents the word vector of the mth character in the sequence, R represents the real number space, m represents the text length, and d represents the dimension size.

[0040] Furthermore, for data whose length after concatenation of text and candidate items exceeds 512, the sliding window mechanism of Longformer, the expanded sliding window mechanism, and the sliding window mechanism integrating global information are used to expand the input upper limit to 4096;

[0041] Or use BigBird's random attention, window attention, and global attention methods to reduce the complexity in BERT to linear, thereby expanding the input limit to 4096.

[0042] Furthermore, incorporating relevant reference text information into the vector representation of the reorganized candidate item includes:

[0043] Design the attention mechanism between text and candidates:

[0044]

[0045] s=softmax(a)

[0046]

[0047] Among them, tanh represents a nonlinear activation function to achieve nonlinear mapping, W pc represents the learnable weight matrix, E p is the reference text vector representation, is the candidate vector representation, b pc represents the bias term, j is the number of the candidate item, and softmax realizes the normalization of the values ​​in the matrix on [0,1], and finally obtains the candidate item c j Attention vector representation of reference text

[0048] Use mean_pooling to obtain the average vector representation of each candidate, that is:

[0049]

[0050] where |·| represents the number of specific objects, sum represents linear sum, and the candidate average vector represents C j ∈R d Will be used for information fusion and final probability prediction;

[0051] After obtaining the attention vector representation, the highway network mechanism is used to achieve information fusion, as follows:

[0052]

[0053]

[0054]

[0055] Among them, W r and W g represents a learnable weight matrix, [;] represents a concatenated input vector, Represents the multiplication of the corresponding position elements of two matrices, relu represents the nonlinear activation function, O j Represents the input vector and the intermediate vector Linear interpolation, G represents the gate threshold to control the proportion of each part in the linear interpolation. is the average vector representation of the reference text;

[0056] The final representation M of the candidate items obtained after the fusion layer is obtained by linear concatenation j ∈R 2d :

[0057]

[0058] Furthermore, treating each candidate item vector as a separate sample and making a probability determination on whether it is true or not includes:

[0059] A binary classifier is used to predict the probability of the candidate vector between [0,1]:

[0060] P = sigmoid(f p (M))

[0061] Among them, P represents the probability output of the candidate, sigmoid is used to smooth the neural network output to [0,1], and f p Represents a binary classification fully connected prediction network with an output dimension of 1;

[0062] During training, a probability prediction is made for each candidate and the loss value is calculated one by one. The mathematical formula is:

[0063]

[0064] Among them, BCE is the binary cross entropy loss function, L p represents the calculated loss value, L represents the set of true labels, k represents the kth candidate, N represents the set of all candidates in the current batch_size, |·| represents the number of specific objects, p represents the predicted probability of the model, and l represents the true label of the sample.

[0065] Furthermore, an adversarial learning mechanism is introduced to add random interference to the candidate item vector representation, forcing the model to focus on the regular key semantic distribution and achieve differential representation of the candidate item vectors.

[0066] Furthermore, in the adversarial training, E represents the input, θ represents the parameters of the model, and the adversarial training adds the following loss to the loss function of the binary classifier:

[0067]

[0068] Among them, r adv represents the random perturbation of the final input, r represents the random perturbation, ||·|| represents the second norm, ε represents the hyperparameter, and L represents the loss function;

[0069] The following formula is used to implement the operation of the above formula in the neural network. The specific process is as follows:

[0070] r adv =-εg / ||g||

[0071]

[0072] Among them, g represents the gradient of the loss function L to the input word vector representation E, represents the gradient operation, f represents the model operation, and y represents the sample label.

[0073] The beneficial effects of the present invention are:

[0074] The shortcomings of the traditional MCMRC task setting were discovered, and a new reading comprehension task with multiple question types and an unspecified number of candidate items was proposed based on real reading comprehension scenarios. Multiple-choice questions were converted into true or false judgments for each candidate item.

[0075] A unified model for solving the above problems is proposed, including a candidate reorganization layer that unifies different types of problems, an encoding layer that realizes the semantic representation of long texts, an attention fusion layer that enriches the candidate information, an adversarial training module that expands the differences in semantic representation, and a prediction layer.

[0076] In order to improve the ability to distinguish different candidates, two mechanisms, fusion layer and adversarial learning, are proposed. Experiments have proved the effectiveness of RAM in solving the above problems through a unified framework, as well as the rationality of the design of different components. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] Figure 1 Model framework diagram of the present invention. DETAILED DESCRIPTION

[0078] The present invention is further described below in conjunction with the accompanying drawings, but the present invention is not limited in any way. Any changes or substitutions made based on the teachings of the present invention belong to the protection scope of the present invention.

[0079] Definition 1 (Mixed-Type Selective Reading Comprehension): The MCMRC task can be expressed as providing<P,Q,A> A triple, where P represents the reference text, which can be a sentence, paragraph or whole article; Q represents the question in natural language form. There may be multiple questions under the same reference text, and the types of questions are diverse; A = {a 1 ,a 2 ,...,a n} represents the set of candidate items corresponding to a specific question, n represents the number of candidate items, among which there is only one correct answer. The machine is required to read and understand the question based on the reference text and finally predict the correct result from the candidate items.

[0080] The model of the present invention includes a reorganization layer, a coding layer, a fusion layer, an adversarial training module and a prediction layer, and its framework is as follows: Figure 1 shown.

[0081] In order to solve the problems of question diversity and uncertain number of candidate items, the present invention reorganizes questions and candidate items through a reorganization layer to form combined candidate items, and judges whether the new candidate items are valid or not based on the reference text, thereby realizing the unified conversion of judgment questions, multiple-choice questions and matching questions in actual reading comprehension scenarios into single-choice judgment questions.

[0082] In order to make the model have more sufficient supporting information when judging the reorganization candidates one by one, the present invention designs the encoding layer and the fusion layer. The encoding layer obtains the vector representation after interaction with the reference text and other reorganization candidates by jointly encoding the reorganization candidates obtained by the reorganization layer and the reference text; the fusion layer further enriches the information contained in the vector representation of the reorganization candidate by integrating the relevant reference text information into the vector representation of the reorganization candidate.

[0083] In order to avoid the problem of convergence of vector representations caused by too many overlapping parts in the reorganization candidates, the present invention introduces an adversarial learning mechanism. By adding random interference to the vector representation of the candidate items, the model is forced to pay more attention to the regular key semantic distribution, thereby achieving differentiated representation of the candidate item vectors.

[0084] Recombination layer: In the existing technology, the data input mode and probability prediction classifier of the model need to be customized according to the question type and the number of candidate items. Specifically, for true or false questions, only the text and question need to be input, and then a binary classification judgment is made based on the generated text vector; for multiple choice questions, all candidate items need to be concatenated as input after combining the text and question, and a specific classification judgment is made on the candidate item vector through the internal interaction of the model.

[0085] In order to make the model not change with the specific type of input question and the actual number of candidate items corresponding to the question, RAM first converts all questions into a single-choice judgment form. For any input question, the candidate items are split and concatenated to the question to form new candidate items with the same number as the original candidate items, which is specifically expressed as:

[0086] C={c 1 , c 2 , ..., c n}={Q+a 1 , Q+a 2 , ..., Q+an} (1)

[0087] Among them, C represents the reorganized candidate set. For the sake of simplicity,

[0088] In the following text, the term "candidate" refers to the reorganized candidate.

[0089] Subsequently, the reference text P is combined with the candidate items as background knowledge for the machine to determine whether the factual statements in the candidate items are true. The specific combination form is as follows:

[0090] P,c 1 , c 2 , ..., c n

[0091] The reason why the present invention connects all candidate items in series is that it hopes that RAM will not only consider the information contained in the reference text P when encoding the candidate items, but also pay attention to the key information in other candidate items. This will help the model discover the correlation between different candidate items to make more reasonable predictions.

[0092] After completing the internal interaction of the model, RAM will determine whether each candidate item is binary classified or not, which is different from the existing work.

[0093] Neural networks cannot directly process discrete natural language symbol information, so it is necessary to map natural language to word vectors through the encoding layer. The present invention first uses the pre-trained language model RoBERTa as a word segmenter to perform text segmentation and vocabulary mapping. The specific input form is as follows:

[0094] [CLS]P[SEP]c 1 [SEP]c 2 [SEP]...[SEP]c n [SEP]

[0095] Among them, [CLS] represents the special character that marks the starting position of the input text in RoBERTa, and [SEP] represents the spacer character between different texts in RoBERTa. Through RoBERTa, the encoding of text and candidate items can be obtained.

[0096] In actual reading comprehension scenarios, the length of the reference text is generally long. RoBERTa follows the setting of BERT. When encoding, each character will perform a self-attention operation with all the characters in the input text, so that the encoded information can capture the contextual information in the entire sequence. This also makes the memory and computing power required for calculation increase quadratically with the length of the sequence, and the computational complexity is as high as O(m 2), where m represents the number of characters in the input text. Therefore, it has an upper limit of 512 characters when encoding word vectors, which means that it cannot process data with a length of more than 512 after the text and candidate items are concatenated.

[0097] To overcome this problem, the present invention adopts Longformer (Longformer: The Long-Document Transformer) which can process long text as the encoding mechanism. Longformer improves the traditional self-attention mechanism. Each character only performs local attention operation (local attention) on other characters near the fixed window size; and combines the specific tasks to calculate the global attention (global attention) for specific character fragments. Specifically, Longformer proposes three new attention modes, namely sliding window mechanism, enlarged sliding window mechanism, and sliding window mechanism integrating global information.

[0098] In the sliding window mechanism, for each character, only its attention with the nearby w characters is calculated, which reduces the computational complexity to O(w×m). Based on the sliding window mechanism, Longformer borrowed the idea of ​​dilated convolution to design an expanded sliding window mechanism. Without increasing the computational load, a gap of size d is inserted between adjacent characters involved in the sliding window, thereby expanding the "field of view" of attention from the context of w to w×d. In addition, in order to serve specific tasks, Longformer introduced global attention, allowing the same global attention calculation as RoBERTa to be performed on a small number of specific characters or fragments. Through the introduction of these specific mechanisms, Longformer has increased the upper limit of the length of the encoded text to 4096, which can basically meet the needs of encoding analysis of long texts.

[0099] In addition, BigBird (Big Bird: Transformers for Longer Sequences) reduces the complexity in BERT to linear by designing and combining random attention, window attention, and global attention, thereby expanding the input limit to 4096.

[0100] At this point, the word vector representations of the reference text and candidate items are available:

[0101] E=(e 1 ,e 2 ,...,e m )∈Rm×d

[0102] Among them, E represents the word vector encoding of the input text sequence, e m Represents the word vector of the mth character in the sequence, R represents the real number space, m represents the text length, and d represents the dimension size.

[0103] After the encoding layer, the reference text vector representation E can be obtained p ∈R x×d , candidate item vector representation Where x represents the length of the reference text, y j Indicates the length of the j-th candidate.

[0104] In order to further capture the association between candidate items and reference texts and enrich the information contained in the candidate item representation, the present invention designs an attention mechanism between text and candidate items:

[0105]

[0106] s=softmax(a) (3)

[0107]

[0108] Among them, tanh represents a nonlinear activation function to achieve nonlinear mapping, W pc represents the learnable weight matrix, b pc represents the bias term, and softmax realizes the normalization of the values ​​in the matrix to [0,1]. Finally, the candidate c is obtained j Attention vector representation of reference text

[0109] Then, the present invention uses mean_pooling to obtain the average vector representation of each candidate, that is:

[0110]

[0111] Here, |·| represents the number of specific objects, and sum represents linear sum. The average vector of candidate items represents C j ∈R d It will be used for information fusion and final probability prediction.

[0112] After obtaining the attention vector representation, the present invention uses a highway network mechanism to achieve information fusion, as follows:

[0113]

[0114]

[0115]

[0116] Among them, W r and W g represents a learnable weight matrix, [;] represents a concatenated input vector, Represents the multiplication of the corresponding position elements of two matrices, relu represents the nonlinear activation function, O j Represents the input vector and the intermediate vector Linear interpolation, G represents the gate threshold to control the proportion of each part in the linear interpolation. is the average vector representation of the reference text.

[0117] Through linear concatenation, the final representation M of the candidate items obtained after the fusion layer can be obtained. j ∈R 2d :

[0118]

[0119] Although the attention fusion mechanism enables RAM to partially master the ability to distinguish key information in candidate items, it can be seen from formula (1) that the problem accounts for a large part of the composition of the candidate items. This may cause the model to smooth the original candidate information too much due to the same components between different candidate items when learning the candidate vector representation, and the final learned representation has a high similarity, which in turn affects the prediction effect.

[0120] Adversarial learning aims to improve the model's ability to identify original samples and adversarial samples. Among them, adversarial examples are samples generated by adding small random perturbations to the original input samples. Adversarial learning was first proposed in image classification. Its purpose is to add perturbations to an image that are difficult for the human eye to distinguish but extremely disruptive to the machine, so as to change the model's prediction of the image category. Unlike image classification, which directly adds perturbations to the original input samples, adversarial perturbations in text classification do not act on natural language text, because discrete symbol input cannot meet the continuity requirements when perturbations are inserted, so they act on continuous word vector representations.

[0121] Therefore, the present invention actively introduces random perturbations during training to increase the data volatility during model training, thereby forcing it to focus on the differences between different candidate representations. In adversarial training, E represents the input, θ represents the parameters of the model, and adversarial training adds the following loss to the loss function of the original classifier:

[0122]

[0123] Among them, r advrepresents the random perturbation of the final input, r represents the random perturbation, ||·|| represents the second norm, ε represents the hyperparameter, and L represents the loss function.

[0124] RAM uses the linear approximation in the non-patent literature Big Bird: Transformers for Longer Sequences to implement the above operation in the neural network. The specific process is as follows:

[0125] r adv = -εg / ||g|| (10)

[0126]

[0127] Among them, g represents the gradient of the loss function L to the input word vector representation E, represents the gradient operation, f represents the model operation, and y represents the sample label.

[0128] After the above process, the model treats each candidate vector as a separate sample and makes a probability judgment on whether it is true or not. Through this operation, RAM achieves unified prediction for different types of questions and different numbers of candidates. Specifically, the model finally uses a binary classifier to make a probability prediction between [0,1] for the candidate vector:

[0129] P = sigmoid(f p (M)) (12)

[0130] Among them, P represents the probability output of the candidate, sigmoid is used to smooth the neural network output to [0,1], and f p Represents a binary classification fully connected prediction network with an output dimension of 1.

[0131] During training, unlike the multi-classification cross entropy loss calculation in traditional models, RAM makes probability predictions for each candidate and calculates the loss value one by one. The operation follows the binary cross entropy loss function (BCE). The mathematical formula is:

[0132]

[0133] Among them, BCE is the binary cross entropy loss function, L p represents the calculated loss value, L represents the set of true labels, k represents the kth candidate, N represents the set of all candidates in the current batch_size, |·| represents the number of specific objects, p represents the predicted probability of the model, and l represents the true label of the sample.

[0134] Similar to the conventional loss value calculation process, the training process of adversarial learning only needs to add random perturbations r to the vector input. adv , the specific operation process is:

[0135] P adv =sigmoid(f p (C+r adv )) (14)

[0136]

[0137] Combining the two, the final loss function of RAM training is:

[0138] L=L p +L adv (16)

[0139] During testing, the prediction result in formula (12) is directly used as the probability prediction of the candidate item, and the candidate item with the largest probability value is selected as the final prediction answer for the same question.

[0140] This section will first introduce the experimental setting details such as the dataset, model, parameters, etc. designed in the experiment. Secondly, the overall effect of RAM is tested on TTQA, and the results of different types of questions and different numbers of candidates are analyzed. Then, an ablation experiment is conducted and a case analysis is given.

[0141] In order to reflect the characteristics of multiple types of questions and an unspecified number of candidate items in real reading comprehension scenarios, the experiment used the TQA text question-answering dataset (hereinafter referred to as TQA, TQA is a multimodal textbook question dataset, containing 13,693 pure text questions and 12,567 picture-text questions; in order to fully evaluate the effectiveness of the model, the present invention uses the pure text question-answering part of TQA as the experimental dataset, referred to as TTQA. Dataset link: https: / / allenai.org / data / tqa), from which only the relevant data involving the text question-answering part was extracted, and the pictures and noise data involved in the text were removed. Finally, 1,073 documents and 13,049 corresponding questions and candidate items were obtained. The specific statistics of the data features are shown in Table 1, where "#" represents the number, "-" represents that there are no samples of this category in the corresponding dataset, and T / F represents judgment questions. According to the original data division of training set / validation set / test set in TQA, TTQA also uses 663 documents for training, 200 documents for validation, and 210 documents for testing. Compared with the traditional MCMRC dataset, TTQA includes two types of questions: true or false questions and multiple choice questions. There are three numbers (2, 4, and 7) of candidate items, and the average length of the text is longer, and the ratio of the average length of the question to the average length of the candidate items is higher.

[0142] Table 1 Statistics of the MCMRC dataset

[0143]

[0144] Since this type of task is proposed for the first time in this invention, it is difficult for existing methods to solve related problems in TTQA with a unified model. Therefore, this invention designs a random selection as a baseline model and conducts experimental analysis on RAM under three different settings.

[0145] ·Random selection (random). Use random functions to randomly generate prediction results for different problems; ·RAM (Bi-LSTM). Use Bi-LSTM to replace the encoding layer in the model, and the rest of the model runs according to the model;

[0146] RAM (BigBird). Use Big Bird as the word vector encoder in the encoding layer, and the rest of the code runs according to the model.

[0147] RAM (Longformer). Longformer is used as the word vector encoder in the encoding layer, and the rest of the model is run.

[0148] The RoBERTa, BigBird and Longformer used in the present invention all adopt the versions encapsulated in the official open source transformers package of huggingface. In Bi-LSTM, BigBird and Longformer, the maximum length of the text is set to 2500. In Bi-LSTM, batch_size=64, hidden_dim=100, and GoLve (Glove: Global Vectors for Word Representation) is used as the initialization word vector. In BigBird and Longformer, batch_size=9, the word vector dimension d=768. In BigBird, the attention block size block_size=64, and the number of random attention blocks num_random_blocks=3. In Longformer, the attention window size is attention_window=256, and the candidate text sequence is selected as the global attention object. The hyperparameter ε in adversarial learning is 1. The model test environment is a 3*Tesla V100 32G video memory server. The experiment uses precision as the evaluation indicator, that is, the proportion of the number of correct questions in all questions.

[0149] Table 2 Overall practical results

[0150]

[0151] Table 2 shows the experimental results, where All is the total result of all questions in TTQA. In general, the results of RAM are not satisfactory. In the best setting (Longformer), 69.56% of the questions are correct, which still has a lot of room for improvement compared to the top students among humans. In addition, it can be seen from the table that the different encoding structures have a great impact on the results. Among them, Bi-LSTM has poor results in long texts because it is difficult to capture the contextual information in long sequences. The reason why Longformer's effect exceeds BigBird by 17.72% may be that the setting of the sliding window expands the boundary of attention, allowing RAM to learn more semantic associations during training; at the same time, setting the candidate as the object of global attention is more conducive to modeling the interaction between the candidate and the reference text. In order to examine the performance of RAM in solving multiple types of problems and different numbers of candidates, the present invention also refines and splits the data set, and conducts experiments on different settings. The specific analysis will be given below.

[0152] TTQA includes true or false questions (T / F), multiple choice questions (MC) and matching questions. Since matching questions also require selecting the correct one from multiple options, the present invention incorporates them into multiple choice questions for unified analysis. The final results are shown in Table 3.

[0153] Table 3 Results of multiple types of questions

[0154]

[0155] In general, the accuracy of true or false questions is higher than that of multiple-choice questions. However, compared with the accuracy of true or false questions in random selection, which is twice that of multiple-choice questions, the gap between the two in RAM is significantly narrowed, which proves that the structure proposed in the present invention is effective in dealing with multiple types of questions. In addition, in addition to the difference in the number of candidate items, another possible reason why the effect of true or false questions is better than that of multiple-choice questions is that the framework of RAM is essentially a structure that converts MCMRC into single-choice true or false judgment. Therefore, it is naturally suitable for solving true or false questions.

[0156] Analysis of different numbers of candidate items: Since there are no double-choice questions in the TTQA multiple-choice questions, the results with 2 options are quoted from the judgment question column, and the results are shown in Table 4.

[0157] Table 4 Results of different numbers of candidates

[0158]

[0159] As can be seen from the table, as the number of candidate items increases, the accuracy of model prediction decreases accordingly. This phenomenon is consistent with the actual situation when humans take reading comprehension tests. The increase in the number of options often means the increase in interference items, which will further affect people's judgment. However, for RAM, the increase in the number of candidate items means that the model has an increased difficulty in learning the differences between the representations of different candidate items. Specifically, the model tends to distinguish the positions of positive and negative samples in the vector space when learning. The length of the candidate items in TTQA (2.6) is shorter than the average length of the question (9.8), which easily leads to excessive overlap of the results generated by equation (1). At this time, the increase in the number of candidate items means an increase in the number of negative samples for training, and the overlap between these negative samples with the same label is high, making their positions in the vector space closer, which will lead to the convergence of the representations of different candidate items, further increasing the difficulty of the model to distinguish key information in different candidate items. The two modules of attention fusion and adversarial learning designed in the present invention solve this problem.

[0160] In order to further analyze the role of each part of RAM in the overall model and its impact on the final results, this section conducts an ablation experiment, taking RAM (Longformer) as the analysis model and adjusting different components in the framework one by one. The final results are shown in Table 5, where Enc represents the encoding layer, Fus represents the fusion layer, and Adv represents adversarial learning. Since Bi-LSTM can be considered as the result of RAM deleting the encoding layer, Bi-LSTM is used as the word vector encoding in w / oEnc to test the results of this item.

[0161] Table 5 Ablation experiment results

[0162]

[0163] The significant drop in performance (27.26%) after deleting the encoding layer is predictable because Bi-LSTM cannot overcome the long-distance dependency problem, that is, there is excessive attention to the newly added text during the transmission process, resulting in the loss of long-distance information during the transmission process. Although it performs information fusion by maintaining a global vector information, some important information will still be lost during the fusion process. RoBERTa greatly alleviates this problem by using the transformer's autoencoder to encode the sequence, and the structural design of sliding window attention and global attention for long texts in Longformer is also very effective.

[0164] The addition of the fusion layer increased the effect by 1.56%, and there was an improvement in the segmentation sets of different numbers of candidate items, proving that the design of this module can help the model overcome the problem of representation convergence caused by the increase in the number of candidate items due to the structure to a certain extent. This phenomenon also shows that although RAM realizes the interaction between the candidate items and the reference text vector representation through the sliding window attention and global attention mechanisms in Longformer, extracting information of different granularities for attention calculation can still improve the model effect.

[0165] Adversarial learning contributed 1.60% increase in effect, which means it is also effective in solving the convergence problem. This may be because random perturbations increase the differences between candidates and enhance the ability of RAM to judge different candidates. Specifically, after candidates with a large number of overlapping parts (problems) enter the model, the addition of random perturbations makes the differences in their position distribution in the vector space greater. Although the model still follows the principle of narrowing the distance when dealing with negative samples during the learning process, because these negative samples contain random perturbations, the model has to pay more attention to the text features with regularity. Therefore, it can learn the key information in different candidates.

[0166] This section gives typical examples of errors in questions with different numbers of candidate items to vividly demonstrate the data characteristics of TTQA and the error judgment of RAM. The results are shown in Table 6.

[0167] Table 6 Case analysis of incorrect prediction results

[0168]

[0169] It is not difficult to see from the table that the judgment questions in TTQA cannot be predicted simply through external knowledge without reference text. For example, "Are angiosperms the most successful plants?" It is necessary to consider factors such as the objects of angiosperm comparison and time limits. The same question may have different answers in different text environments. Therefore, the present invention is committed to enhancing the ability of RAM to capture text information through designs such as encoding layers and fusion layers. In contrast, some of the multiple-choice questions can be answered based on common sense.

[0170] The beneficial effects of the present invention are:

[0171] The shortcomings of the traditional MCMRC task setting were discovered, and a new reading comprehension task with multiple question types and an unspecified number of candidate items was proposed based on real reading comprehension scenarios. Multiple-choice questions were converted into true or false judgments for each candidate item.

[0172] A unified model for solving the above problems is proposed, including a candidate reorganization layer that unifies different types of problems, an encoding layer that realizes the semantic representation of long texts, an attention fusion layer that enriches the candidate information, an adversarial training module that expands the differences in semantic representation, and a prediction layer.

[0173] In order to improve the ability to distinguish different candidates, two mechanisms, fusion layer and adversarial learning, are proposed. Experiments have proved the effectiveness of RAM in solving the above problems through a unified framework, as well as the rationality of the design of different components.

[0174] The word "preferred" as used herein is intended to be used as an example, instance or illustration. Any aspect or design of the present invention described as "preferred" is not necessarily to be construed as being more advantageous than other aspects or designs. On the contrary, the use of the word "preferred" is intended to present concepts in a specific way. The term "or" as used in this application is intended to mean an inclusive "or" rather than an exclusive "or". That is, unless otherwise specified or clear from the context, "X uses A or B" means any one of the naturally included permutations. That is, if X uses A; X uses B; or X uses both A and B, then "X uses A or B" is satisfied in any of the aforementioned examples.

[0175] Moreover, although the present disclosure has been shown and described with respect to one or implementations, those skilled in the art will think of equivalent variations and modifications based on the reading and understanding of this specification and the accompanying drawings. The present disclosure includes all such modifications and variations, and is limited only by the scope of the appended claims. In particular, with respect to the various functions performed by the above-mentioned components (such as elements, etc.), the terms used to describe such components are intended to correspond to any component (unless otherwise indicated) that performs the specified function of the component (such as it is functionally equivalent), even if the structure is not equivalent to the disclosed structure of the function in the exemplary implementation of the present disclosure shown in the present invention. In addition, although the specific features of the present disclosure have been disclosed with respect to only one of several implementations, such features can be combined with one or other features of other implementations that may be desired and advantageous for a given or specific application. Moreover, insofar as the terms "including", "having", "containing" or their variations are used in specific embodiments or claims, such terms are intended to be included in a manner similar to the term "comprising".

[0176] The functional units in the embodiments of the present invention may be integrated into a processing module, or each unit may exist physically separately, or multiple or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc. The above-mentioned devices or systems may execute the storage method in the corresponding method embodiment.

[0177] To sum up, the above embodiment is an implementation mode of the present invention, but the implementation mode of the present invention is not limited by the embodiment. Any other changes, modifications, substitutions, combinations, and simplifications that deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. A unified machine reading comprehension method based on recombinant adversarial learning, characterized in that: The following steps are involved: Get questions with a variety of types and an unspecified number of candidate items; Reorganize questions and candidates to form combined candidates, and judge whether the new candidates are valid or not based on the reference text, and convert the true and false questions, multiple-choice questions and matching questions in actual reading comprehension scenarios into single-choice judgment questions; Co-encode the combined candidate items obtained by the recombination and the reference text to obtain the vector representation of the recombinant candidate items after interaction with the reference text and other recombinant candidate items; Incorporating relevant reference text information into the vector representation of the reorganized candidate items to enrich the information contained in the vector representation of the reorganized candidate items; Treat each candidate vector as a separate sample, make a probability judgment on whether it is true or not, and output the result.

2. The unified machine reading comprehension method based on reorganization confrontation according to claim 1 is characterized in that: The method of converting the true-or-false questions, multiple-choice questions, and matching questions in the actual reading comprehension scenario into single-choice judgment questions includes: Split the candidate items and combine them with the questions one by one to form interrogative sentences; Combine the reference text with the newly generated candidates to transform different types of questions into judgment questions that predict the probability of each new candidate being true with the support of the reference text.

3. The unified machine reading comprehension method based on reorganization confrontation according to claim 1 is characterized in that: The mathematical form of the judgment question is: <P, Q, A> triple, Where P represents the reference text, which is in the form of a sentence, paragraph or whole article; Q represents the question in natural language form, A = {a 1 ,a 2 ,...,a n } represents the set of candidate items corresponding to a specific question, n represents the number of candidate items, among which there is only one correct answer.

4. The unified machine reading comprehension method based on reorganization confrontation according to claim 3 is characterized in that: For any input question, the candidate items are split and concatenated to the question to form new candidate items with the same number as the original candidate items, which can be expressed as: C={c 1 ,c 2 ,...,c n }={Q+a 1 ,Q+a 2 ,...,Q+a n } Among them, C represents the reorganized candidate set; The reference text P is used as background knowledge to combine with the candidate items so that the machine can judge whether the factual statements in the candidate items are true. The specific combination form is as follows: P,c 1 ,c 2 ,...,c n The above formula concatenates all candidate items, considers the information contained in the reference text P, and pays attention to the key information in other candidate items to discover the association relationship between different candidate items.

5. The unified machine reading comprehension method based on reorganization confrontation according to claim 1 is characterized in that: The co-coding of the combined candidate items obtained by the reorganization and the reference text includes: The pre-trained language model RoBERTa is used as a word segmenter to perform word segmentation and vocabulary mapping of the text to obtain the encoding of the text and candidate items. The specific input form is as follows: [CLS]P[SEP]c 1 [SEP]c 2 [SEP]...[SEP]c n [SEP] Where [CLS] represents the special character that marks the starting position of the input text in RoBERTa, [SEP] represents the spacer character between different texts in RoBERTa, and n is the number of texts; Get word vector representations of reference text and candidate items: And=(and 1 ,And 2 ,...,And m )∈R m×d Among them, E represents the word vector encoding of the input text sequence, e m Represents the word vector of the mth character in the sequence, R represents the real number space, m represents the text length, and d represents the dimension size.

6. The unified machine reading comprehension method based on reorganization confrontation according to claim 5 is characterized in that: For data whose length after concatenation of text and candidate items exceeds 512, Longformer's sliding window mechanism, expanded sliding window mechanism, and sliding window mechanism integrating global information are used to expand the input upper limit to 4096; Or use BigBird's random attention, window attention, and global attention methods to reduce the complexity in BERT to linear, thereby expanding the input limit to 4096.

7. The unified machine reading comprehension method based on reorganization confrontation according to claim 1 is characterized in that: The step of integrating the reference text information related to the reorganized candidate item vector representation includes: Design the attention mechanism between text and candidates: s=softmax(a) Among them, tanh represents a nonlinear activation function to achieve nonlinear mapping, W pc represents the learnable weight matrix, E p is the reference text vector representation, is the candidate vector representation, b pc represents the bias term, j is the number of the candidate item, and softmax realizes the normalization of the values ​​in the matrix on [0,1], and finally obtains the candidate item c j Attention vector representation of reference text Use mean_pooling to obtain the average vector representation of each candidate, that is: where |·| represents the number of specific objects, sum represents linear sum, and the candidate average vector represents C j ∈R d Will be used for information fusion and final probability prediction; After obtaining the attention vector representation, the highway network mechanism is used to achieve information fusion, as follows: Among them, W r and W g represents a learnable weight matrix, [;] represents a concatenated input vector, Represents the multiplication of the corresponding position elements of two matrices, relu represents the nonlinear activation function, O j Represents the input vector and the intermediate vector Linear interpolation, G represents the gate threshold to control the proportion of each part in the linear interpolation. is the average vector representation of the reference text; The final representation M of the candidate items obtained after the fusion layer is obtained by linear concatenation j ∈R 2d :

8. The unified machine reading comprehension method based on reorganization confrontation according to claim 1 is characterized in that: The method of treating each candidate item vector as a separate sample and making a probability judgment on whether it is true or not includes: A binary classifier is used to predict the probability of the candidate vector between [0,1]: P=sigmoid(f p (M)) Among them, P represents the probability output of the candidate, sigmoid is used to smooth the output of the neural network to [0,1], and f p Represents a binary classification fully connected prediction network with an output dimension of 1; During training, a probability prediction is made for each candidate and the loss value is calculated one by one. The mathematical formula is: Among them, BCE is the binary cross entropy loss function, L p represents the calculated loss value, L represents the set of true labels, k represents the kth candidate, N represents the set of all candidates in the current batch_size, |·| represents the number of specific objects, p represents the predicted probability of the model, and l represents the true label of the sample.

9. The unified machine reading comprehension method based on reorganization confrontation according to claim 8 is characterized in that: An adversarial learning mechanism is introduced to add random interference to the candidate item vector representation, forcing the model to focus on the regular key semantic distribution and achieve differential representation of the candidate item vectors.

10. The unified machine reading comprehension method based on reorganization confrontation according to claim 9, characterized in that: In the adversarial training, E represents the input, θ represents the parameters of the model, and the adversarial training adds the following loss to the loss function of the binary classifier: Among them, r adv represents the random perturbation of the final input, r represents the random perturbation, ||·|| represents the second norm, ε represents the hyperparameter, and L represents the loss function; The following formula is used to implement the operation of the above formula in the neural network. The specific process is as follows: r adv =-εg / ||g|| g=▽ E L(f θ (E),y) Among them, g represents the gradient of the loss function L to the input word vector representation E, ▽ E represents the gradient operation, f represents the model operation, and y represents the sample label.