Question answer prediction method, prediction device, electronic device, and storage medium
By encoding and attention filtering the pre-trained model in machine reading comprehension technology, text parts related to the question are filtered out, which solves the problem of useless text interference in candidate paragraphs and improves the accuracy of answer prediction.
Patent Information
- Application Number
- CN202210025867.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-11
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-01-11
AI Technical Summary
In existing machine reading comprehension technology, there is a large amount of useless text information in candidate paragraphs, which interferes with the accuracy of answers and leads to inaccurate answer screening.
The original article data and question data are encoded through the preset pre-training model, combined with attention filtering and correlation processing, to filter out the text parts related to the question, determine the confidence and location of the candidate answers, and delete useless text information.
It improves the accuracy of answer prediction, effectively removes useless text information irrelevant to the answer, and enhances the accuracy of answer screening.
Smart Images

Figure CN114416962B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method for predicting answers to questions, a prediction device, an electronic device, and a storage medium. Background Art
[0002] Machine reading comprehension aims to enable a machine to find answers to questions in a given text. This is a basic application scenario in natural language processing. Machine reading comprehension is widely used in question-answering and dialogue systems.
[0003] In the related art, the methods of using pre-trained models to process various natural language questions are relatively similar. The usual practice is to directly input the question and all candidate paragraphs into the model, and then filter out the correct answer interval in all paragraphs or determine that there is no answer. However, for the currently commonly used reading comprehension datasets, for each question, there must be a large amount of useless text information in the candidate paragraphs. If the answer is directly screened for these texts, then the useless text information will inevitably interfere with the accuracy of the correct answer interval, which is not conducive to answer screening. Summary of the invention
[0004] The main purpose of the embodiments of the present disclosure is to propose a method, a prediction device, an electronic device, and a storage medium for predicting answers to questions, which can effectively select the part of the article that is relevant to the question and efficiently delete useless text information, thereby improving the accuracy of answer prediction.
[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present disclosure proposes a method for predicting an answer to a question, comprising:
[0006] Obtaining original topic data to be predicted; wherein the original topic data includes original article data and original question data to be answered;
[0007] Encoding the original article data and the original question data according to a preset first pre-training model to obtain a question encoding vector and an article encoding vector;
[0008] Performing attention screening processing on the question encoding vector and the article encoding vector to obtain multiple candidate texts;
[0009] Associating the original question data with each of the candidate texts to obtain associated data; wherein the associated data includes a question tag vector, a candidate tag vector corresponding to each of the candidate texts, and an associated value; wherein the associated value is used to characterize the association between the original question data and each of the candidate texts;
[0010] Performing answer screening processing on the question tag vector, the multiple candidate texts and each of the candidate tag vectors to obtain a confidence level corresponding to each of the candidate texts; wherein the confidence level is used to characterize the probability that the candidate text contains a candidate answer;
[0011] Determine a candidate position according to the association value, the confidence level and a preset prediction threshold; wherein the candidate position is the position where the candidate answer is located;
[0012] The candidate text is matched with the corresponding candidate position to obtain the candidate answer.
[0013] In some embodiments, the original article data includes a plurality of original texts, the original texts include a plurality of text words, and the original question data includes a plurality of question words;
[0014] The attention screening process is performed on the question encoding vector and the article encoding vector to obtain multiple candidate texts, including:
[0015] Performing an attention operation on the question encoding vector and the article encoding vector according to a preset first attention model to obtain an attention matrix; wherein the attention matrix includes a plurality of attention values, each of the attention values being used to represent the importance of each of the text words to the question word;
[0016] Obtaining a preset first attention threshold;
[0017] The original text is screened according to the first attention threshold and the attention matrix to obtain a plurality of candidate texts.
[0018] In some embodiments, the screening process of the original text according to the first attention threshold and the attention matrix to obtain a plurality of candidate texts includes:
[0019] Calculate the attention value of the same text word to the original question data according to the attention matrix to obtain a corresponding text attention value; wherein the text attention value is used to characterize the importance of the text word to the original question data;
[0020] If the text attention value is greater than the first attention threshold, the original text corresponding to the text word is obtained to obtain the corresponding candidate text.
[0021] In some embodiments, the associating the original question data with each of the candidate texts to obtain associated data includes:
[0022] Inputting the original question data and each of the candidate texts into a preset second pre-training model; wherein the second pre-training model includes a first neural network and a second neural network;
[0023] Performing classification and labeling processing on the original question data and each of the candidate texts through the first neural network to obtain a question labeling vector and a candidate labeling vector for each of the candidate texts;
[0024] The second neural network performs mapping and classification processing on the question tag vector and each of the candidate tag vectors to obtain corresponding association values.
[0025] In some embodiments, the second neural network includes a fully connected layer and an activation classification layer;
[0026] The mapping and classification processing of the question tag vector and each of the candidate tag vectors by the second neural network to obtain corresponding association values includes:
[0027] Performing full connection processing on the question tag vector and each of the candidate tag vectors through the full connection layer to obtain corresponding full connection values;
[0028] The fully connected value is activated and classified by the activation classification layer to obtain a corresponding association value.
[0029] In some embodiments, the answer screening process is performed on the question tag vector, the plurality of candidate texts, and each of the candidate tag vectors to obtain the confidence level corresponding to each of the candidate texts, including:
[0030] Performing attention screening processing on the question tag vector and each of the candidate tag vectors through a preset second attention model to obtain multiple texts to be detected;
[0031] Obtaining a vector to be detected corresponding to the text to be detected according to the text to be detected and the candidate tag vector;
[0032] The text to be detected and the vector to be detected are screened and predicted by a preset answer prediction model to obtain the confidence level corresponding to the text to be detected.
[0033] In some embodiments, the answer prediction model includes a first fully connected multi-head network and a second fully connected multi-head network;
[0034] The method of performing screening and prediction processing on the text to be detected and the vector to be detected by using a preset answer prediction model to obtain the confidence level corresponding to the text to be detected includes:
[0035] Performing a starting prediction process on the text to be detected and the vector to be detected by the first fully connected multi-head network to obtain a starting prediction position of the text to be detected and a starting mark position of the vector to be detected;
[0036] Performing end prediction processing on the text to be detected and the vector to be detected by the second fully connected multi-head network to obtain the end prediction position of the text to be detected and the end mark position of the vector to be detected;
[0037] The confidence level corresponding to the text to be detected is obtained according to the start prediction position, the start mark position, the end prediction position and the end mark position.
[0038] To achieve the above objectives, some embodiments of the present application further provide a device for predicting answers to questions, including:
[0039] An acquisition module, used to acquire original topic data to be predicted; the original topic data includes original article data and original question data to be answered;
[0040] An encoding module, used for encoding the original article data and the original question data according to a preset first pre-training model to obtain a question encoding vector and an article encoding vector;
[0041] An attention screening module, used for performing attention screening processing on the question encoding vector and the article encoding vector to obtain multiple candidate texts;
[0042] An association module, configured to perform association processing on the original question data and each of the candidate texts to obtain association data; wherein the association data includes a question tag vector, a candidate tag vector corresponding to each of the candidate texts, and an association value; wherein the association value is used to characterize the association between the original question data and each of the candidate texts;
[0043] An answer screening module is used to perform answer screening processing on the question tag vector, the multiple candidate texts and each of the candidate tag vectors to obtain a confidence level corresponding to each of the candidate texts; wherein the confidence level is used to represent the probability that the candidate text contains a candidate answer;
[0044] A processing module, configured to determine a candidate position according to the association value, the confidence level and a preset prediction threshold; wherein the candidate position is a position where the candidate answer is located;
[0045] A matching module is used to match the corresponding candidate text according to the candidate position to obtain the candidate answer.
[0046] To achieve the above objectives, some embodiments of the present application further provide an electronic device, including:
[0047] at least one memory;
[0048] at least one processor;
[0049] at least one program;
[0050] The program is stored in the memory, and the processor executes at least one program to implement:
[0051] As described in the embodiment of the first aspect.
[0052] To achieve the above objectives, some embodiments of the present application further provide a storage medium, wherein the storage medium is a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, wherein the computer-executable instructions are used to enable a computer to execute:
[0053] As described in the embodiment of the first aspect.
[0054] The prediction method, prediction device, electronic device, and storage medium of the answer to the question proposed in the embodiment of the present application encode the original article data and the original question data in the original question data through a preset first pre-training model to obtain a question encoding vector and an article encoding vector, and then perform attention screening on the question encoding vector and the article encoding vector to screen out multiple candidate texts, and then perform association processing on the original question data and each candidate text to obtain an association value used to characterize the association between the original question data and each candidate text, a question tag vector corresponding to the original question data, and a candidate tag vector corresponding to the candidate text; then perform answer screening on the question tag vector, the candidate text, and the candidate tag vector to obtain a confidence value used to characterize the probability that each candidate text contains a candidate answer, and finally determine the candidate position according to the association value, confidence, and preset prediction threshold, thereby determining the candidate answer. Through the attention screening mechanism, association processing, and answer screening processing, useless text information that has nothing to do with the answer can be deleted, and the part of the article related to the question can be effectively selected, thereby improving the accuracy of the predicted answer. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 is a flow chart of a method for predicting answers to questions provided in an embodiment of the present application;
[0056] Figure 2 yes Figure 1 Flow chart of the specific method of step S300;
[0057] Figure 3 yes Figure 2 Flow chart of the specific method of step S330;
[0058] Figure 4 yes Figure 1 Flow chart of the specific method of step S400;
[0059] Figure 5 yes Figure 4 Flow chart of the specific method of step S430;
[0060] Figure 6 yes Figure 1 Flow chart of the specific method of step S500;
[0061] Figure 7 yes Figure 6 Flow chart of the specific method of step S530;
[0062] Figure 8 It is a module block diagram of a device for predicting answers to questions provided in an embodiment of the present application;
[0063] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0065] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0066] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0067] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0068] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0069] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0070] First, some nouns involved in this application are analyzed:
[0071] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0072] Natural language processing (NLP): NLP uses computers to process, understand and apply human languages (such as Chinese, English, etc.). NLP is a branch of artificial intelligence and an interdisciplinary subject between computer science and linguistics. It is often referred to as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and text comprehension. Natural language processing is often used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information retrieval, information extraction and filtering, text classification and clustering, public opinion analysis and opinion mining. It involves data mining related to language processing, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computing.
[0073] Medical cloud: Medical cloud refers to the use of cloud computing to create a medical and health service cloud platform based on new technologies such as cloud computing, mobile technology, multimedia, 4G communication, big data, and the Internet of Things, combined with medical technology, to achieve the sharing of medical resources and the expansion of medical scope. Because of the application of cloud computing technology, medical cloud improves the efficiency of medical institutions and facilitates residents to seek medical treatment. For example, hospital appointment registration, electronic medical records, medical insurance, etc. are all products of the combination of cloud computing and the medical field. Medical cloud also has the advantages of data security, information sharing, dynamic expansion, and overall layout.
[0074] BERT (Bidirectional Encoder Representation from Transformers) model: The BERT model further increases the generalization ability of the word vector model, fully describes the characteristics of character level, word level, sentence level and even inter-sentence relationship, and is built based on Transformer. There are three types of embeddings in BERT, namely Token Embedding, Segment Embedding, and Position Embedding; Token Embeddings is a word vector, and the first word is the CLS mark, which can be used for subsequent classification tasks; Segment Embeddings is used to distinguish between two sentences, because pre-training not only does LM but also does classification tasks with two sentences as input; Position Embeddings, the position word vector here is not the trigonometric function in Transfor, but is learned by BERT through training. However, BERT directly trains a Position Embeddings to retain the position information, randomly initializes a vector for each position, adds model training, and finally obtains an embedding containing position information. Finally, in terms of the combination of Position Embeddings and word embedding, BERT chooses to directly splice.
[0075] CLS layer (classification): The CLS layer is part of the BERT model and is used for downstream classification tasks. It is mainly used for single text classification tasks and sentence pair classification tasks.
[0076] Single text classification task: The BERT model inserts a [CLS] symbol before the text and uses the output vector corresponding to the symbol as the semantic representation of the entire text for text classification. It can be understood that compared with other words in the text, this symbol without obvious semantic information will more "fairly" integrate the semantic information of each word in the text.
[0077] Sentence pair classification task: The actual application scenarios of sentence pair classification tasks include: question answering (determining whether a question matches an answer), sentence matching (whether two sentences express the same meaning), etc. For sentence pair classification tasks, in addition to adding the [CLS] symbol and using the corresponding output as the semantic representation of the text, the BERT model also uses a [SEP] symbol to segment the two input sentences, and adds two different text vectors to the two sentences after segmentation for distinction.
[0078] Sigmod function: The sigmod function is a common S-shaped function in biology, also known as the S-shaped growth curve. In information science, due to its monotonic and inverse monotonic properties, it is often used as an activation function for neural networks. The sigmod function is also called the Logistic function, which is used for the output of hidden neural units and has a value range of (0,1). It can map a real number to the interval (0,1) and can be used for binary classification. It works better when the feature differences are complex or not very large.
[0079] Softmax function: The Softmax function is a normalized exponential function that can "compress" a K-dimensional vector z containing any real number into another K-dimensional real vector so that the range of each element is between (0,1) and the sum of all elements is 1. This function is often used in multi-classification problems.
[0080] Attention mechanism: Attention mechanism is the attention mechanism. In layman's terms, the Attention mechanism focuses on important points and ignores other unimportant factors. Attention is divided into spatial attention and temporal attention. The former is used for image processing and the latter is used for natural language processing. The Attention mechanism in this application is the temporal attention mechanism for natural language processing. The principle of Attention is to calculate the degree of match between the current input sequence and the output vector. The higher the degree of match, the higher the relative score of the focus point. The matching weight calculated by Attention is limited to the current sequence pair.
[0081] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0082] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0083] Machine Reading Comprehension (MRC): Machine reading comprehension (MRC) is a task that tests how well a machine understands natural language by asking it to answer questions based on a given context. It has the potential to revolutionize the way humans and machines interact. MRC is widely used in question-answering and dialogue systems.
[0084] In the related art, the methods of using pre-trained models to process various natural language questions are relatively similar. The usual practice is to directly input the question and all candidate paragraphs into the model, and then filter out the correct answer interval in all paragraphs or determine that there is no answer. However, for the currently commonly used reading comprehension datasets, for each question, there must be a large amount of useless text information in the candidate paragraphs. If the answer is directly screened for these texts, then the useless text information will inevitably interfere with the accuracy of the correct answer interval, which is not conducive to answer screening.
[0085] Based on this, the embodiments of the present application propose a method, a prediction device, an electronic device, and a storage medium for predicting answers to questions, which can effectively select the parts of the article that are relevant to the question and efficiently delete useless text information, thereby improving the accuracy of the predicted answers.
[0086] The method for predicting answers to questions, the prediction device, the electronic device, and the storage medium provided in the embodiments of the present disclosure are specifically described through the following embodiments. First, the method for predicting answers to questions in the embodiments of the present disclosure is described.
[0087] The method for predicting answers to questions provided in the embodiments of the present application relates to the field of artificial intelligence technology. The method for predicting answers to questions provided in the embodiments of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, or a smart watch, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or can be configured to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN) and cloud servers that provide basic cloud computing services such as big data and artificial intelligence platforms; the software can be an application that implements an activity classification model training method, etc., but is not limited to the above forms.
[0088] The disclosed embodiments can be used in numerous general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer computer devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0089] Please refer to Figure 1 , combined with Figure 1 The specific processing process of the method for predicting the answer to the question in the embodiment of the present application is described in detail. Figure 1 As shown, in the first aspect, some embodiments of the present application provide a method for predicting an answer to a question, including step S100, step S200, step S300, step S400, step S500, step S600 and step S700. These seven steps are described in detail below, and it should be understood that the method for predicting an answer to a question includes but is not limited to these seven steps.
[0090] Step S100: Acquire original topic data to be predicted; wherein the original topic data includes original article data and original question data to be answered.
[0091] In step S100, the original topic data may be medical data or other text data. If the original topic data is medical data, the original topic data may be obtained through a medical cloud server or other channels.
[0092] Step S200: Encode the original article data and the original question data according to a preset first pre-training model to obtain a question encoding vector and an article encoding vector.
[0093] In step S200 of some embodiments, the preset first pre-trained model may be a BERT model or other neural network models, and the present application does not impose any specific restrictions on this. Taking the BERT model as an example, the letter Q represents the original question data, and the letter P represents the original article data. The original question data Q and the original article data are input into the BERT model for training, and the hidden state of the last layer of the BERT model is used as the encoding result of the original question data Q and the original article data P to obtain the question encoding vector and the article encoding vector, and the question encoding vector and the article encoding vector are respectively recorded as H Q and H P , thereby realizing the encoding processing of original question data and original article data.
[0094] Step S300: Perform attention screening processing on the question encoding vector and the article encoding vector to obtain multiple candidate texts.
[0095] Step S400: Associating the original question data with each candidate text to obtain associated data; wherein the associated data includes a question tag vector, a candidate tag vector corresponding to each candidate text, and an associated value; wherein the associated value is used to characterize the association between the original question data and each candidate text.
[0096] Step S500: Perform answer screening processing on the question tag vector, multiple candidate texts and each candidate tag vector to obtain the confidence corresponding to each candidate text; wherein the confidence is used to represent the probability that the candidate text contains the candidate answer.
[0097] Step S600: Determine a candidate position according to the correlation value, the confidence level and a preset prediction threshold; wherein the candidate position is the position where the candidate answer is located.
[0098] Step S700: Match the corresponding candidate text according to the candidate position to obtain the candidate answer.
[0099] In step S600 of some embodiments, Score1 represents the association value and Score2 represents the confidence. First, a target score value Score is obtained according to the association value and the confidence. The target score value is determined by formula (1), which is:
[0100] Score=Score1+Score2 (1)
[0101] After obtaining the target score value Score, the candidate position is determined according to the target score value Score and the preset prediction threshold. If the target score value Score is greater than or equal to the preset prediction threshold, the candidate text is considered to be the location of the candidate answer, otherwise, the candidate text is considered to not contain the candidate answer and a null character is output.
[0102] After the candidate position is determined, the candidate text is matched according to the candidate position to obtain the candidate answer corresponding to the original question data.
[0103] The method for predicting the answer to the question of the embodiment of the present application is to encode the original article data and the original question data in the original question data through a preset first pre-training model to obtain a question encoding vector and an article encoding vector, and then perform attention screening on the question encoding vector and the article encoding vector to screen out multiple candidate texts, and then perform association processing on the original question data and each candidate text to obtain an association value for characterizing the association between the original question data and each candidate text, a question tag vector corresponding to the original question data, and a candidate tag vector corresponding to the candidate text; then perform answer screening on the question tag vector, the candidate text, and the candidate tag vector to obtain a confidence for characterizing the probability that each candidate text contains a candidate answer, and finally determine the candidate position according to the association value, confidence, and preset prediction threshold, thereby determining the candidate answer. Through the attention screening mechanism, association processing, and answer screening processing, useless text information that has nothing to do with the answer can be deleted, and the part of the article related to the question can be effectively selected, thereby improving the accuracy of the predicted answer.
[0104] Please refer to Figure 2 In some embodiments, the original article data includes a plurality of original texts, each original text includes a plurality of text words, and the original question data includes a plurality of question words.
[0105] In some embodiments, step S300 includes step S310, step S320 and step S330. Figure 2 These two steps are described in detail, and it should be understood that step S300 includes but is not limited to steps S310 to S330.
[0106] Step S310: Perform an attention operation on the question encoding vector and the article encoding vector according to a preset first attention model to obtain an attention matrix; wherein the attention matrix includes multiple attention values, and each attention value is used to represent the importance of each text word to the question word.
[0107] In step S310 of some embodiments, the original question data and the original article data are encoded through the above step S200 to obtain the question encoding vector H Q and article encoding vector H P After that, the question encoding vector H is quantized by the preset first attention model. Q and article encoding vector H P Part attention operation. Among them, the structure of the first attention model can adopt the matchattention method, and the match attention is shown in formula (2). Formula (2) is as follows:
[0108]
[0109] In formula (2), A represents the calculated attention matrix, SoftMax represents the softmax function, W is the weight matrix, b represents the bias, represents the inner product operation, and e is a unit vector. The problem encoding vector H can be calculated by formula (2): Q and article encoding vector H P The attention matrix.
[0110] It should be noted that the structure of the first attention model can also use the cross attention operation method. Its update formula is similar to the self-attention of the transformer. It also uses the three matrices Q, K, and V to calculate the attention results. The difference is that H is used here. Q To calculate K and V, use H P to calculate Q. However, the final attention result has the same format as matchattention.
[0111] In this embodiment, the dimension of the attention matrix A and H P (H Q ) T The dimension of the attention matrix A is consistent with that of the original question data. The attention matrix A records the attention of each token embedding of the original question data on the original article data. That is, A ij It can represent the importance of the jth text word in the original article data to the ith question word in the original question data, then It can represent the importance of the jth text word in the original article data in the entire original question data.
[0112] Step S320: Obtain a preset first attention threshold.
[0113] Step S330: Screening the original text according to the first attention threshold and the attention matrix to obtain multiple candidate texts.
[0114] In step S330 of some embodiments, due to A i,j It can represent the importance of the jth text word in the original article data to the ith question word in the original question data. Then, the original text can be screened according to the first attention threshold to obtain multiple candidate texts. Here, P A Indicates candidate text.
[0115] Reference Figure 3 In some embodiments, step S330 includes but is not limited to step S331 and step S332. Figure 3 These two steps are described in detail.
[0116] Step S331: Calculate the attention value of the same text word to the original question data according to the attention matrix to obtain the corresponding text attention value; wherein the text attention value is used to characterize the importance of the text word to the original question data.
[0117] Step S332: If the text attention value is greater than the first attention threshold, the original text corresponding to the text word is obtained to obtain the corresponding candidate text.
[0118] In some embodiments, if the text attention value is less than or equal to a preset first attention threshold, it means that the text word is not important enough for the original question data, and it is determined to be useless text information.
[0119] Specifically, in step S310, A i,j It can represent the jth text word in the original article data in the original
[0120] The importance of the i-th question word in the question data, then It can represent the importance of the jth text word in the original article data to the entire original question data. Here, the attention value of the same text word to the original question data is calculated to obtain the corresponding text attention value, i.e. A *j , if A *j If the value is greater than a preset first attention threshold, the original text corresponding to the text word is obtained, and the original text is used as one of the candidate texts in the multiple candidate texts. Repeat this operation to obtain multiple candidate texts.
[0121] Reference Figure 4 In some embodiments, step S400 includes step S410, step S420 and step S430. The following describes these three steps in detail. It should be understood that step S400 includes but is not limited to step S410 to step S430.
[0122] Step S410: inputting the original question data and each candidate text into a preset second pre-training model; wherein the second pre-training model includes a first neural network and a second neural network.
[0123] Step S420: Classify and label the original question data and each candidate text through the first neural network to obtain a question label vector and a candidate label vector for each candidate text.
[0124] Step S430: Mapping and classifying the question tag vector and each candidate tag vector through a second neural network to obtain corresponding association values.
[0125] Specifically, in this embodiment, the second pre-trained model can again adopt the BERT model, but the parameters of the BERT model are different from those of the BERT model of the first pre-trained model. If the BERT model is adopted, the first neural network is the CLS layer of BERT. Q and candidate text P A Input into the BERT model, and obtain the result of the last layer of CLS to obtain the question tag vector and the candidate tag vector. Then input the question tag vector and the candidate tag vector into the second neural network for fine-tuning, mapping and classification processing to obtain the relevance value Score1 corresponding to the candidate text. The relevance value Score1 is between 0 and 1. The larger the score, the greater the probability that the candidate answer is in this candidate text. The relevance value Score1 determines the relevance between the original question data and the candidate text.
[0126] Reference Figure 5 In some embodiments, the second neural network includes a fully connected layer and an activation classification layer.
[0127] Step S430 includes step S431 and step S432. These two steps are described in detail below. It should be understood that step S430 includes but is not limited to step S431 and step S432.
[0128] Step S431: Perform full connection processing on the question tag vector and each candidate tag vector through the fully connected layer to obtain corresponding fully connected values.
[0129] Step S432: Activate and classify the fully connected values through the activation classification layer to obtain corresponding association values.
[0130] Specifically, in this embodiment, the second neural network includes a fully connected layer and an activated classification layer, and the activated classification layer is a sigmoid function. The result of the last layer of CLS of the BERT model is connected to the fully connected network for fine-tuning to obtain a fully connected value, and then the fully connected value is output through a sigmoid function layer to output a judgment score to obtain a correlation value.
[0131] Reference Figure 6 In some embodiments, step S500 includes step S510, step S520 and step S530. It should be understood that step S500 includes but is not limited to these three steps, which are described in detail below.
[0132] Step S510: Perform attention screening processing on the question tag vector and each candidate tag vector through a preset second attention model to obtain multiple texts to be detected.
[0133] Step S520: obtaining a vector to be detected corresponding to the text to be detected according to the text to be detected and the candidate tag vectors.
[0134] Step S530: Screening and predicting the text to be detected and the vector to be detected by using a preset answer prediction model to obtain the confidence level corresponding to the text to be detected.
[0135] Specifically, in this embodiment, the structure of the second attention model may be consistent with or inconsistent with the structure of the aforementioned first attention model. Regardless of whether the structures of the two are consistent, the calculation process of the attention results is similar. The question tag vector and the candidate tag vector are further processed by BERT encoding, and then screened by a layer of attention structure model to obtain multiple texts to be detected. Then, according to the text to be detected, matching processing is performed from the candidate tag vector to obtain the vector to be detected corresponding to the text to be detected. Finally, the vector to be detected and the text to be detected are input into the answer prediction model to obtain the confidence corresponding to the text to be detected.
[0136] Reference Figure 7 In some embodiments, the answer prediction model includes a first fully connected multi-head network and a second fully connected multi-head network. Step S530 includes but is not limited to step S531, step S532 and step S533.
[0137] Step S531: performing a start prediction process on the text to be detected and the vector to be detected through a first fully connected multi-head network to obtain a start prediction position of the text to be detected and a start mark position of the vector to be detected;
[0138] Step S532: Perform end prediction processing on the text to be detected and the vector to be detected through the second fully connected multi-head network to obtain the end prediction position of the text to be detected and the end mark position of the vector to be detected.
[0139] Step S533: Obtain the confidence level corresponding to the text to be detected according to the start prediction position, the start mark position, the end prediction position and the end mark position.
[0140] In this embodiment, the candidate text P AThe corresponding hidden results are input into two fully connected multi-head networks with the same structure but different parameters (the first fully connected multi-head network and the second fully connected multi-head network). These two fully connected multi-head networks are used to predict the starting position and ending position of the candidate answer respectively. The multi-head result for determining the starting position is used i Indicates that the long result of judging the end position is e i The maximum subscripts of the two fully connected multi-head networks are recorded as start and end, then the candidate answer
[0141] Specifically, the first fully connected multi-head network performs a start prediction process on the text to be detected and the vector to be detected to obtain the start prediction position of the text to be detected and the start mark position of the vector to be detected, and the second fully connected multi-head network performs an end prediction process on the text to be detected and the vector to be detected to obtain the end prediction position of the text to be detected and the end mark position of the vector to be detected. start Indicates the starting prediction position, S1 indicates the starting mark position, e end represents the end prediction position, e1 represents the end mark position, then the corresponding confidence Score2 can be expressed by formula (3), which is specifically:
[0142] Score2=(S start -S1)+(e end -e1) (3)
[0143] Score2 has a similar goal to the correlation value Score1, but the starting point is different. Confidence Score2 is used to represent the confidence in the extracted answer. After obtaining Score1 and Score2, the target score Score is obtained based on Score1 and Score2. If the target score Score is greater than the preset prediction threshold, the A obtained above is used. candidate As a candidate answer, if the target score value Score is less than the preset prediction threshold, it means there is no answer and an empty character is output.
[0144] Please refer to Figure 8 On the second aspect, some embodiments of the present application also propose a device 800 for predicting answers to questions, including an acquisition module 810, an encoding module 820, an attention screening module 830, an association module 840, an answer screening module 850, a processing module 860 and a matching module 870.
[0145] The acquisition module 810 is used to acquire the original topic data to be predicted; the original topic data includes the original article data and the original question data to be answered.
[0146] The encoding module 820 is used to encode the original article data and the original question data according to the preset first pre-training model to obtain a question encoding vector and an article encoding vector.
[0147] An attention screening module 830 is used to perform attention screening processing on the question encoding vector and the article encoding vector to obtain multiple candidate texts;
[0148] The association module 840 is used to associate the original question data with each candidate text to obtain associated data; wherein the associated data includes a question tag vector, a candidate tag vector corresponding to each candidate text, and an associated value; wherein the associated value is used to characterize the association between the original question data and each candidate text.
[0149] The answer screening module 850 is used to perform answer screening processing on the question tag vector, multiple candidate texts and each candidate tag vector to obtain the confidence corresponding to each candidate text; wherein the confidence is used to represent the probability that the candidate text contains the candidate answer.
[0150] The processing module 860 is used to determine a candidate position according to the correlation value, the confidence level and a preset prediction threshold; wherein the candidate position is the position where the candidate answer is located.
[0151] The matching module 870 is used to match the corresponding candidate text according to the candidate position to obtain the candidate answer.
[0152] The prediction device 800 of the answer to the question of the embodiment of the present application encodes the original article data and the original question data in the original question data through the preset first pre-training model to obtain the question encoding vector and the article encoding vector, and then performs attention screening on the question encoding vector and the article encoding vector to screen out multiple candidate texts, and then performs association processing on the original question data and each candidate text to obtain the association value used to characterize the association between the original question data and each candidate text, the question tag vector corresponding to the original question data, and the candidate tag vector corresponding to the candidate text; then the question tag vector, the candidate text, and the candidate tag vector are subjected to answer screening processing to obtain the confidence used to characterize the probability that each candidate text contains the candidate answer, and finally the candidate position is determined according to the association value, the confidence, and the preset prediction threshold, thereby determining the candidate answer. Through the attention screening mechanism, association processing, and answer screening processing, useless text information that has nothing to do with the answer can be deleted, and the part of the article related to the question can be effectively selected, thereby improving the accuracy of the predicted answer.
[0153] It should be noted that the device for predicting answers to questions in the embodiment of the present application corresponds to the method for predicting answers to questions described above. For the specific prediction process, please refer to the method for predicting answers to questions described above, which will not be repeated here.
[0154] The present disclosure also provides an electronic device, including:
[0155] at least one memory;
[0156] at least one processor;
[0157] at least one program;
[0158] The program is stored in the memory, and the processor executes at least one program to implement the method for predicting the answer to the question in the present disclosure. The electronic device can be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a car computer, etc.
[0159] Combine the following Fig. 9 The electronic device according to the embodiment of the present application is introduced in detail.
[0160] like Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0161] The processor 910 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present disclosure;
[0162] The memory 920 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 920 can store an operating system and other application programs. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 920, and the processor 910 calls and executes the method for predicting the answer to the question in the embodiment of the present disclosure;
[0163] Input / output interface 930, used to implement information input and output;
[0164] Communication interface 940, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0165] bus 950 , which transmits information between the various components of the device (e.g., processor 910 , memory 920 , input / output interface 930 , and communication interface 940 );
[0166] The processor 910 , the memory 920 , the input / output interface 930 , and the communication interface 940 are connected to each other in communication within the device via a bus 950 .
[0167] The embodiment of the present disclosure also provides a storage medium, which is a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method for predicting the answer to the above question.
[0168] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0169] The embodiments described in the embodiments of the present disclosure are intended to more clearly illustrate the technical solutions of the embodiments of the present disclosure and do not constitute a limitation on the technical solutions provided by the embodiments of the present disclosure. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present disclosure are also applicable to similar technical problems.
[0170] Those skilled in the art will appreciate that the technical solutions shown in the figures do not limit the embodiments of the present disclosure and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0171] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0172] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0173] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0174] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0175] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0176] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0177] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0178] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable an electronic device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store programs.
[0179] The preferred embodiments of the present disclosure are described above with reference to the accompanying drawings, but the scope of the rights of the present disclosure is not limited thereto. Any modification, equivalent substitution and improvement made by those skilled in the art without departing from the scope and essence of the present disclosure should be within the scope of the rights of the present disclosure.
Claims
1. A method for predicting an answer to a question, characterized in that: include: Obtaining original topic data to be predicted; wherein the original topic data includes original article data and original question data to be answered; Encoding the original article data and the original question data according to a preset first pre-training model to obtain a question encoding vector and an article encoding vector; Performing attention screening processing on the question encoding vector and the article encoding vector to obtain multiple candidate texts; Associating the original question data with each of the candidate texts to obtain associated data; wherein the associated data includes a question tag vector, a candidate tag vector corresponding to each of the candidate texts, and an associated value; wherein the associated value is used to characterize the association between the original question data and each of the candidate texts; Performing answer screening processing on the question tag vector, the multiple candidate texts and each of the candidate tag vectors to obtain a confidence level corresponding to each of the candidate texts; wherein the confidence level is used to characterize the probability that the candidate text contains a candidate answer; Determine a candidate position according to the association value, the confidence level and a preset prediction threshold; wherein the candidate position is the position where the candidate answer is located; Matching the corresponding candidate text according to the candidate position to obtain the candidate answer; in: The associating the original question data with each of the candidate texts to obtain associated data includes: The original question data and each candidate text are input into a preset second pre-training model; wherein the second pre-training model includes a first neural network and a second neural network, and the second neural network includes a fully connected layer and an activated classification layer; Performing classification and labeling processing on the original question data and each of the candidate texts through the first neural network to obtain a question labeling vector and a candidate labeling vector for each of the candidate texts; Performing mapping and classification processing on the question tag vector and each of the candidate tag vectors through the second neural network to obtain corresponding association values; The mapping and classification processing of the question tag vector and each of the candidate tag vectors by the second neural network to obtain corresponding association values includes: Performing full connection processing on the question tag vector and each of the candidate tag vectors through the full connection layer to obtain corresponding full connection values; Performing activation classification processing on the fully connected value through the activation classification layer to obtain a corresponding association value; The answer screening process is performed on the question tag vector, the multiple candidate texts and each of the candidate tag vectors to obtain the confidence level corresponding to each of the candidate texts, including: Performing attention screening processing on the question tag vector and each of the candidate tag vectors through a preset second attention model to obtain multiple texts to be detected; Obtaining a vector to be detected corresponding to the text to be detected according to the text to be detected and the candidate tag vector; The text to be detected and the vector to be detected are screened and predicted by a preset answer prediction model to obtain the confidence corresponding to the text to be detected, wherein the answer prediction model includes a first fully connected multi-head network and a second fully connected multi-head network; The method of performing screening and prediction processing on the text to be detected and the vector to be detected by using a preset answer prediction model to obtain the confidence level corresponding to the text to be detected includes: Performing a starting prediction process on the text to be detected and the vector to be detected by the first fully connected multi-head network to obtain a starting prediction position of the text to be detected and a starting mark position of the vector to be detected; Performing end prediction processing on the text to be detected and the vector to be detected by the second fully connected multi-head network to obtain the end prediction position of the text to be detected and the end mark position of the vector to be detected; Obtaining the confidence corresponding to the text to be detected according to the starting prediction position, the starting mark position, the ending prediction position and the ending mark position; The confidence corresponding to the text to be detected obtained according to the starting prediction position, the starting mark position, the ending prediction position and the ending mark position is expressed by the following formula: Score2=(S start -S1)+(e end -e1), The Score2 represents the confidence level; The S start represents the starting predicted position; Said S1 represents said starting mark position; The end represents the predicted end position; The e1 indicates the end mark position.
2. The method according to claim 1, characterized in that The original article data includes a plurality of original texts, the original texts include a plurality of text words, and the original question data includes a plurality of question words; The attention screening process is performed on the question encoding vector and the article encoding vector to obtain multiple candidate texts, including: Performing an attention operation on the question encoding vector and the article encoding vector according to a preset first attention model to obtain an attention matrix; wherein the attention matrix includes a plurality of attention values, each of the attention values being used to represent the importance of each of the text words to the question word; Obtaining a preset first attention threshold; The original text is screened according to the first attention threshold and the attention matrix to obtain a plurality of candidate texts.
3. The method according to claim 2, characterized in that The screening process of the original text according to the first attention threshold and the attention matrix to obtain a plurality of candidate texts includes: Calculate the attention value of the same text word to the original question data according to the attention matrix to obtain a corresponding text attention value; wherein the text attention value is used to characterize the importance of the text word to the original question data; If the text attention value is greater than the first attention threshold, the original text corresponding to the text word is obtained to obtain the corresponding candidate text.
4. A device for predicting answers to questions, characterized in that: include: An acquisition module is used to obtain the original topic data to be predicted; The original topic data includes original article data and original question data to be answered; An encoding module, used for encoding the original article data and the original question data according to a preset first pre-training model to obtain a question encoding vector and an article encoding vector; An attention screening module, used for performing attention screening processing on the question encoding vector and the article encoding vector to obtain multiple candidate texts; An association module, used for performing association processing on the original question data and each of the candidate texts to obtain associated data; The associated data includes a question tag vector, a candidate tag vector corresponding to each candidate text, and an associated value; wherein the associated value is used to characterize the association between the original question data and each candidate text; An answer screening module is used to perform answer screening processing on the question tag vector, the multiple candidate texts and each of the candidate tag vectors to obtain a confidence level corresponding to each of the candidate texts; wherein the confidence level is used to represent the probability that the candidate text contains a candidate answer; A processing module, configured to determine a candidate position according to the association value, the confidence level and a preset prediction threshold; wherein the candidate position is a position where the candidate answer is located; A matching module, used for matching corresponding candidate texts according to the candidate positions to obtain the candidate answers; in: The associating the original question data with each of the candidate texts to obtain associated data includes: The original question data and each candidate text are input into a preset second pre-training model; wherein the second pre-training model includes a first neural network and a second neural network, and the second neural network includes a fully connected layer and an activated classification layer; Performing classification and labeling processing on the original question data and each of the candidate texts through the first neural network to obtain a question labeling vector and a candidate labeling vector for each of the candidate texts; Performing mapping and classification processing on the question tag vector and each of the candidate tag vectors through the second neural network to obtain corresponding association values; The mapping and classification processing of the question tag vector and each of the candidate tag vectors by the second neural network to obtain corresponding association values includes: Performing full connection processing on the question tag vector and each of the candidate tag vectors through the full connection layer to obtain corresponding full connection values; Performing activation classification processing on the fully connected value through the activation classification layer to obtain a corresponding association value; The answer screening process is performed on the question tag vector, the multiple candidate texts and each of the candidate tag vectors to obtain the confidence level corresponding to each of the candidate texts, including: Performing attention screening processing on the question tag vector and each of the candidate tag vectors through a preset second attention model to obtain multiple texts to be detected; Obtaining a vector to be detected corresponding to the text to be detected according to the text to be detected and the candidate tag vector; The text to be detected and the vector to be detected are screened and predicted by a preset answer prediction model to obtain the confidence corresponding to the text to be detected, wherein the answer prediction model includes a first fully connected multi-head network and a second fully connected multi-head network; The method of performing screening and prediction processing on the text to be detected and the vector to be detected by using a preset answer prediction model to obtain the confidence level corresponding to the text to be detected includes: Performing a starting prediction process on the text to be detected and the vector to be detected by the first fully connected multi-head network to obtain a starting prediction position of the text to be detected and a starting mark position of the vector to be detected; Performing end prediction processing on the text to be detected and the vector to be detected by the second fully connected multi-head network to obtain the end prediction position of the text to be detected and the end mark position of the vector to be detected; Obtaining the confidence corresponding to the text to be detected according to the starting prediction position, the starting mark position, the ending prediction position and the ending mark position; The confidence corresponding to the text to be detected obtained according to the starting prediction position, the starting mark position, the ending prediction position and the ending mark position is expressed by the following formula: Score2=(S start -S1)+(e end -e1), The Score2 represents the confidence level; The S start represents the starting predicted position; Said S1 represents said starting mark position; The end represents the predicted end position; The e1 indicates the end mark position.
5. An electronic device, characterized in that: include: at least one memory; at least one processor; at least one program; The program is stored in the memory, and the processor executes the at least one program to implement: the method according to any one of claims 1 to 3.
6. A storage medium, the storage medium being a computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute: the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Machine reading understanding method and device, equipment and storage medium
CN111027327A
Implementation method and device of machine reading understanding system based on retrieval
CN112445887A
Extraction type intelligent question-answering method and system introducing agricultural domain knowledge
CN112527999A
