Reading task processing method and related equipment
A technology for reading tasks and processing methods, which is applied in the field of reading task processing methods and related equipment, and can solve the problems that the model cannot learn semantic analysis capabilities, the accuracy of answer results is low, and the time and depth information of historical dialogue information is lost.
Pending Publication Date: 2020-12-29
TENCENT TECH (SHENZHEN) CO LTD
0 Cites 0 Cited by
AI-Extracted Technical Summary
Problems solved by technology
Among them, the splicing method is based on the pre-trained language model, using the self-attention mechanism of the model to simultaneously model the relationship between question information and reading information, question information and historical dialogue information; but because the model has a maximum input sequence Due to the limitation of length, when the content of reading information is large or the number of rounds of historical dialogue information is large, it is impossible to consider all the dialogue history, which limits the performance of the model and makes the answer results predicted by the model based on question information less accurate.
The history encoding method is based on the HAE (History Answer Embedding) principle. This method loses the t...
Method used
In one embodiment, the order of rounds of sample dialog information is related to the accuracy of the trained reading task processing model based on question prediction answer results, and the correlation between each round of sample dialog information can be reflected in the accurate prediction of the model ability to respond to results. Optionally, on the basis of the original round order of the sample dialogue information, randomly sort the sample dialogue information of each round to generate sample dialogue information with other sorting orders, and then train the model to improve Model semantic analysis capabilities.
[0106] In the embodiment of the present application, the forgetting control unit may be configured as a forget gate (forget gate), the input control unit may be configured as an input gate (input gate), and the output control unit may be configured as an output gate (output gate), by Using the forgetting control unit, input control unit, and output control unit to configure the recurrent neural network, you can learn which historical information is discarded in each round of dialogue and focus on the reading information when encoding the historical dialogue information into the reading information. Which parts of the configuration make the model very interpretable.
[0113] In the embodiment of the present application, the trained reading task processing model combines the respective advantages of the cyclic neural network and the attention mechanism, and can model infinite rounds of dialogue scenarios. During the modeling process, the model simultaneously models the relationship between target question information and reading information, target question information and historical dialogue information, that is, when using the attention mechanism to model the relationship between target question information and reading information, at the same time Histo...
Abstract
The invention relates to the technical field of artificial intelligence, and provides a reading task processing method and related equipment, and the reading task processing method comprises the steps: obtaining reading information, target problem information associated with the reading information, and historical dialogue information; executing an iterative processing step until the historical dialogue information of all rounds is processed, and taking the current moment information representation of the reading information determined based on the historical dialogue information of the last round as the first information representation of the historical dialogue information in the reading information; determining a second information representation of the target problem information in thereading information based on the first information representation; and determining reply information for replying to the target question information in the reading information based on the second information representation. The embodiment of the invention is beneficial to improving the accuracy of predicting the reply result based on the target question information.
Application Domain
Digital data information retrievalSemantic analysis +2
Technology Topic
Information representationEngineering +2
Image
Examples
- Experimental program(1)
Example Embodiment
[0062]The embodiments of the present application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements with the same or similar functions. The embodiments described below with reference to the drawings are exemplary, and are only used to explain the present application, and cannot be construed as limiting the present application.
[0063]Those skilled in the art can understand that, unless specifically stated otherwise, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the wording "including" used in the specification of this application refers to the presence of features, integers, steps, operations, elements and/or components, but does not exclude the presence or addition of one or more other features, integers, Steps, operations, elements, components and/or their groups. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element, or intervening elements may also be present. In addition, “connected” or “coupled” used herein may include wireless connection or wireless coupling. The term "and/or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0064]In order to make the purpose, technical solutions, and advantages of the present application clearer, the following further describes the embodiments of the present application in detail with reference to the accompanying drawings.
[0065]Artificial Intelligence (AI) is 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. In other words, artificial intelligence is a comprehensive technology of computer science, which attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that the machines have the functions of perception, reasoning and decision-making.
[0066]Artificial intelligence technology is a comprehensive discipline, covering a wide range of fields, including both hardware-level technology and software-level technology. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation/interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning/deep learning.
[0067]The technical solutions provided by the embodiments of the present application involve technologies such as natural language processing of artificial intelligence. Natural language processing (NLP) is an important direction in the field of computer science and artificial intelligence. It studies various theories and methods that enable effective communication between humans and computers in natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, which is the language people use daily, so it is closely related to linguistic research. Natural language processing technologies usually include text processing, semantic understanding, machine translation, robot question answering, knowledge graphs and other technologies. The embodiments of the present application mainly relate to technologies such as query understanding and answer extraction in robot question answering.
[0068]With the research and progress of artificial intelligence technology, artificial intelligence technology has been researched and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, autonomous driving, drones , Robotics, intelligent medical care, intelligent customer service, etc., I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play more and more important values.
[0069]The technical solution of the present application and how the technical solution of the present application solves the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the drawings.
[0070]The reading task processing method provided by the embodiment of this application can be executed by the electronic device provided by the embodiment of this application. Specifically, the electronic device can be a client or a server. The client can be a smart phone, a tablet, or a laptop. , Desktop computers, smart speakers, smart watches, etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or it can provide cloud services, cloud databases, cloud computing, and cloud functions , Cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms, but it is not limited to this. Such asfigure 1 As shown, the reading task processing method provided by the embodiment of the present application includes the following steps S101-S104:
[0071]S101: Obtain reading information, target question information associated with the reading information, and at least one round of historical dialogue information.
[0072]Specifically, the reading information can be a piece, a paragraph, or a sentence of text information for machine reading. When the reading information is a type of text information, the device can directly process the text information; the reading information can also be a type of multimedia information. The multimedia information can be identified to obtain features, and then processed based on the identified features; the embodiment of the present application does not limit it here.
[0073]Optionally, in an application scenario, when the target question information to be answered that is associated with the reading information is obtained, all historical dialogues associated with the reading information are obtained before the answer information of the target question information is determined based on the reading information Information is processed. For example, for reading information A, the target question information a is currently received, and before the target question information a is received, 3 rounds of historical dialogues have been conducted on the reading information A, then before the answer information corresponding to the target question information a is determined, obtain The historical dialogue information corresponding to the three rounds of historical dialogue is processed respectively.
[0074]S102: Perform iterative processing steps until the processing of all rounds of historical dialogue information is completed, and the current time information of the reading information determined based on the last round of historical dialogue information is expressed as the first in the reading information of at least one round of historical dialogue information. An information representation; the iterative processing steps include S1021-S1022:
[0075]S1021: Acquire the current round of historical dialogue information according to the time sequence of the historical dialogue information.
[0076]S1022: The last time information based on the historical dialogue information of the current round and the reading information indicates the current time information indicating the reading information.
[0077]Specifically, assuming that before receiving the target question information, 3 rounds of historical dialogues were conducted based on the reading information, based on the chronological order of the historical dialogues (17:08 on September 1, 2020-historical dialogue information 1; September 1, 2020 Day 17:39-historical dialogue information 2; September 3, 2020 09:03-historical dialogue information 3), first obtain historical dialogue information 1 combined with reading information C to determine the information representation of reading information C1; then obtain historical dialogue 2 combination The information of the reading information means that C1 confirms that the information of the reading information means C2; and the acquisition of historical dialogue information 3 combines the information of reading information means that C2 means that the information of reading information means C3, and the information of reading information means C3 as all historical dialogue information in Read the first information representation in the information C.
[0078]Optionally, step S1021 obtains the historical dialogue information of the current round according to the time sequence of the historical dialogue information, which is beneficial to learn the time and depth information of the historical dialogue information when the historical dialogue information is encoded into the reading information, and clarify each round of the historical dialogue The distance between the information and the current round of historical dialogue information.
[0079]Among them, each round of historical dialogue information includes historical question information and historical reply information associated with the historical question information. In a feasible embodiment, the process of conducting a round of historical dialogue includes: receiving historical question information A, and finding historical reply information a in the reading information based on the historical question information A.
[0080]Optionally, the first information represents an information expression in which the reading information combined with the historical dialogue information is in the latest state after the historical dialogue information is encoded into the reading information.
[0081]S103: Determine the second information representation of the target question information in the reading information based on the first information representation.
[0082]Optionally, the second information indicates the relationship between the target question information and the reading information, and the target question information and the historical dialogue information. Specifically, when determining the second information representation, not only the relationship between the target question information and the reading information, but also the relationship between the target question information and the historical dialogue information is considered, and the relationship between the three is interactive.
[0083]S104: Based on the second information, it means that the answer information used to answer the target question information is determined in the reading information.
[0084]Optionally, based on the second information means determining corresponding content in the reading information, such as determining the starting position and ending position of the content, and then extracting response information from the reading information as feedback information for the target question information.
[0085]In one embodiment, a reading task processing model is used to execute the steps of the reading task processing method, such asfigure 2 As shown, the reading task processing model includes a reading information update module, which includes a cyclic neural network cascaded based on historical dialogue information; the cascaded cyclic neural network determines the first information representation and the second information representation.
[0086]Among them, the reading information update module includes one or more cascaded cyclic neural networks (reflected as cyclic units in the overall structure of the model). When the cyclic neural network is used to determine the first information representation, the number of times the cyclic neural network runs is The total number of rounds of historical dialogue information corresponds.
[0087]In an embodiment, the historical dialogue information includes historical question information and corresponding historical reply information; the reading task processing module also includes a word embedding module. Using a cascaded recurrent neural network to determine the first information representation includes the following steps A1-A2:
[0088]Step A1: According to the historical dialogue information of the current round, the historical question information is processed through the word embedding module to determine the third information representation of the historical question information; the recurrent neural network set up through the cascade is based on the last moment information representation of the reading information And the third information indicates that the current time of the reading information is determined.
[0089]Step A2: Determine the current time information representation of the determined reading information based on the third information representation of the historical question information in the last round of historical dialogue information and the last time information representation of the reading information as the first information representation.
[0090]Example: Suppose the current reading information is B, and the historical dialogue information includes 3 rounds.
[0091]For the first round of historical dialogue information: first use the word embedding module of the reading task processing model to process the historical question information in the first round of historical dialogue information, determine the third information representation of the historical question information and input it into the recurrent neural network, At this time, the cyclic neural network performs the first run, and models the relationship between the first round of historical question information and the reading information, and outputs the current time information representation of the reading information after encoding the first round of historical dialogue information.
[0092]For the second round of historical dialogue information: first use the word embedding module of the reading task processing model to process the historical question information in the second round of historical dialogue information, determine the third information representation of the historical question information and input it into the recurrent neural network, At this time, the cyclic neural network performs the second run, and models the relationship between the second round of historical question information and the reading information (in this case, the reading information is represented by the information in the first round), and the output of the second round of historical dialogue information Read the current time information after encoding.
[0093]For the third round of historical dialogue information: first use the word embedding module of the reading task processing model to process the historical question information in the third round of historical dialogue information, determine the third information representation of the historical question information and input it into the recurrent neural network, At this time, the cyclic neural network performs the third run, and models the relationship between the third round of historical question information and the reading information (in this case, the reading information is represented by the information in the second round), and the output of the third round of historical dialogue information Read the current time information after encoding. The third round of historical dialogue information is the last round of historical dialogue information, and the current time information representation of the reading information output at this time can be determined as the first information representation.
[0094]After encoding the 3 rounds of historical dialogue information, the first information representation of the historical dialogue information in the reading information can be obtained at this time.
[0095]The use of a cascaded recurrent neural network to determine the second information representation includes the following steps A3:
[0096]Step A3: Process the target question information through the word embedding module to determine the target information representation of the target question information; use the cyclic neural network to determine the second information representation of the target question information in the reading information based on the first information representation and the target information representation.
[0097]Specifically, the word embedding module is first used to process the target question information, and the target information representation of the target question information is determined, and then the cyclic neural network is used to determine the target question information based on the target information representation and the first information representation obtained in step A2. The second information in the information indicates.
[0098]Optionally, after determining the first information representation, the target question information is input into the reading task processing model. At this time, the word embedding module in the reading task processing model will be used to process the target question information to determine the target information of the target question information. Representation; and then the target information of the target question information and the historical dialogue information. The first information in the reading information represents the input cyclic neural network, and then the second information representation of the target question information in the reading information is determined (constructing the target question information and reading The relationship between information, target problem information and historical dialogue information).
[0099]In the embodiment of the present application, the word embedding module is used to convert text input (historical question information or target question information) into a dense low-dimensional vector form; specifically, the word embedding module may be composed of a trained BERT model.
[0100]In one embodiment, the recurrent neural network (each cascaded recurrent unit) includes a forgetting control unit, an input control unit, an output control unit, and a modeling unit configured by an attention mechanism.
[0101]Optionally, the modeling unit is used to model the relationship between the question information and the last moment information representation of the reading information based on the attention mechanism; the last moment information representation of the reading information includes the last moment information state and hidden information of the reading information. status.
[0102]In the embodiments of this application, the modeling unit can be configured using the QANet model; the attention mechanism can be understood as focusing on important factors while ignoring other unimportant factors; among them, the importance of each factor is judged Depending on the application scenario, in different application scenarios, attention can be divided into spatial attention and temporal attention. In the embodiments of this application, when the reading task processing method is applied to image processing (reading information is image information), attention can be spatial attention; when the reading task processing method is applied to natural language processing (reading information is text) Information), attention can be time attention.
[0103]The forgetting control unit is used to extract the content indicated by the current moment information used to calculate the reading information from the last moment information expression of the reading information.
[0104]The input control unit is used for extracting the content represented by the current time information used to calculate the reading information from the information currently input to the cyclic neural network.
[0105]The output control unit is used to extract the hidden state content used to calculate the output of the cyclic neural network from the information state at the current moment of reading the information.
[0106]In the embodiment of the present application, the forgetting control unit can be configured as a forget gate, the input control unit can be configured as an input gate, and the output control unit can be configured as an output gate. The unit, input control unit, and output control unit are equipped with a cyclic neural network, which can understand which historical information is discarded in each round of dialogue when the historical dialogue information is encoded into the reading information, and which parts of the reading information are focused on , This configuration makes the model very interpretable.
[0107]In a feasible embodiment, the modeling unit can also be configured with a self-attention mechanism (Self-attentionMechanism). The self-attention mechanism is an optimization of the attention mechanism, and different mechanisms can be selected according to actual application scenarios. Setting the modeling unit is not limited in this application.
[0108]Optionally, the reading task processing model further includes a reply information prediction module. When determining the representation of each round of historical dialogue information in the reading information, the reply information prediction module can also be used to predict the predicted reply information corresponding to each round of historical question information , Further adjust the cyclic neural network by predicting the reply information and the related data of the historical reply information, and then adjust the information expression of the reading information at the current moment, and improve the accuracy of the first information expression of the historical dialogue information in the reading information.
[0109]In an embodiment, step S104 indicates that the answer information used to answer the target question information is determined in the reading information based on the second information, and includes the following steps S1041-S1042:
[0110]Step S1041: The second information is processed by the answer information prediction module, and the start position information and the end position information of the answer information used to answer the target question information are determined in the reading information.
[0111]Step S1042: Obtain response information based on the start position information and the end position information.
[0112]Optionally, the response information prediction module (which can be understood as the prediction layer of the reading task processing model, predictionlayer) is configured as a pointer networdk, and by processing the second information, it can be determined to be used to answer the target question in the reading information The start position information and end position information of the reply information of the message; when the reply information is obtained based on the start position information and the end position information, the content corresponding to the position information can be directly used as the reply information, or after the corresponding content is extracted, the content After normalization, semantic expression adjustment, etc., the response information is finally determined. Normalization can be understood as performing text regularization processing on the extracted content, etc. (Considering that the reply information may be used for voice dialogue, if the text regularization processing on the extracted content is beneficial to improve user experience).
[0113]In the embodiment of the present application, the trained reading task processing model combines the respective advantages of the cyclic neural network and the attention mechanism, and can model an infinite round of dialogue scenarios. In the modeling process, the model also models the relationship between the target problem information and the reading information, the target problem information and the historical dialogue information, that is, when the attention mechanism is used to model the relationship between the target problem information and the reading information, at the same time Consider historical dialogue information. In addition, this application performs synchronous processing when modeling the relationship between the question information and the reading information, and the question information and the historical dialogue information, which helps to reduce noise and improve the performance of the model when the two relationships are interacted.
[0114]In combination with the description of the reading task processing method in the foregoing embodiment, the following describes the steps of the method for training the reading task processing model that executes the method steps.
[0115]In one embodiment, the content represented by the first information representation, the second information representation, and the third information representation in the reading task processing method is the same as the content represented in the embodiment of the training method step of the reading task processing model.
[0116]In the embodiment of the present application, the reading information update module includes a cyclic neural network set based on the cascade of sample dialogue information. Specifically, the sample dialogue information used to train the reading task processing model includes at least one round. When the reading information update module is configured , The cyclic neural network is set up in rounds based on the sample dialogue information. If the sample dialogue information currently used for training the model includes n rounds, the cyclic neural network set in cascade includes n cyclic units; the cyclic neural network set in cascade The data transmission process of the network can be understood as the data output by the cyclic neural network at the previous moment as the input data of the cyclic neural network at the current moment (combinedfigure 2 It can be understood that the data output by the previous cycle unit is used as the input data of the next cycle unit). Specifically, the reading task processing model is designed as the LST (LSTM-Styled Transformer) Framework model. The overall structure of the model is as followsfigure 2 Shown; where the reading information update module of the reading task processing model includes a cascaded cyclic neural network (LST cyclic unit).
[0117]Such asFigure 4 As shown, the training method of the embodiment of the present application includes the following steps S401-S402:
[0118]S401: Obtain sample information; the sample information includes sample reading information and at least one round of sample dialogue information.
[0119]Optionally, the sample reading information refers to the reading information used to train the reading task processing model, which may be a piece, a paragraph, or a sentence of text information used for machine reading. The sample reading information can be a kind of text information, and the device can process the text information directly; the sample reading information can also be a picture format information, and the device can recognize the picture to obtain the text information, and then process it based on the recognized text information ; The embodiments of this application are not limited here.
[0120]Optionally, the sample dialog information refers to the dialog information used to train the reading task processing model. It can be text information composed of a paragraph or a sentence of dialog (or text information obtained based on voice information conversion. This application does not Make a limit). The sample dialogue information includes sample question information and sample response information of the historical dialogues, such as sample response information found in the sample reading information based on the sample question information. Specifically, the sample dialogue information is associated with the sample reading information, and may also be sample dialogue information set based on the sample reading information.
[0121]In one embodiment, the round sequence of the sample dialogue information is related to the accuracy of the trained reading task processing model to predict the answer result based on the question, and the correlation between each round of sample dialogue information can be reflected in the model's accurate prediction of the answer result Ability. Optionally, based on the original round order of the sample dialogue information, random ordering of the sample dialogue information of each round can be considered to generate sample dialogue information with other sorting orders, and then the model can be trained to improve Model semantic analysis capabilities.
[0122]In the embodiments of this application, there is no need to limit the size of the content of the sample reading information. Short text information or long text information can be used as the sample reading information; and the sample information can include multiple rounds of sample dialogue information without limitation. The number of rounds of sample dialogue messages.
[0123]S402: Training the reading task processing model based on the sample information until the total loss function of the reading task processing model converges.
[0124]Optionally, when using sample information to train the reading task processing model, a loss function is used to measure the degree of convergence of the model. For example, the loss value is compared with a preset threshold to measure the degree of convergence of the currently trained model.
[0125]Among them, during training, the previous moment information of the sample dialogue information and the sample reading information is input to the current loop neural network to obtain the current moment information of the sample reading information; the current moment information of the sample reading information is expressed as the next The input of the recurrent neural network at all times. For example, in the process of model training, the second round of sample dialogue information is currently used to train the model. At this time, the sample reading information is obtained synchronously. The last moment information after the first round of sample dialogue information training indicates that C1 input current The cyclic neural network of the time, the current time information of the sample reading information is expressed as C2, and the current time information of the sample reading information is expressed as C2 as the input of the cyclic neural network at the next time; among them, the current time information of the sample reading information is expressed as C2 Learned the content of the sample dialogue information in the first and second rounds. Among them, the information representation of the sample reading information can be understood as including the semantics expressed in the sample reading information after the sample dialogue information is encoded into the sample reading information; the information representation of the sample reading information can be expressed in the form of a matrix or a vector .
[0126]The foregoing embodiment describes the overall training method, and the following describes the structure of the recurrent neural network constituting the reading information update module in the model. The cyclic neural network set in each cascade is embodied as a cyclic unit in the overall structure of the model. In one embodiment, such asimage 3 As shown, each cycle unit is configured with a modeling unit, a forgetting control unit, an input control unit, and an output control unit. Optionally, the setting of each loop unit is a logical setting, which can be understood as a total loop neural network. When the total number of rounds of the sample dialogue information is n, the loop neural network is run n times, and each run corresponds to A state that represents the model's understanding of the sample reading information (such as the result of semantic analysis) on the basis of combining the sample dialogue information at the i-th time. Specifically, the recurrent neural network is used to update the information representation of the sample reading information.
[0127]Among them, the modeling unit is used to model the relationship between the sample question information and the last moment information representation of the sample reading information; the last moment information of the sample reading information indicates the last moment information state and the hidden state including the sample reading information.
[0128]Optionally, the modeling unit is a single-round reading comprehension module configured with an attention mechanism, which is mainly used to model the relationship between the sample question information in the current sample dialogue information and the previous moment information representation of the sample reading information. That is, the relationship between the modeling sample question information and the information representation of the current sample reading information. Optionally, the QANet model (question and answer network) is used to configure the modeling unit. Among them, the information of the sample reading information indicates the information state and the hidden state including the sample reading information. In the modeling unit, the information state Ct-1 and the hidden state Ht-1 at the previous time of the sample reading information are used as input data, and the information state Ct and the hidden state Ht after the current time update are output.
[0129]The forgetting control unit is used to extract the content indicated by the current moment information used to calculate the sample reading information from the last moment information expression of the sample reading information.
[0130]Optionally, the forget control unit is configured as a forget gate, which determines how much content of the information state Ct-1 at the previous time of the sample read information is stored in the information state Ct at the current time.
[0131]The input control unit is used to extract the content represented by the current time information used to calculate the sample reading information from the information currently input to the cyclic neural network.
[0132]Optionally, the input control unit is configured as an input gate, which determines how much of the input (sample question information related content, It-1) obtained by the cyclic neural network at the current moment is stored in the current moment information state of the sample reading information Ct.
[0133]The output control unit is used to extract the hidden state content used to calculate the output of the cyclic neural network from the current information state of the sample reading information.
[0134]Optionally, the output control unit is configured as an output gate, which determines how much content in the current information state Ct of the sample reading information is output to the current output value (hidden state, Ht) of the cyclic neural network.
[0135]Optionally, the forgetting control unit, the input control unit and the output control unit are oriented to the tensor sequence. Combineimage 3 It can be seen that the hidden state output by the cyclic neural network is controlled by the output control unit, and the output hidden state will be input to the response information prediction module to predict the start and end positions of the response information in the sample reading information.
[0136]In the embodiment of this application, through the three control units in the recurrent neural network, it is possible to clearly understand which sample dialogue information is discarded by the reading task processing model when training with each round of sample dialogue information, focusing on the sample reading information Which information in the reading task processing model has good interpretability.
[0137]In the foregoing embodiment, the composition of the recurrent neural network is described. The following describes the content of calculating the loss function after each round of sample dialogue information is processed on the model.
[0138]In an embodiment, the sample dialogue information includes sample question information and sample response information; for example,figure 2 As shown, the reading task processing model also includes a response information prediction module; the total loss function includes the loss function loss when each round of sample dialogue information is used for training.
[0139]During training, when the hidden state output by the current recurrent neural network is obtained, the answer information prediction module determines the predicted answer information corresponding to the sample question information according to the hidden state.
[0140]Based on the predicted response information and the corresponding sample response information, a loss function is calculated.
[0141]Optionally, the sample question information included in the sample dialogue information is the basis for extracting predictive response information from the sample reading information, and the sample response information is the response information extracted from the sample reading information based on the sample question information when the machine performs the reading task. . In a feasible embodiment, the sample dialogue information may be dialogue information occurring in a real scene, or dialogue information set based on the sample reading information. For example: the sample reading information is "I am 30 years old, why should I wrong myself"; the sample question information is "how old is the protagonist in the story"; the sample reply information is "30 years old".
[0142]Among them, after each round of sample dialogue information training, the recurrent neural network will output the hidden state at the current moment, and the hidden state will be input to the reply information prediction module for reply information prediction processing. Specifically, the reply information prediction module may be a pointer network, where the sample reading information predicts the start position and the end position of the reply information, and then extracts the predicted reply information according to the start position and the end position.
[0143]Optionally, after the recurrent neural network is trained with each round of sample dialogue information, the loss function loss is calculated from the predicted response information and sample response information output by the current model. Specifically, the loss value obtained from each round of sample dialogue information training can be used as a separate data to measure the degree of convergence of the model, or the loss value obtained from each round of sample dialogue information training can be weighted to determine the total loss value and then to measure the model’s performance Degree of convergence.
[0144]In one embodiment, such asFigure 5 As shown, the reading task processing model also includes a word embedding module. Optionally, the word embedding module can be composed of a pre-trained BERT model (language model), which can be used to analyze sample reading information and/or sample problem information, and obtain better word vectors as the initial parameters of the model (such asFigure 5 Doc can be understood as sample reading information. After the sample reading information is input into the pre-trained BERT model, the initial information of the sample reading information is obtained as C0; Qn can be understood as sample problem information, and the sample problem information is input into the pre-trained BERT model After that, the third information of the sample question information indicates In). Such asFigure 5 As shown, during training, inputting the last moment information of the sample reading information indicating the sample question information in the sample dialogue information into the current cyclic neural network includes the following steps S501-S502:
[0145]S501: Input the sample question information in the sample dialogue information into the word embedding module to obtain the third information representation of the sample question information.
[0146]Optionally, the third information representation may include a word vector obtained by processing the sample question information by the word embedding module, which may be used as an initial parameter of the reading task processing model. Before inputting the sample problem information into the cyclic neural network for processing, the sample problem information is input into the pre-trained BERT model for processing, which is conducive to improving the model's ability to understand sample problem information and learning efficiency.
[0147]S502: Input the third information and the last time information of the sample reading information to the recurrent neural network at the current time.
[0148]Specifically, such asFigure 5 As shown, the last time information representation (information state Cn-1 and hidden state Hn-1) of the third information indicating In and the sample reading information is input into the current cyclic neural network.
[0149]Compared with the prior art, the reading task processing model provided by the embodiment of this application includes a reading information update module, and the reading information update module includes a cyclic neural network based on the cascade setting of sample dialogue information; on this basis, the model provided by this application The training method includes acquiring sample information, and training the reading task model based on the sample information until the total loss function of the reading task processing model converges; wherein the sample information includes sample reading information and at least one round of sample dialogue information; during training, the sample The last time information of the reading information indicates that the dialogue information with the sample is input into the current time cyclic neural network to obtain the current time information representation of the sample reading information; and the current time information representation of the sample reading information is used as the input of the next time cyclic neural network . In the implementation of this application, the reading information update module in the reading task processing model is configured to include a cyclic neural network set based on the sample dialogue information cascade, and the sample dialogue information and the previous moment information of the sample reading information are expressed as the current moment cycle The input data of the neural network, and the current time information of the sample reading information output by the cyclic neural network at the current time is expressed as the input data of the cyclic neural network at the next time; the configuration of the model can be built for unlimited historical dialogue information mold. In practical applications, the trained model can encode all historical dialogue information during modeling, which is beneficial to improve the accuracy of the reading task processing model in predicting the answer based on the question information.
[0150]The foregoing embodiment describes the training method of the reading task processing model, and the following is directed to the application of the reading task processing model trained based on this method
[0151]In an embodiment, considering that the reading task processing method provided above can be applied to customer service robots, voice assistants, education, entertainment, reading and other software, the following adaptation provides a feasible application example to help better understanding The methods provided in the embodiments of this application, such asFigure 6 As shown, the method can be applied to the client 601 or the server 602.
[0152]Assuming that the above method is applied to a customer service robot, the customer service robot reads and understands product documents through the machine, and makes corresponding answers to user questions. Suppose that for product A, user Q asks the customer service robot to ask question X. At this time, the customer service robot finds that before user Q asks for product A, the customer service robot for product A has had 13 rounds of historical conversations with other users (related content of historical conversations) It can be stored on the server or on the client; in one embodiment, there are more total rounds of historical dialogue, and there is no need to limit the number of total rounds), the customer service robot will obtain the content of the 13 rounds of historical dialogue based on The question X input by the user uses the reading task processing method provided in the foregoing embodiment to determine the current reply information to the question X. Among them, the customer service robot can directly use the above-mentioned method on the client 601 to predict the reply information, and give feedback to the user (voice broadcast or text display); the customer service robot can also send the question X entered by the user Q to the service At the end 602, the server 602 combines question X, related documents for product A, and 13 rounds of historical dialogue to determine the corresponding reply information and send it to the client 601, and then feedback to the user.
[0153]In one embodiment, such asFigure 7 As shown, a reading task processing device 700 is provided, including: an information acquisition module 701, a first determination module 702, a second determination module 703, and a reply determination module 704.
[0154]The obtaining information module 701 is used to obtain reading information, target question information associated with the reading information, and at least one round of historical dialogue information.
[0155]The first determining module 702 is configured to determine the first information representation of at least one round of historical dialogue information in the reading information.
[0156]The second determining module 703 is configured to perform the iterative processing steps until the processing of all rounds of historical dialogue information is completed, and represent the current time information of the reading information determined based on the last round of historical dialogue information as at least one round of historical dialogue information The first information in the reading information indicates that the iterative processing steps include: obtaining the current round of historical dialogue information according to the time sequence of the historical dialogue information; based on the current round of historical dialogue information and the last moment of the reading information, it indicates that the reading is determined The current time of the message is indicated by the message.
[0157]The answer determination module 704 is configured to determine answer information used to answer the target question information in the reading information based on the second information.
[0158]Optionally, a reading task processing model is used to execute the steps performed by the reading task processing device, the reading task processing model includes a reading information update module, and the reading information update module includes a cyclic neural network based on historical dialogue information cascade setting; cascade setting is adopted The recurrent neural network determines the first information representation and the second information representation.
[0159]Optionally, the reading task processing model further includes a word embedding module; the historical dialogue information includes historical question information; the first determining module 702 includes:
[0160]The iterative unit is used to process the historical question information through the word embedding module to determine the third information representation of the historical question information according to the historical dialogue information of the current round; the recurrent neural network set up by cascade is based on the last moment of the reading information The information representation and the third information representation determine the current moment of reading the information representation.
[0161]The first determining unit is configured to determine the current time information representation of the determined reading information based on the third information representation of the historical question information in the last round of historical dialogue information and the last time information representation of the reading information as the first information representation.
[0162]The second determining module 703 includes: a second determining unit for processing the target question information through the word embedding module to determine the target information representation of the target question information; determining the target based on the first information representation and the target information representation through the recurrent neural network The question information is indicated by the second information in the reading information.
[0163]Optionally, the cyclic neural network includes a forgetting control unit, an input control unit, an output control unit, and a modeling unit set up with an attention mechanism; the modeling unit is used to model question information and the last moment of reading information based on the attention mechanism The relationship between the information representation; the last moment information of the reading information indicates the last moment information state and the hidden state including the reading information; the forgetting control unit is used to extract the information used to calculate the reading information from the last moment information representation of the reading information The content represented by the current time information; the input control unit is used to extract the content represented by the current time information used to calculate the reading information from the information currently input to the cyclic neural network; the output control unit is used to extract the current time information state of the reading information Used to calculate the hidden state content of the output of the recurrent neural network.
[0164]Optionally, the reading task processing model further includes a response information prediction module, and the response determination module 704 includes: a response determination unit for processing the second information through the response information prediction module, and determining information for answering the target question in the reading information The start position information and the end position information of the reply information; the obtaining unit is used to obtain the reply information based on the start position information and the end position information.
[0165]Optionally, the device further includes a training unit for executing the steps of the method for training the reading task processing model, including a sample acquisition unit and a training unit.
[0166]The sample obtaining unit is used to obtain sample information; the sample information includes sample reading information and at least one round of sample dialogue information.
[0167]The training unit is used to train the reading task processing model based on the sample information until the total loss function of the reading task processing model converges.
[0168]Among them, the training unit is also used to input the previous moment information of the sample dialogue information and the sample reading information into the current moment of the recurrent neural network during training, and obtain the current moment information of the sample reading information; The information is represented as input to the recurrent neural network at the next moment.
[0169]Optionally, the cyclic neural network is configured with a forgetting control unit, an input control unit, an output control unit, and a modeling unit set up with an attention mechanism; wherein the modeling unit is used to model sample question information and sample reading based on the attention mechanism The last moment information of the information indicates the relationship between the information; the last moment information of the sample reading information indicates the last moment information state and the hidden state including the sample reading information; the forgetting control unit is used to indicate the last moment information of the sample reading information Extract the content represented by the current time information used to calculate the sample reading information; the input control unit is used to extract the content represented by the current time information used to calculate the sample reading information from the information currently input to the cyclic neural network; the output control unit is used to Extract the content used to calculate the hidden state output by the recurrent neural network from the current information state of the sample reading information.
[0170]Optionally, the sample dialog information includes sample question information and sample response information; the reading task processing model also includes a response information prediction module; the total loss function includes the loss function when each round of sample dialog information is used for training; the training unit is also used During training, when the hidden state output by the current recurrent neural network is obtained, the answer information prediction module determines the predicted answer information corresponding to the sample question information according to the hidden state; based on the predicted answer information and the corresponding sample answer information, the loss function is calculated.
[0171]Optionally, the reading task processing model further includes a word embedding module; the training unit includes: a first input subunit for inputting sample question information in the sample dialogue information into the word embedding module to obtain the third information representation of the sample question information ; The second input subunit is used to input the last time information of the third information and the sample reading information to the current time cyclic neural network.
[0172]The reading task processing device of the embodiment of the application can execute a reading task processing method provided by the embodiment of the application, and its implementation principle is similar. The reading task processing device in each embodiment of the application executes The actions correspond to the steps in the reading task processing method in each embodiment of the present application. For the detailed function description of each module of the reading task processing device, please refer to the description in the corresponding reading task processing method shown in the preceding text. , I won’t repeat it here.
[0173]In an optional embodiment, an electronic device is provided, such asFigure 8As shown,Figure 8The illustrated electronic device 800 includes a processor 801 and a memory 803. Wherein, the processor 801 and the memory 803 are connected, such as through a bus 802. Optionally, the electronic device 800 may further include a transceiver 804. It should be noted that in actual applications, the transceiver 804 is not limited to one, and the structure of the electronic device 800 does not constitute a limitation to the embodiment of the present application.
[0174]The processor 801 may be a CPU (Central Processing Unit, central processing unit), a general-purpose processor, a DSP (Digital Signal Processor, data signal processor), an ASIC (Application Specific Integrated Circuit, application specific integrated circuit), an FPGA (Field Programmable Gate Array, Field programmable gate array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logical blocks, modules and circuits described in conjunction with the disclosure of this application. The processor 801 may also be a combination that implements computing functions, for example, including a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on.
[0175]The bus 802 may include a path for transferring information between the aforementioned components. The bus 802 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus or the like. The bus 802 can be divided into an address bus, a data bus, a control bus, and so on. For ease of presentation,Figure 8It is represented by only a thick line, but it does not mean that there is only one bus or one type of bus.
[0176]The memory 803 may be a ROM (Read Only Memory, read only memory) or other types of static storage devices that can store static information and instructions, RAM (Random Access Memory, random access memory) or other types of information and instructions that can be stored The dynamic storage device can also be EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory, CD-ROM) or other optical disk storage, optical disk storage (including compressed optical discs, Laser discs, optical discs, digital universal discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer Medium, but not limited to this.
[0177]The memory 803 is used to store application program codes for executing the solutions of the present application, and the processor 801 controls the execution. The processor 801 is configured to execute the application program code stored in the memory 803 to realize the content shown in the foregoing method embodiment.
[0178]Among them, electronic devices include but are not limited to: mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PAD (tablet computers), PMP (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc. Mobile terminals such as digital TVs, desktop computers, etc.Figure 8The electronic device shown is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present application.
[0179]According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the reading task processing model training method or reading task processing provided in the various optional implementations above method.
[0180]The embodiments of the present application provide a computer-readable storage medium with a computer program stored on the computer-readable storage medium, and when it runs on a computer, the computer can execute the corresponding content in the foregoing method embodiment. Compared with the prior art, the implementation of the method of the present application can firstly encode unlimited rounds of historical dialogue information into the reading information by executing iterative processing steps; secondly, each round of historical dialogue can be encoded one by one based on the time sequence of the historical dialogue information. Information coding enters the reading information, which is helpful for learning the time and depth information of the historical dialogue information; furthermore, after determining the first information representation of the historical dialogue information in the reading information, determine the target question information in the reading information based on the first information representation The second information representation allows the machine to consider the expression of historical dialogue information in the reading information while analyzing the semantic expression of the target problem information in the reading information, that is, to consider the history while determining the second information representation of the target problem information in the reading information Dialogue information helps improve the accuracy of predicting the answer based on the target question information.
[0181]It should be understood that, although the various steps in the flowchart of the drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless explicitly stated in this article, the execution of these steps is not strictly limited in order, and they can be executed in other orders. Moreover, at least part of the steps in the flowchart of the drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the order of execution is also It is not necessarily performed sequentially, but may be performed alternately or alternately with other steps or at least a part of sub-steps or stages of other steps.
[0182]It should be noted that the above-mentioned computer-readable medium in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In this application, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device. In this application, the computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium. The computer-readable signal medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device . The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wire, optical cable, RF (Radio Frequency), etc., or any suitable combination of the above.
[0183]The above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist alone without being assembled into the electronic device.
[0184]The foregoing computer-readable medium carries one or more programs, and when the foregoing one or more programs are executed by the electronic device, the electronic device is caused to execute the method shown in the foregoing embodiment.
[0185]The computer program code used to perform the operations of this application can be written in one or more programming languages or a combination thereof. The above-mentioned programming languages include object-oriented programming languages-such as Java, Smalltalk, C++, and also conventional Procedural programming language-such as "C" language or similar programming language. The program code can be executed entirely on the user's computer, partly on the user's computer, executed as an independent software package, partly on the user's computer and partly executed on a remote computer, or entirely executed on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to pass Internet connection).
[0186]The flowcharts and block diagrams in the drawings illustrate the possible implementation of the system architecture, functions, and operations of the system, method, and computer program product according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram can represent a module, program segment, or part of code, and the module, program segment, or part of code contains one or more for realizing the specified logical function Executable instructions. It should also be noted that, in some alternative implementations, the functions marked in the block may also occur in a different order from the order marked in the drawings. For example, two blocks shown one after the other may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations Or it can be realized by a combination of dedicated hardware and computer instructions.
[0187]The modules involved in the embodiments described in the present application can be implemented in software or hardware. Among them, the name of the module does not constitute a limitation on the module itself under certain circumstances. For example, the acquiring information module can also be described as "used to acquire reading information, target problem information associated with reading information, and at least one round Module for historical dialogue information".
[0188]The above description is only a preferred embodiment of the present application and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in this application is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover the above technical features or technical solutions without departing from the above disclosed concept. Other technical solutions formed by any combination of its equivalent features. For example, the above-mentioned features and the technical features disclosed in this application (but not limited to) with similar functions are mutually replaced to form a technical solution.
PUM


Description & Claims & Application Information
We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.