CN110210021A - Read understanding method and device - Google Patents

Read understanding method and device Download PDF

Info

Publication number
CN110210021A
CN110210021A CN201910429805.0A CN201910429805A CN110210021A CN 110210021 A CN110210021 A CN 110210021A CN 201910429805 A CN201910429805 A CN 201910429805A CN 110210021 A CN110210021 A CN 110210021A
Authority
CN
China
Prior art keywords
answer
text
sample
reading
training
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910429805.0A
Other languages
Chinese (zh)
Other versions
CN110210021B (en
Inventor
李弘宇
刘璟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910429805.0A priority Critical patent/CN110210021B/en
Publication of CN110210021A publication Critical patent/CN110210021A/en
Application granted granted Critical
Publication of CN110210021B publication Critical patent/CN110210021B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Electrically Operated Instructional Devices (AREA)
  • Machine Translation (AREA)

Abstract

The present invention proposes a kind of reading understanding method and device, wherein this method comprises: by obtaining preset target problem and text to be read;Understand that model carries out understanding analysis to the text to be read according to preset reading, generates the answer type probability, answer text and corresponding confidence level of the target problem;Target answer corresponding with the target problem is determined according to the answer type probability, the answer text and corresponding confidence level.To understand that model better understands out the long answer text or short answer text of high quality to target problem and text to be read based on preset reading, all different practical situations can show good, it is only good to a kind of understanding effect of the answer of answer type to be no longer limited to existing special purpose model, and improve the understanding effect of the answer to different answer types compared to existing universal model.

Description

Read understanding method and device
Technical field
The present invention relates to artificial intelligence field more particularly to a kind of reading understanding methods and device.
Background technique
Artificial intelligence (Artificial Intelligence, AI) is research, develops for simulating, extending and extending people Intelligence theory, method, a new technological sciences of technology and application system.Artificial intelligence is one of computer science Branch, it attempts to understand the essence of intelligence, and produces a kind of new intelligence that can be made a response in such a way that human intelligence is similar Energy machine, the research in the field include robot, language identification, image recognition, natural language processing, question answering system and expert system System etc..
Currently, will be to be answered the problem of and relevant reading material, which are input to the reading that training finishes, understands that model carries out people The intellectual reading of work understands more and more extensive.Existing reading understands that model point mainly has special purpose model and universal model:
Special purpose model is to be obtained using the reading material training of same answer type, but special purpose model is limited in that Can only a kind of understanding effect to answer type it is relatively good.The long answer obtained for example, by using the sample of the long answer type of magnanimity Model, the short answer model obtained using the sample training of the short answer type of magnanimity, due to long answer model and short answer mould Type has different model parameter and training data, and long answer model is relatively good to the understanding effect of long answer, and to short answer Understanding effect it is bad, short answer model can only be relatively good to the understanding effect of short answer, and not to the understanding effect of long answer It is good.
Universal model is obtained despite the sample joint training using different answer types, but the structure ginseng of universal model There is no the answers for different answer types to be respectively set for number, but shares a set of model parameter, causes to long answer Understanding effect be less than long answer model, short answer model, the reading effect of model are less than to the understanding effect of short answer It is bad.
Therefore, how preferably to carry out reading and understand as technical problem urgently to be resolved.
Summary of the invention
The present invention is directed to solve at least some of the technical problems in related technologies.
For this purpose, the first purpose of this invention is to propose a kind of reading understanding method.
Second object of the present invention is to propose that a kind of reading understands device.
Third object of the present invention is to propose a kind of computer equipment.
Fourth object of the present invention is to propose a kind of computer readable storage medium.
In order to achieve the above object, first aspect present invention embodiment proposes a kind of reading understanding method, comprising:
Obtain preset target problem and text to be read;
Understand that model carries out understanding analysis to the text to be read according to preset reading, generates the target problem Answer type probability, answer text and corresponding confidence level;
According to the determination of the answer type probability, the answer text and corresponding confidence level and the target problem pair The target answer answered.
In one possible implementation, it is described according to the answer text type probability, the answer text and Corresponding confidence level determines that target answer corresponding with the target problem includes:
It obtains the first product of the confidence level of long answer type probability and long answer text, short answer type probability and short answers Second product of the confidence level of case text;Judge whether first product is greater than second product;
If so, the long answer text is determined as target answer corresponding with the target problem;
If it is not, the short answer text is then determined as target answer corresponding with the target problem.
In one possible implementation, before the preset target problem of the acquisition and text to be read, also Include:
Obtain first sample set, wherein the first sample that the first sample is concentrated includes training problem and reading material Sample, starting position and end position of the correct option in reading material sample of long answer type, for characterizing described The answer type of one sample is the labeled data of long answer;
Obtain the second sample set, wherein the second sample in second sample set includes training problem and reading material Sample, starting position and end position of the correct option in reading material sample of short answer type, for characterizing described The answer type of two samples is the labeled data of short answer;
Model is understood based on the initial reading of the first sample set and second sample set training, is obtained described default Reading understand model.
In one possible implementation, the initial reading understands that model includes at least encoder, the first prediction Layer, the second prediction interval, classifier, the reading initial based on the first sample set and second sample set training understand Model obtains the preset reading and understands that model includes:
By the first sample and second sample stated in the second sample set point that the first sample is concentrated It is not input in the encoder and is encoded;
Using first sample training first prediction interval after each coding, and using described after each coding After the first sample set and each coding after trained second prediction interval of second sample set and each coding of use The second sample set training classifier understands model to obtain the preset reading;
Wherein, the first prediction interval that training finishes can be predicted to need the problem of answering corresponding long answer text and its be set Reliability, the second prediction interval that training finishes can be predicted to need the problem of answering corresponding short answer text and its confidence level, be instructed The classifier that white silk finishes, which can differentiate, needs the problem of answering corresponding answer type probability.
In one possible implementation, after the preset target problem of the acquisition and text to be read, also Include:
The target problem and the text to be read are spliced, wherein in splicing, in the target The separator that characterization problems are added before problem, point of addition characterization paragraph before the paragraph of the text to be read Every symbol.
Reading understanding method provided in an embodiment of the present invention, by obtaining preset target problem and text to be read; Understand that model carries out understanding analysis to the text to be read according to preset reading, generates the answer class of the target problem Type probability, answer text and corresponding confidence level;According to the answer type probability, the answer text and corresponding set Reliability determines target answer corresponding with the target problem.To based on it is preset reading understand model to target problem and to Long answer text or short answer text that text better understands out high quality are read, all different practical situations can show good It is good, it is only good to a kind of understanding effect of the answer of answer type and logical compared to existing to be no longer limited to existing special purpose model The understanding effect of the answer to different answer types is improved with model.
In order to achieve the above object, second aspect of the present invention embodiment, which proposes a kind of read, understands device, comprising:
Module is obtained, for obtaining preset target problem and text to be read;
Generation module, it is raw for understanding that model carries out understanding analysis to the text to be read according to preset reading At the answer type probability, answer text and corresponding confidence level of the target problem;
Determining module, for according to the answer type probability, the answer text and corresponding confidence level determine with The corresponding target answer of the target problem.
In one possible implementation, the determining module is specifically used for:
It obtains the first product of the confidence level of long answer type probability and long answer text, short answer type probability and short answers Second product of the confidence level of case text;Judge whether first product is greater than second product;
If so, the long answer text is determined as target answer corresponding with the target problem;
If it is not, the short answer text is then determined as target answer corresponding with the target problem.
In one possible implementation, described device further include: training module;
The acquisition module, is also used to obtain first sample set, wherein the first sample that the first sample is concentrated includes Starting position and stop bits of the correct option in reading material sample of training problem and reading material sample, long answer type It sets, the labeled data that the answer type for characterizing the first sample is long answer;
The acquisition module, is also used to obtain the second sample set, wherein the second sample in second sample set includes Starting position and stop bits of the correct option in reading material sample of training problem and reading material sample, short answer type It sets, the labeled data that the answer type for characterizing second sample is short answer;
The training module, for being understood based on the initial reading of the first sample set and second sample set training Model obtains the preset reading and understands model.
In one possible implementation, the initial reading understands that model includes at least encoder, the first prediction Layer, the second prediction interval, classifier, the training module are specifically used for:
By the first sample and second sample stated in the second sample set point that the first sample is concentrated It is not input in the encoder and is encoded;
Using first sample training first prediction interval after each coding, and using described after each coding After the first sample set and each coding after trained second prediction interval of second sample set and each coding of use The second sample set training classifier understands model to obtain the preset reading;
Wherein, the first prediction interval that training finishes can be predicted to need the problem of answering corresponding long answer text and its be set Reliability, the second prediction interval that training finishes can be predicted to need the problem of answering corresponding short answer text and its confidence level, be instructed The classifier that white silk finishes, which can differentiate, needs the problem of answering corresponding answer type probability.
In one possible implementation, described device further include: splicing module;
The splicing, for asking the target after the preset target problem of the acquisition and text to be read Topic and the text to be read are spliced, wherein in splicing, addition characterization is asked before the target problem The separator of topic, the separator of addition characterization paragraph before the paragraph of the text to be read.
Reading provided in an embodiment of the present invention understands device, by obtaining preset target problem and text to be read; Understand that model carries out understanding analysis to the text to be read according to preset reading, generates the answer class of the target problem Type probability, answer text and corresponding confidence level;According to the answer type probability, the answer text and corresponding set Reliability determines target answer corresponding with the target problem.To based on it is preset reading understand model to target problem and to Long answer text or short answer text that text better understands out high quality are read, all different practical situations can show good It is good, it is only good to a kind of understanding effect of the answer of answer type and logical compared to existing to be no longer limited to existing special purpose model The understanding effect of the answer to different answer types is improved with model.
In order to achieve the above object, third aspect present invention embodiment proposes a kind of computer equipment, including memory, processing On a memory and the computer program that can run on a processor, when processor execution described program, is realized for device and storage It is as described above to read understanding method.
To achieve the goals above, fourth aspect present invention embodiment proposes a kind of computer readable storage medium, when When instruction in the storage medium is executed by processor, reading understanding method as described above is realized.
The additional aspect of the present invention and advantage will be set forth in part in the description, and will partially become from the following description Obviously, or practice through the invention is recognized.
Detailed description of the invention
Above-mentioned and/or additional aspect and advantage of the invention will become from the following description of the accompanying drawings of embodiments Obviously and it is readily appreciated that, in which:
Fig. 1 is a kind of flow diagram for reading understanding method provided in an embodiment of the present invention;
Fig. 2 is another flow diagram for reading understanding method provided in an embodiment of the present invention;
Fig. 3 is the model structure that exemplary existing reading understands model;
Fig. 4 is the model structure that illustrative preset reading provided in an embodiment of the present invention understands model;
Fig. 5 is the structural schematic diagram that a kind of reading provided in an embodiment of the present invention understands device;
Fig. 6 is the structural schematic diagram that another reading provided in an embodiment of the present invention understands device;
Fig. 7 is a kind of structural schematic diagram of computer equipment provided in an embodiment of the present invention.
Specific embodiment
The embodiment of the present invention is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached The embodiment of figure description is exemplary, it is intended to is used to explain the present invention, and is not considered as limiting the invention.
Below with reference to the accompanying drawings the reading understanding method and device of the embodiment of the present invention are described.
Fig. 1 is a kind of flow diagram for reading understanding method provided in an embodiment of the present invention.Present embodiments provide one Kind reads understanding method, and executing subject is to read to understand device, which is made of hardware and/or software.Read reason Solution device be specifically as follows the software installed on hardware device, such as terminal device, background server etc. or hardware device or Application program etc..
As shown in Figure 1, the reading understanding method, comprising the following steps:
S101, preset target problem and text to be read are obtained.
In practical applications, the answer of problem may be several words, phrase etc., it is also possible to very long sentence or section It falls.Short answer text is referred to as to several words, the such answer of phrase, the answer of very long sentence or paragraph is claimed Be long answer text, certainly, how short answer text and long answer text define depending on practical situation.
For example, reading material be " five danger one gold medals refer to that being collectively referred to as several protection treatment of labourer is given by employing unit, Including endowment insurance, medical insurance, unemployment insurance, work-related injury insurance and birth insurance and public accumalation fund for housing construction ".
Problem 1: " five one gold medals of danger are protection treatment ", the answer text of problem 1 is "Yes", and the answer of problem 1 is compared Briefly, the answer type of problem 1 is short answer.
Problem 2: " which five one gold medals of danger include ", the answer text of problem 2 is that " endowment insurance, medical insurance, unemployment are protected Danger, work-related injury insurance and birth insurance and public accumalation fund for housing construction ", the answer of problem 2 is long, and the answer type of problem 2 is that length is answered Case.
In the present embodiment, preset target problem is set according to the practical situation of text to be read.
For example, text to be read is that " five one gold medals of danger refer to that several protection treatment of labourer are given by employing unit It is collectively referred to as, including endowment insurance, medical insurance, unemployment insurance, work-related injury insurance and birth insurance and public accumalation fund for housing construction." preset mesh Mark problem is " five danger one gold medals be protection treatment ", " which five one gold medals of danger include " etc..
In another example text to be read is the article for introducing the earth, this article is related to earth composition, tellurian object Kind etc., preset target problem is " which composition of the earth has ", " having which species on the earth " etc..
S102, understand that model carries out understanding analysis to the text to be read according to preset reading, generate the mesh Answer type probability, answer text and the corresponding confidence level of mark problem.
In the present embodiment, preset reading is constructed using the training data of magnanimity in advance and understands model.This is preset to read Reading understands that the universal performance of model is good, can be in the corresponding long answer of target problem, can be based on target problem and to be read Text well understood that out the long answer of target problem;Again mesh can be based in the corresponding short answer of target problem Mark problem and text to be read well understood that out the short answer of target problem.
Specifically, preset reading understands that model carries out understanding analysis to problem to be read based on target problem, exports Understand that result includes: the answer type probability, answer text and corresponding confidence level of target problem, but it is not limited to this.
Wherein, the answer type probability of target problem includes long answer type probability, short answer type probability.
Wherein, the answer text of target problem includes long answer text, short answer text.
For example, reading understands mould after target problem and text input to be read are understood model to preset reading The understanding result of type output are as follows: long answer text AlongAnd its confidence level Slong, short answer text AshortAnd its confidence level Sshort、 Long answer type probability Plong, short answer type probability Pshort
Further, in order to which can make that model quickly determines input is section in problem or text to be read It falls, before target problem and text input to be read are understood that model is understood to preset reading, to the target Problem and the text to be read are spliced, wherein in splicing, characterization is added before the target problem The separator of problem, the separator of characterization problems are, for example, [CLS];If reading material sample is made of one or more paragraphs, The separator of addition characterization paragraph, the separator for characterizing paragraph are, for example, before the paragraph of the text to be read [SEP]。
S103, it is determined and the target according to the answer type probability, the answer text and corresponding confidence level The corresponding target answer of problem.
In the present embodiment, get after preset reading understands the understanding result of model, it can be there are many implementation root According to the target answer for understanding that result determines target problem.Such as it can be according to long answer type probability and short answer type probability Size determines the target answer of target problem from long answer text and short answer text, specifically, by the big answer text of probability Originally it is determined as the target answer of target problem.In another example can be according to the confidence level of long answer text and the confidence of short answer text The size of degree determines the target answer of target problem from long answer text and short answer text, specifically, confidence level is big Answer text is determined as the target answer of target problem, and but it is not limited to this.
As a kind of possible implementation, in order to preferably carry out decision, comprehensive answer type probability and answer text Confidence level determine the target answer of target problem, the specific implementation of step S103 are as follows:
S1031, the first product of the confidence level of the long answer type probability of acquisition and long answer text, short answer type probability With the second product of the confidence level of short answer text.S1032, judge whether first product is greater than second product.
S1033, if so, the long answer text is determined as target answer corresponding with the target problem;
S1034, if it is not, the short answer text is then determined as target answer corresponding with the target problem.
For ease of description and understand, to understand result for long answer text AlongAnd its confidence level Slong, short answer text AshortAnd its confidence level Sshort, long answer type probability Plong, short answer type probability PshortFor.
If Plong*SlongGreater than Pshort*Sshort, by long answer text AlongIt is determined as target corresponding with target problem to answer Case;If Plong*SlongLess than Pshort*Sshort, by short answer text AshortIt is determined as target answer corresponding with target problem.
Reading understanding method provided in an embodiment of the present invention, by obtaining preset target problem and text to be read; Understand that model carries out understanding analysis to the text to be read according to preset reading, generates the answer class of the target problem Type probability, answer text and corresponding confidence level;According to the answer type probability, the answer text and corresponding set Reliability determines target answer corresponding with the target problem.To based on it is preset reading understand model to target problem and to Long answer text or short answer text that text better understands out high quality are read, different practical situations can be showed good It is good, it is only good to a kind of understanding effect of the answer of answer type and logical compared to existing to be no longer limited to existing special purpose model The understanding effect of the answer to different answer types is improved with model.
Fig. 2 is another flow diagram for reading understanding method provided in an embodiment of the present invention.The present embodiment is to default Reading understand that the training stage of model is illustrated.In conjunction with reference Fig. 2, on the basis of embodiment shown in Fig. 1, in step Before S101, the reading understanding method is further comprising the steps of:
S104, first sample set is obtained.
Wherein, the first sample that the first sample is concentrated includes training problem and reading material sample, long answer type Starting position and end position of the correct option in reading material sample, the answer type for characterizing the first sample For the labeled data of long answer.
S105, the second sample set is obtained.
Wherein, the second sample in second sample set includes training problem and reading material sample, short answer type Starting position and end position of the correct option in reading material sample, the answer type for characterizing second sample For the labeled data of short answer.
S106, model is understood based on the initial reading of the first sample set and second sample set training, obtains institute It states preset reading and understands model.
As a kind of possible implementation, if initial reading understands that model includes including at least encoder, first in advance Survey layer, the second prediction interval, classifier, the implementation of step S106 the following steps are included:
S1061, by the first sample that the first sample is concentrated and described second stated in the second sample set Sample is separately input to be encoded in the coding layer.
It, will be in first sample or the second sample before being encoded to first sample or the second sample in the present embodiment Training problem and reading material sample are spliced, and when splicing, the separator of characterization problems, table are added before training problem The separator of sign problem is, for example, [CLS];If reading material sample is made of one or more paragraphs, add before each paragraph The separator for adding characterization paragraph is, for example, [SEP].Encoder by identify separator can quickly determine input be problem also It is the paragraph in reading material sample.
S1062, first prediction interval is trained using the first sample after each coding, and using after each coding Second sample set training second prediction interval and using the first sample set and each volume after each coding Second sample set training classifier after code understands model to obtain the preset reading.
In the present embodiment, the first prediction interval that training finishes can be predicted to need the problem of answering corresponding long answer text And its confidence level, the second prediction interval that training finishes can be predicted to need the problem of answering corresponding short answer text and its confidence Degree, the classifier that training finishes, which can differentiate, needs the problem of answering corresponding answer type probability.
Fig. 3 is the model structure that exemplary existing reading understands model.Understand model for BERT with existing reading For model, BERT model includes an encoder, a prediction interval.The problem of to be answered and text to be read are spliced Afterwards, it is input to encoder to be encoded, exports coding vector;Coding vector obtains corresponding answer by the prediction of prediction interval.
Fig. 4 is the model structure that illustrative preset reading provided in an embodiment of the present invention understands model.In Fig. 4 In, it devises an encoder and each first sample or each second sample is encoded, design first prediction interval (figure Long answer prediction interval in 4) it can predict to need the long answer for the problem of answering and its confidence level, design second prediction interval (the short answer prediction interval in Fig. 4) can be predicted to need the short answer for the problem of answering and its confidence level, devise an answer Type sorter can judge to need the answer type probability for the problem of answering.Compared to shown in Fig. 3, existing reading understands mould Type, the preset reading of the embodiment of the present invention have understood more than model a prediction interval and a classifier.
Training stage of the first prediction interval is illustrated at this:
Using in the first sample after coding training problem and reading material sample as input, by the first sample after coding Starting position and end position of the correct option of long answer type in this in reading material sample are as desired output, instruction Practice the first prediction interval, until the first prediction interval is restrained, the first prediction interval after convergence can be predicted to need the problem of answering corresponding Long answer text and its confidence level.
It should be pointed out that the structure of the first prediction interval can understand the structure of the prediction interval in model with existing reading It is identical, it can also be with designed, designed.
Training stage of the second prediction interval is illustrated at this:
Using in the second sample after coding training problem and reading material sample as input, by the second sample after coding Starting position and end position of the correct option of short answer type in this in reading material sample are as desired output, instruction Practice the second prediction interval, until the second prediction interval is restrained, the second prediction interval after convergence can be predicted to need the problem of answering corresponding Short answer text and its confidence level.
It should be pointed out that the structure of the second prediction interval can understand the structure of the prediction interval in model with existing reading It is identical, it can also be with designed, designed.
Training stage of classifier is illustrated at this:
By in the first sample after coding training problem, reading material sample, be used to characterize answering for the first sample Case type be long answer labeled data as a training sample, and by the second sample after coding training problem, Reading material sample, the answer type for characterizing second sample are the labeled data of short answer as a trained sample This;
Using in training sample training problem, reading material sample as output, by training sample labeled data make For desired output, training classifier, until classifier is restrained, the classifier differentiation after convergence needs the problem of answering corresponding to answer Case type probability.
It may be noted that when, classifier be, for example, the classifier based on support vector machines, the classifier based on decision tree, but It is not limited to this.
Reading understanding method provided in an embodiment of the present invention, compared with existing reading understands model, preset reading reason Solving model not only includes the first prediction interval that can predict long answer in model structure, can predict the second prediction of short answer Layer, further includes the classifier that can differentiate answer type, since the first prediction interval and the second prediction interval are to separate training, for Different answer types corresponds to different model structure and parameter, therefore the preset reading understands model for different practical situations Reading understand that scene can show well flexibility, better effect;Pass through joint training, model learning to preferably spy Sign, universal performance is more preferable, be no longer limited to existing special purpose model only it is good to a kind of understanding effect of the answer of answer type, very Solves the collision problem between long answer model and short answer model well, and existing general compared to common model parameter Model improves the understanding effect of the answer to different answer types.
Fig. 5 is the structural schematic diagram that a kind of reading provided in an embodiment of the present invention understands device.Present embodiments provide one Kind, which is read, understands device, which is the executing subject for reading understanding method, which is made of hardware and/or software. As shown in figure 5, the reading understands that device includes: to obtain module 11, generation module 12, determining module 13.
Module 11 is obtained, for obtaining preset target problem and text to be read;
Generation module 12, for understanding that model carries out understanding analysis to the text to be read according to preset reading, Generate the answer type probability, answer text and corresponding confidence level of the target problem;
Determining module 13, for being determined according to the answer type probability, the answer text and corresponding confidence level Target answer corresponding with the target problem.
In one possible implementation, the determining module 13 is specifically used for:
It obtains the first product of the confidence level of long answer type probability and long answer text, short answer type probability and short answers Second product of the confidence level of case text;Judge whether first product is greater than second product;
If so, the long answer text is determined as target answer corresponding with the target problem;
If it is not, the short answer text is then determined as target answer corresponding with the target problem.
In one possible implementation, described device further include: splicing module;
The splicing, for asking the target after the preset target problem of the acquisition and text to be read Topic and the text to be read are spliced, wherein in splicing, addition characterization is asked before the target problem The separator of topic, the separator of addition characterization paragraph before the paragraph of the text to be read.
It should be noted that the aforementioned reading for being also applied for the embodiment to the explanation for reading understanding method embodiment Understand device, details are not described herein again.
Reading provided in an embodiment of the present invention understands device, by obtaining preset target problem and text to be read; Understand that model carries out understanding analysis to the text to be read according to preset reading, generates the answer class of the target problem Type probability, answer text and corresponding confidence level;According to the answer type probability, the answer text and corresponding set Reliability determines target answer corresponding with the target problem.To based on it is preset reading understand model to target problem and to Long answer text or short answer text that text better understands out high quality are read, all different practical situations can show good It is good, it is only good to a kind of understanding effect of the answer of answer type and logical compared to existing to be no longer limited to existing special purpose model The understanding effect of the answer to different answer types is improved with model.
Fig. 6 is the structural schematic diagram that another reading provided in an embodiment of the present invention understands device.In conjunction with reference Fig. 6, On the basis of embodiment illustrated in fig. 5, described device further include: training module 14;
The acquisition module 11, is also used to obtain first sample set, wherein the first sample packet that the first sample is concentrated Include starting position and end of the correct option in reading material sample of training problem and reading material sample, long answer type Position, the labeled data that the answer type for characterizing the first sample is long answer;
The acquisition module 11, is also used to obtain the second sample set, wherein the second sample packet in second sample set Include starting position and end of the correct option in reading material sample of training problem and reading material sample, short answer type Position, the labeled data that the answer type for characterizing second sample is short answer;
The training module 14, for the reading reason initial based on the first sample set and second sample set training Model is solved, the preset reading is obtained and understands model.
In one possible implementation, the initial reading understands that model includes at least encoder, the first prediction Layer, the second prediction interval, classifier, the training module 14 are specifically used for:
By the first sample and second sample stated in the second sample set point that the first sample is concentrated It is not input in the encoder and is encoded;
Using first sample training first prediction interval after each coding, and using described after each coding After the first sample set and each coding after trained second prediction interval of second sample set and each coding of use The second sample set training classifier understands model to obtain the preset reading;
Wherein, the first prediction interval that training finishes can be predicted to need the problem of answering corresponding long answer text and its be set Reliability, the second prediction interval that training finishes can be predicted to need the problem of answering corresponding short answer text and its confidence level, be instructed The classifier that white silk finishes, which can differentiate, needs the problem of answering corresponding answer type probability.
It should be noted that the aforementioned reading for being also applied for the embodiment to the explanation for reading understanding method embodiment Understand device, details are not described herein again.
Reading provided in an embodiment of the present invention understands device, compared with existing reading understands model, preset reading reason Solving model not only includes the first prediction interval that can predict long answer in model structure, can predict the second prediction of short answer Layer, further includes the classifier that can differentiate answer type, since the first prediction interval and the second prediction interval are to separate training, for Different answer types corresponds to different model structure and parameter, therefore the preset reading understands model for different practical situations Reading understand that scene can show well flexibility, better effect, pass through joint training, model learning is to preferably special Sign, universal performance is more preferable, be no longer limited to existing special purpose model only it is good to a kind of understanding effect of the answer of answer type, very Solves the collision problem between long answer model and short answer model well, and existing general compared to common model parameter Model improves the understanding effect of the answer to different answer types.
Fig. 7 is a kind of structural schematic diagram of computer equipment provided in an embodiment of the present invention.The computer equipment includes:
Memory 1001, processor 1002 and it is stored in the calculating that can be run on memory 1001 and on processor 1002 Machine program.
Processor 1002 realizes the reading understanding method provided in above-described embodiment when executing described program.
Further, computer equipment further include:
Communication interface 1003, for the communication between memory 1001 and processor 1002.
Memory 1001, for storing the computer program that can be run on processor 1002.
Memory 1001 may include high speed RAM memory, it is also possible to further include nonvolatile memory (non- Volatile memory), a for example, at least magnetic disk storage.
Processor 1002 realizes reading understanding method described in above-described embodiment when for executing described program.
If memory 1001, processor 1002 and the independent realization of communication interface 1003, communication interface 1003, memory 1001 and processor 1002 can be connected with each other by bus and complete mutual communication.The bus can be industrial standard Architecture (Industry Standard Architecture, referred to as ISA) bus, external equipment interconnection (Peripheral Component, referred to as PCI) bus or extended industry-standard architecture (Extended Industry Standard Architecture, referred to as EISA) bus etc..The bus can be divided into address bus, data/address bus, control Bus processed etc..Only to be indicated with a thick line in Fig. 7, it is not intended that an only bus or a type of convenient for indicating Bus.
Optionally, in specific implementation, if memory 1001, processor 1002 and communication interface 1003, are integrated in one It is realized on block chip, then memory 1001, processor 1002 and communication interface 1003 can be completed mutual by internal interface Communication.
Processor 1002 may be a central processing unit (Central Processing Unit, referred to as CPU), or Person is specific integrated circuit (Application Specific Integrated Circuit, referred to as ASIC) or quilt It is configured to implement one or more integrated circuits of the embodiment of the present invention.
The present embodiment also provides a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that Reading understanding method as described above is realized when the program is executed by processor.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example Point is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are not It must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in office It can be combined in any suitable manner in one or more embodiment or examples.In addition, without conflicting with each other, the skill of this field Art personnel can tie the feature of different embodiments or examples described in this specification and different embodiments or examples It closes and combines.
In addition, term " first ", " second " are used for descriptive purposes only and cannot be understood as indicating or suggesting relative importance Or implicitly indicate the quantity of indicated technical characteristic.Define " first " as a result, the feature of " second " can be expressed or Implicitly include at least one this feature.In the description of the present invention, the meaning of " plurality " is at least two, such as two, three It is a etc., unless otherwise specifically defined.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes It is one or more for realizing custom logic function or process the step of executable instruction code module, segment or portion Point, and the range of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discussed suitable Sequence, including according to related function by it is basic simultaneously in the way of or in the opposite order, Lai Zhihang function, this should be of the invention Embodiment person of ordinary skill in the field understood.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for Instruction execution system, device or equipment (such as computer based system, including the system of processor or other can be held from instruction The instruction fetch of row system, device or equipment and the system executed instruction) it uses, or combine these instruction execution systems, device or set It is standby and use.For the purpose of this specification, " computer-readable medium ", which can be, any may include, stores, communicates, propagates or pass Defeated program is for instruction execution system, device or equipment or the dress used in conjunction with these instruction execution systems, device or equipment It sets.The more specific example (non-exhaustive list) of computer-readable medium include the following: there is the electricity of one or more wirings Interconnecting piece (electronic device), portable computer diskette box (magnetic device), random access memory (RAM), read-only memory (ROM), erasable edit read-only storage (EPROM or flash memory), fiber device and portable optic disk is read-only deposits Reservoir (CDROM).In addition, computer-readable medium can even is that the paper that can print described program on it or other are suitable Medium, because can then be edited, be interpreted or when necessary with it for example by carrying out optical scanner to paper or other media His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each section of the invention can be realized with hardware, software, firmware or their combination.Above-mentioned In embodiment, software that multiple steps or method can be executed in memory and by suitable instruction execution system with storage Or firmware is realized.Such as, if realized with hardware in another embodiment, following skill well known in the art can be used Any one of art or their combination are realized: have for data-signal is realized the logic gates of logic function from Logic circuit is dissipated, the specific integrated circuit with suitable combinational logic gate circuit, programmable gate array (PGA), scene can compile Journey gate array (FPGA) etc..
Those skilled in the art are understood that realize all or part of step that above-described embodiment method carries It suddenly is that relevant hardware can be instructed to complete by program, the program can store in a kind of computer-readable storage medium In matter, which when being executed, includes the steps that one or a combination set of embodiment of the method.
It, can also be in addition, each functional unit in each embodiment of the present invention can integrate in a processing module It is that each unit physically exists alone, can also be integrated in two or more units in a module.Above-mentioned integrated mould Block both can take the form of hardware realization, can also be realized in the form of software function module.The integrated module is such as Fruit is realized and when sold or used as an independent product in the form of software function module, also can store in a computer In read/write memory medium.
Storage medium mentioned above can be read-only memory, disk or CD etc..Although having been shown and retouching above The embodiment of the present invention is stated, it is to be understood that above-described embodiment is exemplary, and should not be understood as to limit of the invention System, those skilled in the art can be changed above-described embodiment, modify, replace and become within the scope of the invention Type.

Claims (12)

1. a kind of reading understanding method characterized by comprising
Obtain preset target problem and text to be read;
Understand that model carries out understanding analysis to the text to be read according to preset reading, generates answering for the target problem Case type probability, answer text and corresponding confidence level;
It is corresponding with the target problem according to the determination of the answer type probability, the answer text and corresponding confidence level Target answer.
2. the method according to claim 1, wherein it is described according to the answer text type probability, described answer Case text and corresponding confidence level determine that target answer corresponding with the target problem includes:
Obtain the first product, short answer type probability and the short answer text of the confidence level of long answer type probability and long answer text Second product of this confidence level;
Judge whether first product is greater than second product;
If so, the long answer text is determined as target answer corresponding with the target problem;
If it is not, the short answer text is then determined as target answer corresponding with the target problem.
3. the method according to claim 1, wherein in the preset target problem of the acquisition and text to be read Before this, further includes:
Obtain first sample set, wherein the first sample that the first sample is concentrated include training problem and reading material sample, Starting position and end position of the correct option of long answer type in reading material sample, for characterizing the first sample Answer type be long answer labeled data;
Obtain the second sample set, wherein the second sample in second sample set include training problem and reading material sample, Starting position and end position of the correct option of short answer type in reading material sample, for characterizing second sample Answer type be short answer labeled data;
Model is understood based on the first sample set and the initial reading of second sample set training, obtains described preset read Reading understands model.
4. according to the method described in claim 3, it is characterized in that, the initial reading understands that model includes at least coding Device, the first prediction interval, the second prediction interval, classifier, it is described first based on the first sample set and second sample set training The reading of beginning understands model, obtains the preset reading and understands that model includes:
The first sample that the first sample is concentrated and second sample difference stated in the second sample set is defeated Enter into the encoder and is encoded;
Using first sample training first prediction interval after each coding, and using described second after each coding It is described after the first sample set and each coding after trained second prediction interval of sample set and each coding of use The second sample set training classifier understands model to obtain the preset reading;
Wherein, the first prediction interval that training finishes can be predicted to need the problem of answering corresponding long answer text and its confidence Degree, the second prediction interval that training finishes can be predicted to need the problem of answering corresponding short answer text and its confidence level, be trained The classifier finished, which can differentiate, needs the problem of answering corresponding answer type probability.
5. method according to any one of claims 1 to 4, which is characterized in that it is described obtain preset target problem and After text to be read, further includes:
The target problem and the text to be read are spliced, wherein in splicing, in the target problem Before add characterization problems separator, before the paragraph of the text to be read addition characterization paragraph separation Symbol.
6. a kind of reading understands device characterized by comprising
Module is obtained, for obtaining preset target problem and text to be read;
Generation module generates institute for understanding that model carries out understanding analysis to the text to be read according to preset reading State the answer type probability, answer text and corresponding confidence level of target problem;
Determining module, for according to the answer type probability, the answer text and corresponding confidence level it is determining with it is described The corresponding target answer of target problem.
7. device according to claim 6, which is characterized in that the determining module is specifically used for:
Obtain the first product, short answer type probability and the short answer text of the confidence level of long answer type probability and long answer text Second product of this confidence level;Judge whether first product is greater than second product;
If so, the long answer text is determined as target answer corresponding with the target problem;
If it is not, the short answer text is then determined as target answer corresponding with the target problem.
8. device according to claim 6, which is characterized in that further include: training module;
The acquisition module, is also used to obtain first sample set, wherein the first sample that the first sample is concentrated includes training Problem and reading material sample, long answer type starting position and end position of the correct option in reading material sample, Answer type for characterizing the first sample is the labeled data of long answer;
The acquisition module, is also used to obtain the second sample set, wherein the second sample in second sample set includes training Problem and reading material sample, short answer type starting position and end position of the correct option in reading material sample, Answer type for characterizing second sample is the labeled data of short answer;
The training module, for understanding mould based on the initial reading of the first sample set and second sample set training Type obtains the preset reading and understands model.
9. device according to claim 8, which is characterized in that the initial reading understands that model includes at least coding Device, the first prediction interval, the second prediction interval, classifier, the training module are specifically used for:
The first sample that the first sample is concentrated and second sample difference stated in the second sample set is defeated Enter into the encoder and is encoded;
Using first sample training first prediction interval after each coding, and using described second after each coding It is described after the first sample set and each coding after trained second prediction interval of sample set and each coding of use The second sample set training classifier understands model to obtain the preset reading;
Wherein, the first prediction interval that training finishes can be predicted to need the problem of answering corresponding long answer text and its confidence Degree, the second prediction interval that training finishes can be predicted to need the problem of answering corresponding short answer text and its confidence level, be trained The classifier finished, which can differentiate, needs the problem of answering corresponding answer type probability.
10. according to the described in any item devices of claim 6 to 8, which is characterized in that further include: splicing module;
The splicing, for after the preset target problem of the acquisition and text to be read, to the target problem and The text to be read is spliced, wherein in splicing, characterization problems are added before the target problem Separator, the separator of addition characterization paragraph before the paragraph of the text to be read.
11. a kind of computer equipment characterized by comprising
Memory, processor and storage are on a memory and the computer program that can run on a processor, which is characterized in that institute It states when processor executes described program and realizes such as reading understanding method as claimed in any one of claims 1 to 5.
12. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor Such as reading understanding method as claimed in any one of claims 1 to 5 is realized when execution.
CN201910429805.0A 2019-05-22 2019-05-22 Reading understanding method and device Active CN110210021B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910429805.0A CN110210021B (en) 2019-05-22 2019-05-22 Reading understanding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910429805.0A CN110210021B (en) 2019-05-22 2019-05-22 Reading understanding method and device

Publications (2)

Publication Number Publication Date
CN110210021A true CN110210021A (en) 2019-09-06
CN110210021B CN110210021B (en) 2021-05-28

Family

ID=67788119

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910429805.0A Active CN110210021B (en) 2019-05-22 2019-05-22 Reading understanding method and device

Country Status (1)

Country Link
CN (1) CN110210021B (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110955755A (en) * 2019-11-29 2020-04-03 支付宝(杭州)信息技术有限公司 Method and system for determining target standard information
CN111428467A (en) * 2020-02-19 2020-07-17 平安科技(深圳)有限公司 Method, device, equipment and storage medium for generating reading comprehension question topic
CN111858878A (en) * 2020-06-18 2020-10-30 达而观信息科技(上海)有限公司 Method, system and storage medium for automatically extracting answer from natural language text
CN112215004A (en) * 2020-09-04 2021-01-12 中国电子科技集团公司第二十八研究所 Application method in extraction of text entities of military equipment based on transfer learning
CN112507090A (en) * 2020-11-30 2021-03-16 北京百度网讯科技有限公司 Method, apparatus, device and storage medium for outputting information
CN112509690A (en) * 2020-11-30 2021-03-16 北京百度网讯科技有限公司 Method, apparatus, device and storage medium for controlling quality
WO2021135910A1 (en) * 2020-06-24 2021-07-08 平安科技(深圳)有限公司 Machine reading comprehension-based information extraction method and related device
CN113111232A (en) * 2020-02-13 2021-07-13 北京明亿科技有限公司 Regular expression-based alarm receiving and processing text address extraction method and device
CN113657089A (en) * 2021-08-20 2021-11-16 西安电子科技大学 English reading understanding auxiliary question setting method and system
CN113792121A (en) * 2021-04-08 2021-12-14 北京金山数字娱乐科技有限公司 Reading understanding model training method and device and reading understanding method and device
CN113935305A (en) * 2021-08-10 2022-01-14 上海明略人工智能(集团)有限公司 Multi-stage and multi-task text reading understanding method and device
CN114490990A (en) * 2022-01-28 2022-05-13 北京百度网讯科技有限公司 Method, device and equipment for determining text to be marked and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104471568A (en) * 2012-07-02 2015-03-25 微软公司 Learning-based processing of natural language questions
US20180260382A1 (en) * 2017-03-09 2018-09-13 International Business Machines Corporation Domain-specific method for distinguishing type-denoting domain terms from entity-denoting domain terms
CN108846063A (en) * 2018-06-04 2018-11-20 北京百度网讯科技有限公司 Determine the method, apparatus, equipment and computer-readable medium of problem answers
CN109344234A (en) * 2018-09-06 2019-02-15 和美(深圳)信息技术股份有限公司 Machine reads understanding method, device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104471568A (en) * 2012-07-02 2015-03-25 微软公司 Learning-based processing of natural language questions
US20180260382A1 (en) * 2017-03-09 2018-09-13 International Business Machines Corporation Domain-specific method for distinguishing type-denoting domain terms from entity-denoting domain terms
CN108846063A (en) * 2018-06-04 2018-11-20 北京百度网讯科技有限公司 Determine the method, apparatus, equipment and computer-readable medium of problem answers
CN109344234A (en) * 2018-09-06 2019-02-15 和美(深圳)信息技术股份有限公司 Machine reads understanding method, device, computer equipment and storage medium

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110955755A (en) * 2019-11-29 2020-04-03 支付宝(杭州)信息技术有限公司 Method and system for determining target standard information
CN113111232A (en) * 2020-02-13 2021-07-13 北京明亿科技有限公司 Regular expression-based alarm receiving and processing text address extraction method and device
CN111428467A (en) * 2020-02-19 2020-07-17 平安科技(深圳)有限公司 Method, device, equipment and storage medium for generating reading comprehension question topic
CN111428467B (en) * 2020-02-19 2024-05-07 平安科技(深圳)有限公司 Method, device, equipment and storage medium for generating problem questions for reading and understanding
CN111858878A (en) * 2020-06-18 2020-10-30 达而观信息科技(上海)有限公司 Method, system and storage medium for automatically extracting answer from natural language text
CN111858878B (en) * 2020-06-18 2023-12-22 达观数据有限公司 Method, system and storage medium for automatically extracting answer from natural language text
WO2021135910A1 (en) * 2020-06-24 2021-07-08 平安科技(深圳)有限公司 Machine reading comprehension-based information extraction method and related device
CN112215004B (en) * 2020-09-04 2023-05-02 中国电子科技集团公司第二十八研究所 Application method of transfer learning-based text entity extraction in military equipment
CN112215004A (en) * 2020-09-04 2021-01-12 中国电子科技集团公司第二十八研究所 Application method in extraction of text entities of military equipment based on transfer learning
CN112507090A (en) * 2020-11-30 2021-03-16 北京百度网讯科技有限公司 Method, apparatus, device and storage medium for outputting information
CN112509690B (en) * 2020-11-30 2023-08-04 北京百度网讯科技有限公司 Method, apparatus, device and storage medium for controlling quality
CN112507090B (en) * 2020-11-30 2024-05-03 北京百度网讯科技有限公司 Method, apparatus, device and storage medium for outputting information
CN112509690A (en) * 2020-11-30 2021-03-16 北京百度网讯科技有限公司 Method, apparatus, device and storage medium for controlling quality
CN113792121A (en) * 2021-04-08 2021-12-14 北京金山数字娱乐科技有限公司 Reading understanding model training method and device and reading understanding method and device
CN113792121B (en) * 2021-04-08 2023-09-22 北京金山数字娱乐科技有限公司 Training method and device of reading and understanding model, reading and understanding method and device
CN113935305A (en) * 2021-08-10 2022-01-14 上海明略人工智能(集团)有限公司 Multi-stage and multi-task text reading understanding method and device
CN113657089A (en) * 2021-08-20 2021-11-16 西安电子科技大学 English reading understanding auxiliary question setting method and system
CN114490990A (en) * 2022-01-28 2022-05-13 北京百度网讯科技有限公司 Method, device and equipment for determining text to be marked and storage medium
CN114490990B (en) * 2022-01-28 2023-05-23 北京百度网讯科技有限公司 Method, device, equipment and storage medium for determining text to be annotated

Also Published As

Publication number Publication date
CN110210021B (en) 2021-05-28

Similar Documents

Publication Publication Date Title
CN110210021A (en) Read understanding method and device
CN110188350A (en) Text coherence calculation method and device
CN106844341A (en) News in brief extracting method and device based on artificial intelligence
CN107844417A (en) Method for generating test case and device
CN110188362A (en) Text handling method and device
CN109543022A (en) Text error correction method and device
CN114943789A (en) Image processing method, model training method and related device
CN112183747A (en) Neural network training method, neural network compression method and related equipment
CN109599095A (en) A kind of mask method of voice data, device, equipment and computer storage medium
CN109670491A (en) Identify method, apparatus, equipment and the storage medium of facial image
JP2023509405A (en) Translation method, device, electronic device and computer program
CN107122492A (en) Lyric generation method and device based on picture content
US20180018392A1 (en) Topic identification based on functional summarization
CN109840280A (en) A kind of file classification method, device and computer readable storage medium
CN109800292A (en) The determination method, device and equipment of question and answer matching degree
CN109461438A (en) A kind of audio recognition method, device, equipment and storage medium
CN110187760A (en) Intelligent interactive method and device
CN107193941A (en) Story generation method and device based on picture content
JPWO2011018867A1 (en) Information classification apparatus, information classification method, and program
CN110232117A (en) Sentence fluency detection method, device and terminal
CN107748801A (en) News recommends method, apparatus, terminal device and computer-readable recording medium
CN111680132A (en) Noise filtering and automatic classifying method for internet text information
CN110188327A (en) Text goes colloquial style method and device
CN111126566A (en) Abnormal furniture layout data detection method based on GAN model
CN113610080B (en) Cross-modal perception-based sensitive image identification method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant