CN113420111A - Intelligent question-answering method and device for multi-hop inference problem - Google Patents

Intelligent question-answering method and device for multi-hop inference problem Download PDF

Info

Publication number
CN113420111A
CN113420111A CN202110674586.XA CN202110674586A CN113420111A CN 113420111 A CN113420111 A CN 113420111A CN 202110674586 A CN202110674586 A CN 202110674586A CN 113420111 A CN113420111 A CN 113420111A
Authority
CN
China
Prior art keywords
question
text
prediction result
representation
sub
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
CN202110674586.XA
Other languages
Chinese (zh)
Other versions
CN113420111B (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.)
Institute of Acoustics CAS
National Computer Network and Information Security Management Center
Original Assignee
Institute of Acoustics CAS
National Computer Network and Information Security Management Center
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 Institute of Acoustics CAS, National Computer Network and Information Security Management Center filed Critical Institute of Acoustics CAS
Priority to CN202110674586.XA priority Critical patent/CN113420111B/en
Publication of CN113420111A publication Critical patent/CN113420111A/en
Application granted granted Critical
Publication of CN113420111B publication Critical patent/CN113420111B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Databases & Information Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Machine Translation (AREA)

Abstract

The embodiment of the application discloses an intelligent question-answering method and device for multi-hop inference problems, wherein the method comprises the following steps: acquiring a question text; performing semantic coding on the problem text to obtain semantic coding representation of the problem text; determining a first prediction result according to semantic coding representation of the problem text, wherein the first prediction result is a prediction result of the position of at least one problem main body of the problem text; determining a second prediction result according to the semantic coding representation of the question text, wherein the second prediction result is a prediction result of at least one question relation of the question text; generating a sub-question text according to the first prediction result and the second prediction result, wherein the sub-question text comprises at least one sub-question; sequentially answering at least one sub-question according to a screening document to obtain an answer corresponding to at least one sub-question, wherein the screening document comprises the answer corresponding to at least one sub-question; and determining a final answer of the question text according to the answer corresponding to the at least one sub-question.

Description

Intelligent question-answering method and device for multi-hop inference problem
Technical Field
The invention relates to the technical field of natural language processing. In particular to an intelligent question-answering method and device for multi-hop reasoning problems.
Background
The multi-hop inference system is an important technology for intelligently analyzing complex question descriptions and searching multiple clues for answers in an intelligent question-answering service scene, and is an important component of the intelligent question-answering service scene.
Deep learning techniques have made great progress in traditional single-hop reading understanding tasks, achieving a level comparable to humans, but many single-hop reading understanding tasks can be answered by simple question-sentence matching of paragraphs, and do not involve complex reasoning.
For the machine to learn true reasoning ability, many high-quality multi-hop question-answering datasets have been proposed recently, such as HotpotQA, ComplexWebQuestions, Qangaroo WikiHop, R4C, 2WikiMultiHopQA, etc. These multi-hop question-and-answer tasks are more challenging than traditional reading understanding tasks, and the difficulty is mainly reflected in that: firstly, the inference can be completed only by finding a clue at a plurality of positions in a large number of paragraphs which are far away by a machine; secondly, the machine is required to have certain interpretability while completing reasoning; and thirdly, the machine is required to be capable of adapting to complicated and changeable question types and answer types, and the answers can be obtained by better integrating clues.
Most of the traditional multi-hop question-answering models are end-to-end reading understanding models based on graph structures or graph neural networks. While these tasks have performed well on many tasks, they also have significant limitations.
Firstly, the internal reasoning mechanism of the end-to-end reading understanding model is unclear, and an additional discriminator is usually adopted to judge whether a certain sentence is a clue sentence, so that the additional discriminator has no strong correlation with the reasoning result of the end-to-end reading understanding model, and the interpretability is not faithful enough; secondly, although the graph structure is theoretically effective for solving the multi-hop question-answering problem, recent experiments prove that the existing graph neural network is only a special attention mechanism and is not necessary for the multi-hop question-answering problem, and the same or even better effect can be achieved by only using the self-attention mechanism of the transform network instead of the graph neural network as long as the same additional adjacency matrix information is provided.
Disclosure of Invention
Because the existing method has the problems, the embodiment of the application provides an intelligent question-answering method and device for multi-hop reasoning problems.
In a first aspect, an embodiment of the present application provides an intelligent question-answering method for a multi-hop inference problem, including:
acquiring a question text;
carrying out semantic coding on the problem text to obtain semantic coded representation of the problem text;
determining a first prediction result according to semantic coding representation of the question text, wherein the first prediction result is a prediction result of the position of at least one question main body of the question text;
determining a second prediction result according to the semantic coding representation of the question text, wherein the second prediction result is a prediction result of at least one question relation of the question text;
generating a sub-question text according to the first prediction result and the second prediction result, wherein the sub-question text comprises at least one sub-question;
sequentially answering the at least one sub-question according to a screening document to obtain an answer corresponding to the at least one sub-question, wherein the screening document comprises the answer corresponding to the at least one sub-question;
and determining a final answer of the question text according to the answer corresponding to the at least one sub-question.
In one possible implementation, the determining a first prediction result from the semantically encoded representation of the question text comprises:
performing first coding on the semantic coding representation of the problem text to obtain a first coding representation, wherein the first coding representation is used for searching and predicting the position of at least one problem main body of the problem text;
performing an attention mechanism operation on the first encoded representation to obtain a first attention perception representation of the semantically encoded representation for the at least one question body;
applying at least two pointers to the first attention perception representation through a pointer network architecture, and outputting probability distributions of a starting point and an end point corresponding to the at least one problem body;
and determining a prediction result of the position of the at least one problem main body according to the probability distribution of the starting point and the end point corresponding to the at least one problem main body.
In one possible implementation, the method further comprises:
performing maximum average pooling operation on the semantic code representation to obtain a maximum pooling result and an average pooling result;
splicing the maximum pooling result and the average pooling result to obtain a pooling semantic code representation;
determining probability distribution of different problem types according to the pooling semantic code representation;
and determining the problem type corresponding to the maximum probability distribution as a third prediction result, wherein the third prediction result is a prediction result of the problem type to which the problem text belongs.
In one possible implementation, the method further comprises:
determining probability distribution of different problem relation predictions according to the pooling semantic code representation aiming at the classification relation extractor;
multiplying the probability distribution of the different problem relation predictions by the probability distribution of the corresponding problem types to determine the final problem relation prediction result of the problem text; and/or
Second coding the semantic coding representation of the question text to obtain a second coding representation for a pull-out relationship extractor, the second coding representation being used for search prediction of at least one question relationship of the question text;
performing attention mechanism operation on the second coded representation to obtain a second attention perception representation of the semantic coded representation for the at least one question relationship;
applying at least two pointers to the second attention perception representation through a pointer network architecture, and outputting probability distributions of a starting point and an end point corresponding to the at least one problem relation;
determining a second prediction result corresponding to the prediction result of the question type to which the question text belongs according to the probability distribution of the starting point and the end point corresponding to the at least one question relation;
and multiplying a second prediction result corresponding to the prediction result of the problem type to which the problem text belongs by the probability distribution of the corresponding problem type to determine the prediction result of the final problem relation of the problem text.
In one possible implementation, the generating a subproblem text according to the first prediction result and the second prediction result includes:
determining a sub-question text according to the question body, the at least one question relationship and the first separation identifier; or
Determining a sub-problem text by adopting different templates according to the type of the problem main body and the type of the at least one problem relation; or
And determining a sub-problem text according to a preset training model and through the problem main body and the at least one problem relation.
In one possible implementation, the sequentially answering the at least one sub-question according to the screening document to obtain an answer corresponding to the at least one sub-question includes:
splicing the sub-question text, the screened document and the second separation identifier to obtain a first splicing result;
performing word segmentation on the first splicing result to obtain a word segmentation result;
carrying out double-byte encoding on the word segmentation result to obtain double-byte encoding representation;
determining a vector representation of the first concatenation result from the double-byte encoded representation;
performing third coding on the vector representation of the first splicing result to obtain a third coded representation;
determining a probability distribution of a starting point and an ending point of an answer to at least one sub-question included in the sub-question text according to the third coded representation;
determining an answer corresponding to at least one sub-question according to probability distribution of a starting point and an ending point of the answer of the at least one sub-question included in the sub-question text;
splicing a question main body with a first question relation to obtain a first subproblem, and determining an answer corresponding to the first subproblem as a first answer according to the steps; and splicing the first answer and the second question in a relationship manner to obtain a second subproblem, determining that the answer corresponding to the second subproblem is a second answer according to the steps, and by analogy, splicing the (N-1) th answer and the final question in a relationship manner to obtain a final subproblem, determining that the answer corresponding to the final subproblem is an Nth answer according to the steps, wherein N is the number of the subproblems and is a positive integer.
In one possible implementation, the question text belongs to a question type including: combinatorial, inferential, comparative, and/or cascaded comparative;
the method further comprises the following steps:
determining an answer corresponding to the last subproblem as a final answer of the question text aiming at the condition that the question type of the question text is a combined type or an inference type; or
Aiming at the condition that the question type of the question text is a comparative type or a cascade comparative type, taking an answer corresponding to the last subproblem respectively corresponding to at least two question main bodies as a comparative object, and splicing the question text and the comparative object to obtain a second splicing result;
and determining the final answer of the question text according to the second splicing result.
In a second aspect, an embodiment of the present application provides an intelligent question-answering device for multi-hop inference questions, including:
the relation extractor module is used for acquiring a question text; performing semantic coding on the problem text to obtain semantic coding representation of the problem text; determining a first prediction result according to semantic coding representation of the question text, wherein the first prediction result is a prediction result of the position of at least one question main body of the question text; determining a second prediction result according to the semantic coding representation of the question text, wherein the second prediction result is a prediction result of at least one question relation of the question text;
the reader module is used for generating a subproblem text according to the first prediction result and the second prediction result, and the subproblem text comprises at least one subproblem; according to the screened documents, sequentially answering the at least one sub-question to obtain answers corresponding to the at least one sub-question;
and the comparator module is used for determining the final answer of the question text according to the answer corresponding to the at least one sub-question.
In one possible implementation, the question text belongs to a question type including: combinatorial, inferential, comparative, and/or cascaded comparative;
the determining a second prediction result based on the semantically coded representation of the question text comprises:
and determining second prediction results respectively corresponding to the question types of the question texts according to the semantic coding representation of the question texts.
In one possible implementation, the comparator module is specifically configured to:
aiming at the condition that the question type of the question text is a comparative type or a cascade comparative type, taking an answer corresponding to the last subproblem respectively corresponding to at least two question main bodies as a comparative object, and splicing the question text and the comparative object to obtain a second splicing result; and determining the final answer of the question text according to the second splicing result.
In a third aspect, an embodiment of the present application further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the steps in the first aspect and various possible implementations when executing the computer program.
In a fourth aspect, embodiments of the present application further propose a non-transitory computer-readable storage medium having stored thereon a computer program, which when executed by a processor implements the steps as in the first aspect and various possible implementations.
According to the technical scheme, the complex problem is decomposed, and three-stage problem reasoning is carried out. This way of reasoning is more closely related to human behavior patterns. The complex multi-hop reasoning problem is converted into a single-hop problem which can be solved skillfully through a problem decomposition mode. The problem relation is flexibly extracted by adopting the relation extractor to generate the sub-problem, and the problem that the traditional end-to-end reading understanding model has the understanding capability limitation on the complex problem expression is solved. Compared with an end-to-end reading understanding model, for comparison objects in a comparative problem, the comparison objects are compared in a targeted manner by adopting a comparator method, and the method has a better universal type for multi-hop problem texts with different types of the problems.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flowchart of an intelligent question-answering method for a multi-hop inference problem according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an intelligent question-answering device for a multi-hop inference problem according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention. The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present invention is not limited thereby.
It should be noted that the term "and/or" in this application is only one kind of association relationship describing the associated object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. The terms "first," "second," and "third," etc. in the description and claims of the embodiments of the present application are used for distinguishing between different objects and not for describing a particular order of the objects. For example, the first coded representation, the second coded representation, the third coded representation, and so on are used to distinguish different coded representations, rather than to describe a particular order of the target objects. In the embodiments of the present application, words such as "exemplary," "for example," or "such as" are used to mean serving as examples, illustrations, or illustrations. Any embodiment or design described herein as "exemplary," "for example," or "such as" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the words "exemplary," "for example," or "such as" are intended to present relevant concepts in a concrete fashion.
In one possible implementation, the conventional multi-hop question-and-answer model mostly adopts some end-to-end reading understanding models based on a graph structure or a graph neural network. But they have the following disadvantages in the using process:
firstly, the internal reasoning mechanism of the end-to-end reading understanding model is unclear, and an additional discriminator is usually adopted to judge whether a certain sentence is a clue sentence, so that the additional discriminator has no strong correlation with the reasoning result of the end-to-end reading understanding model, and the interpretability is not faithful enough; secondly, although the graph structure is theoretically effective for solving the multi-hop question-answering problem, recent experiments prove that the existing graph neural network is only a special attention mechanism and is not necessary for the multi-hop question-answering problem, and the same or even better effect can be achieved by only using the self-attention mechanism of the transform network instead of the graph neural network as long as the same additional adjacency matrix information is provided.
To this end, an embodiment of the present application provides a flowchart of an intelligent question-answering method for multi-hop inference questions as shown in fig. 1, where the flowchart includes: S102-S114, the complex multi-hop reasoning problem is converted into a single-hop problem which can be solved skillfully through a problem decomposition mode, and the comprehension capability limitation of the traditional end-to-end reading comprehension model to the complex multi-hop reasoning problem expression is solved.
The following describes an intelligent question-answering method for multi-hop inference questions as shown in fig. 1 provided in the embodiments of the present application in detail.
In one possible implementation, the intelligent question-answering method for multi-hop inference questions provided by the embodiment of the present application is implemented by the following steps:
s102, obtaining a question text.
In the embodiment of the present application, a question text is first acquired. Illustratively, the text of the question obtained is "the box office of the dragon crouching in tiger and the spacious wall, who is more? ".
S104, carrying out semantic coding on the question text to obtain semantic coded representation of the question text.
In the embodiment of the present application, the problem text acquired in S102 is preprocessed, and error coding and/or meaningless representation in the problem text is removed by a regular expression method, so as to obtain a clean text. For example, the clean text obtained is "who is more in the den dragon october box room". And matching the obtained clean text in the dictionary from the positive sequence direction and the negative sequence direction respectively by utilizing a forward and backward maximum word segmentation algorithm to obtain word segmentation results in the two directions. And carrying out double-Byte Encoding (BPE) on the word segmentation result to obtain a double-Byte Encoding representation. Clean text vector Representations are obtained by querying the Embedding layer of a lightweight bert (bidirectional Encoder Representations from transforms) model. And self-interactive calculation is carried out by utilizing a Transformer coding layer to obtain semantic coding representation of the problem text, and the semantic coding representation is suitable for the problem relation extraction task.
S106, determining a first prediction result according to the semantic coding representation of the question text, wherein the first prediction result is a prediction result of the position of at least one question main body of the question text.
In the embodiment of the present application, first, a Recurrent Neural Network (RNN) encoder module is constructed for semantic encoded representation of an obtained problem text, and first encoding is performed to obtain a first encoded representation, where the first encoding represents search prediction for a position where at least one problem main body of the problem text is located. Next, an attention mechanism operation is performed on the first encoded representation to obtain a first attention aware representation of the semantically encoded representation for the at least one problem subject. Then, at least two pointers are applied to the first attention perception representation through a pointer network architecture, and probability distribution of a starting point and an end point corresponding to at least one problem main body is output. And finally, determining the position of the at least one problem main body according to the probability distribution of the starting point and the ending point corresponding to the at least one problem main body.
The following description will take as an example the semantic code representation of the problem text "who is more in the box office of the juxtaposaur dragon and the october city," obtained as described above.
In the embodiment of the application, it can be known from the foregoing content that the obtained question text "who is more in the box-office of the long-closed october and the long-closed october" is preprocessed, and the obtained clean text is "who is more in the box-office of the long-closed october and the long-closed october". The clean text is further converted into a semantically encoded representation of the question text. And carrying out first coding on the converted semantic coding representation by using an RNN (radio network node) coder module to obtain a first coding representation. And performing attention mechanism operation on the first coded representation to obtain a first attention perception representation of the semantic coded representation for at least one question subject. Since the aforementioned clean text has two problem bodies, the probability distribution of the starting point and the ending point corresponding to the two problem bodies is output by applying four pointers to the first attention perception representation through the pointer network architecture. In the embodiment of the application, the first problem subject is determined to be 'crouching tiger dragon', and the second problem subject is determined to be 'October Bingcheng'.
S108, according to the semantic coding representation of the question text, determining a second prediction result, wherein the second prediction result is a prediction result of at least one question relation of the question text.
In the embodiment of the present application, a prediction result of a question type to which the question text belongs is determined according to the semantic coding representation of the question text, where the prediction result of the question type to which the question text belongs is a third prediction result. The question text belongs to the question types including: combinatorial, inferential, comparative, and/or cascaded comparative. The combination type is characterized in that two single-hop problems are connected in series, the inference type is characterized in that inference of common knowledge is needed, the comparison type is characterized in that comparison of comparison objects is needed, and the cascade comparison type is characterized in that a combination type and comparison type complex is formed. And performing maximum average pooling operation on the semantic coding expression to obtain a maximum pooling result and an average pooling result. And splicing the maximum pooling result and the average pooling result to obtain a pooling semantic code expression. The previously obtained pooled semantic code representations are converted into probability distributions for different question types by a Multi-Layer Perceptron (MLP) and logistic regression Layer. And determining the problem type corresponding to the maximum probability distribution as a prediction result of the problem type of the problem text. Taking the question text as the example of more than one in the box rooms of the clinopodium and the october city, the probability distributions of the question type combination type, the inference type, the comparison type and the cascade comparison type to which the question text belongs are respectively 10%, 70% and 10%. Therefore, it can be determined that the prediction result of the question type to which the question text belongs is a comparative type.
In the embodiment of the application, aiming at semantic coding expression of the obtained problem text, a linear classifier or a pointer network architecture is adopted, and independent relation extractors are respectively constructed for different problem types so as to obtain a second prediction result corresponding to the prediction result of the problem type to which the problem text belongs. In particular, the number of question relationships in different question texts is not necessarily required. In order to extract the problem relations by using a uniform model, the number of the problem relations is normalized in a preprocessing stage, and the problem relations are uniformly normalized into two problem relations. For a question text where the number of question relationships is one, the question relationships are repeated as two. And for the problem texts with the number of the problem relations exceeding two, combining the problem relations by utilizing human subjective judgment, and finally integrating the problem relations into two problem relations. Therefore, the relationship extractor needs to extract the predicted results of two problem relationships and pay attention to the precedence order of the problem relationships.
In the embodiment of the present application, for different application scenarios, the embodiment of the present application provides two different relationship extractors: a categorical relationship extractor or an extraction relationship extractor. For the classification formula relation extractor, a linear classifier structure is adopted, the previously obtained pooling semantic coding expression is converted into probability distribution predicted for different problem relations through an MLP and a logistic regression layer, and the probability distribution is multiplied by the probability distribution of the corresponding problem type to obtain a multiplication result. Further, the maximum probability distribution in the multiplication results is used as a prediction result of the final question relation of the question text. And for the extraction type relation extractor, constructing an RNN (radio network node) encoder module aiming at the semantic encoding expression of the obtained problem text by adopting a pointer network structure, carrying out second encoding to obtain a second encoding expression, wherein the second encoding expression is used for searching and predicting at least one problem relation of the problem text. And performing attention mechanism operation on the second coded representation to obtain a second attention perception representation of the semantic coded representation for the at least one question relation. And applying at least two pointers to the second attention perception representation through a pointer network architecture, and outputting probability distribution of a starting point and an end point corresponding to at least one problem relation. And determining second prediction results respectively corresponding to the problem types of the problem texts according to the probability distribution of the starting point and the end point corresponding to the at least one problem relation. Further, second prediction results respectively corresponding to the question types to which the question texts belong are multiplied by the probability distribution of the corresponding question types, and the prediction result of the final question relation of the question texts is determined.
In the embodiment of the present application, for example, the first problem relationship of the question text "who is more than the box rooms of the clockwork and the october city" is "the box room of the clockwork, the second problem relationship is" the box room of the october city, "the third problem relationship is" who is more than the two box rooms, "and then it can be determined that the prediction result of the final problem relationship is" who is more than the two box rooms.
S110, generating a subproblem text according to the first prediction result and the second prediction result, wherein the subproblem text comprises at least one subproblem.
In the embodiment of the present application, the simplest way is to separate one of the question body and the at least one question relationship by the first separation identifier as a sub-question, and generate a sub-question text. Or in order to increase readability, a fixed template is adopted, and the text of the subproblem is determined by adopting different templates according to the type (time, place and person) of the problem main body and the type of at least one problem relation. Or in order to increase the diversity of sub-problem expressions, the single-hop problems in the single-hop inference data set SQuAD are utilized, the problem subjects and the problem relations of the single-hop problems are extracted, the corresponding generation models are trained, the preset training models are obtained, and the sub-problem texts are determined through the problem subjects and at least one problem relation.
By means of the problem decomposition, the complex multi-hop inference problem is converted into a single-picking problem which can be solved skillfully.
And S112, sequentially answering the at least one sub-question according to a screening document to obtain an answer corresponding to the at least one sub-question, wherein the screening document comprises the answer corresponding to the at least one sub-question.
In the embodiment of the application, a lightweight BERT model (ALBERT) is utilized, and a single-hop model of a span predictor is added to answer the subproblems one by one. Specifically, the sub-problem text, the second separation identifier and the screening document are spliced in sequence to obtain a first splicing result. And matching the first splicing result in a dictionary from the positive sequence direction and the negative sequence direction respectively by utilizing a forward and backward maximum word segmentation algorithm for the first splicing result, synthesizing word segmentation results in the two directions, and performing double-byte coding to obtain a final BPE result. And obtaining the vector representation of the first splicing result by querying an Embedding layer of the ALBERT. And carrying out third coding on the vector representation of the first splicing result, namely obtaining a third coded representation, namely the coded representation of the first splicing result containing the context semantic information through an ALBERT coding layer based on Self-orientation. Determining, using the fully connected layer, a probability distribution of a starting point and an ending point of an answer to at least one sub-question included in the sub-question text according to the third coded representation. And determining an answer corresponding to the at least one sub-question according to the probability distribution of the starting point and the ending point of the answer of the at least one sub-question included in the sub-question text. Restoring the two normalized question relations in the step S108, splicing the question main body with the first question relation to obtain a first subproblem, and determining an answer corresponding to the first subproblem as a first answer according to the steps; and splicing the first answer and the second question relationship to obtain a second subproblem, determining that the answer corresponding to the second subproblem is a second answer according to the steps, and by analogy, splicing the (N-1) th answer and the final question relationship to obtain a last subproblem, determining that the answer corresponding to the last subproblem is an Nth answer according to the steps, wherein N is the number of the subproblems and is a positive integer.
The problem relation is flexibly extracted by the relation extractor to generate the sub-problem, and the problem that the traditional end-to-end reading understanding model has the understanding capability limitation on complex problem expression is solved.
S114, determining a final answer of the question text according to the answer corresponding to the at least one sub-question.
In the embodiment of the application, aiming at the condition that the question type of the question text belongs to a combined type or an inference type, the answer corresponding to the last subproblem is determined as the final answer of the question text; or, in the case that the question type to which the question text belongs is a comparative type or a cascade comparative type, taking the answer corresponding to the last subproblem corresponding to at least two question main bodies respectively as a comparative object (for example, time, number), and splicing the question text and the comparative object to obtain a second splicing result. And inputting the second splicing result into a BERT classifier model-based quantitative relation Comparator, and comparing the second splicing result with the BERT classifier model-based quantitative relation Comparator to determine a final answer of the question text.
Compared with an end-to-end reading understanding model, the embodiment of the application has the advantages that compared objects in a comparative problem are compared in a targeted mode by adopting a comparator method, and the method is better in universality for multi-hop problem texts with different types of the problems.
Fig. 2 is a schematic structural diagram of an intelligent question-answering device for a multi-hop inference problem according to an embodiment of the present application, where the schematic structural diagram includes: the device is a three-stage multi-hop inference device based on complex question decomposition, executes multi-hop inference by adopting a complex question decomposition mode according to the behavior pattern of human answering to the complex question, and divides the multi-hop inference process into the relation extractor module 202, the reader module 204 and the comparator module 206. The device adopts the deep learning technique to accurately extract the question main body and the question relation, automatically answers each subproblem, and utilizes the comparison object contained in the question text to construct a comparator, and automatically compares and answers the comparison object of the question text.
A relationship extractor module 202, configured to obtain a question text; performing semantic coding on the problem text to obtain semantic coding representation of the problem text; determining a first prediction result according to semantic coding representation of the question text, wherein the first prediction result is a prediction result of the position of at least one question main body of the question text; determining a second prediction result according to the semantic coding representation of the question text, wherein the second prediction result is a prediction result of at least one question relation of the question text;
the reader module 204 is configured to generate a subproblem text according to the first prediction result and the second prediction result, where the subproblem text includes at least one subproblem; according to the screened documents, sequentially answering the at least one sub-question to obtain answers corresponding to the at least one sub-question;
a comparator module 206, configured to determine a final answer to the question text according to the answer corresponding to the at least one sub-question.
In one possible implementation, the question text belongs to the question types including: combinatorial, inferential, comparative, and/or cascaded comparative;
the determining a second prediction result according to the semantic code representation of the question text includes:
and determining second prediction results respectively corresponding to the problem types of the problem texts according to the semantic coding representation of the problem texts.
In one possible implementation, the comparator module 206 is specifically configured to: aiming at the condition that the question type of the question text is a comparative type or a cascade comparative type, taking the answer corresponding to the last subproblem respectively corresponding to at least two question main bodies as a comparative object, and splicing the question text and the comparative object to obtain a second splicing result; and determining the final answer of the question text according to the second splicing result.
The embodiment of the application provides computer equipment, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein when the processor executes the computer program, the processor realizes the intelligent question-answering method for the multi-hop inference problem corresponding to the method in fig. 1.
The present application provides a non-transitory computer readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements an intelligent question-answering method for a multi-hop inference problem as corresponding to fig. 1.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
It should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. An intelligent question-answering method for multi-hop inference questions, comprising:
acquiring a question text;
carrying out semantic coding on the problem text to obtain semantic coded representation of the problem text;
determining a first prediction result according to semantic coding representation of the question text, wherein the first prediction result is a prediction result of the position of at least one question main body of the question text;
determining a second prediction result according to the semantic coding representation of the question text, wherein the second prediction result is a prediction result of at least one question relation of the question text;
generating a sub-question text according to the first prediction result and the second prediction result, wherein the sub-question text comprises at least one sub-question;
sequentially answering the at least one sub-question according to a screening document to obtain an answer corresponding to the at least one sub-question, wherein the screening document comprises the answer corresponding to the at least one sub-question;
and determining a final answer of the question text according to the answer corresponding to the at least one sub-question.
2. The method of claim 1, wherein determining a first prediction result from the semantically encoded representation of the question text comprises:
performing first coding on the semantic coding representation of the problem text to obtain a first coding representation, wherein the first coding representation is used for searching and predicting the position of at least one problem main body of the problem text;
performing an attention mechanism operation on the first encoded representation to obtain a first attention perception representation of the semantically encoded representation for the at least one question body;
applying at least two pointers to the first attention perception representation through a pointer network architecture, and outputting probability distributions of a starting point and an end point corresponding to the at least one problem body;
and determining a prediction result of the position of the at least one problem main body according to the probability distribution of the starting point and the end point corresponding to the at least one problem main body.
3. The method of claim 1, further comprising:
performing maximum average pooling operation on the semantic code representation to obtain a maximum pooling result and an average pooling result;
splicing the maximum pooling result and the average pooling result to obtain a pooling semantic code representation;
determining probability distribution of different problem types according to the pooling semantic code representation;
and determining the problem type corresponding to the maximum probability distribution as a third prediction result, wherein the third prediction result is a prediction result of the problem type to which the problem text belongs.
4. The method of claim 3, further comprising:
determining probability distribution of different problem relation predictions according to the pooling semantic code representation aiming at the classification relation extractor;
multiplying the probability distribution of the different problem relation predictions by the probability distribution of the corresponding problem types to determine the final problem relation prediction result of the problem text; and/or
Second coding the semantic coding representation of the question text to obtain a second coding representation for a pull-out relationship extractor, the second coding representation being used for search prediction of at least one question relationship of the question text;
performing attention mechanism operation on the second coded representation to obtain a second attention perception representation of the semantic coded representation for the at least one question relationship;
applying at least two pointers to the second attention perception representation through a pointer network architecture, and outputting probability distributions of a starting point and an end point corresponding to the at least one problem relation;
determining a second prediction result corresponding to the prediction result of the question type to which the question text belongs according to the probability distribution of the starting point and the end point corresponding to the at least one question relation;
and multiplying a second prediction result corresponding to the prediction result of the problem type to which the problem text belongs by the probability distribution of the corresponding problem type to determine the prediction result of the final problem relation of the problem text.
5. The method of claim 1, wherein generating a sub-problem text based on the first and second predictors comprises:
determining a sub-question text according to the question body, the at least one question relationship and the first separation identifier; or
Determining a sub-problem text by adopting different templates according to the type of the problem main body and the type of the at least one problem relation; or
And determining a sub-problem text according to a preset training model and through the problem main body and the at least one problem relation.
6. The method according to claim 4, wherein said sequentially answering said at least one sub-question according to a filter document to obtain an answer corresponding to said at least one sub-question comprises:
splicing the sub-question text, the screened document and the second separation identifier to obtain a first splicing result;
performing word segmentation on the first splicing result to obtain a word segmentation result;
carrying out double-byte encoding on the word segmentation result to obtain double-byte encoding representation;
determining a vector representation of the first concatenation result from the double-byte encoded representation;
performing third coding on the vector representation of the first splicing result to obtain a third coded representation;
determining a probability distribution of a starting point and an ending point of an answer to at least one sub-question included in the sub-question text according to the third coded representation;
determining an answer corresponding to at least one sub-question according to probability distribution of a starting point and an ending point of the answer of the at least one sub-question included in the sub-question text;
splicing a question main body with a first question relation to obtain a first subproblem, and determining an answer corresponding to the first subproblem as a first answer according to the steps; and splicing the first answer and the second question in a relationship manner to obtain a second subproblem, determining that the answer corresponding to the second subproblem is a second answer according to the steps, and by analogy, splicing the (N-1) th answer and the final question in a relationship manner to obtain a final subproblem, determining that the answer corresponding to the final subproblem is an Nth answer according to the steps, wherein N is the number of the subproblems and is a positive integer.
7. The method of claim 3, wherein the question text belongs to a question type comprising: combinatorial, inferential, comparative, and/or cascaded comparative;
the method further comprises the following steps:
determining an answer corresponding to the last subproblem as a final answer of the question text aiming at the condition that the question type of the question text is a combined type or an inference type; or
Aiming at the condition that the question type of the question text is a comparative type or a cascade comparative type, taking an answer corresponding to the last subproblem respectively corresponding to at least two question main bodies as a comparative object, and splicing the question text and the comparative object to obtain a second splicing result;
and determining the final answer of the question text according to the second splicing result.
8. An intelligent question-answering device for multi-hop inference questions, comprising:
the relation extractor module is used for acquiring a question text; performing semantic coding on the problem text to obtain semantic coding representation of the problem text; determining a first prediction result according to semantic coding representation of the question text, wherein the first prediction result is a prediction result of the position of at least one question main body of the question text; determining a second prediction result according to the semantic coding representation of the question text, wherein the second prediction result is a prediction result of at least one question relation of the question text;
the reader module is used for generating a subproblem text according to the first prediction result and the second prediction result, and the subproblem text comprises at least one subproblem; according to the screened documents, sequentially answering the at least one sub-question to obtain answers corresponding to the at least one sub-question;
and the comparator module is used for determining the final answer of the question text according to the answer corresponding to the at least one sub-question.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1-7 when executing the computer program.
10. A non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202110674586.XA 2021-06-17 2021-06-17 Intelligent question answering method and device for multi-hop reasoning problem Active CN113420111B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110674586.XA CN113420111B (en) 2021-06-17 2021-06-17 Intelligent question answering method and device for multi-hop reasoning problem

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110674586.XA CN113420111B (en) 2021-06-17 2021-06-17 Intelligent question answering method and device for multi-hop reasoning problem

Publications (2)

Publication Number Publication Date
CN113420111A true CN113420111A (en) 2021-09-21
CN113420111B CN113420111B (en) 2023-08-11

Family

ID=77788956

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110674586.XA Active CN113420111B (en) 2021-06-17 2021-06-17 Intelligent question answering method and device for multi-hop reasoning problem

Country Status (1)

Country Link
CN (1) CN113420111B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114239553A (en) * 2021-12-23 2022-03-25 佳源科技股份有限公司 Log auditing method, device, equipment and medium based on artificial intelligence
CN117744795A (en) * 2023-12-08 2024-03-22 拓元(广州)智慧科技有限公司 Multi-agent collaborative knowledge reasoning framework and system based on large language model

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110245240A (en) * 2019-05-31 2019-09-17 国网电子商务有限公司 A kind of determination method and device of problem data answer
CN110389999A (en) * 2019-07-26 2019-10-29 北京香侬慧语科技有限责任公司 A kind of method, apparatus of information extraction, storage medium and electronic equipment
CN111143507A (en) * 2019-12-05 2020-05-12 重庆兆光科技股份有限公司 Reading understanding method based on composite problems
CN111324717A (en) * 2020-02-24 2020-06-23 武汉大学 Open domain question and answer oriented answer obtaining method and system based on machine reading understanding
CN111611361A (en) * 2020-04-01 2020-09-01 西南电子技术研究所(中国电子科技集团公司第十研究所) Intelligent reading, understanding, question answering system of extraction type machine
CN111782961A (en) * 2020-08-05 2020-10-16 中国人民解放军国防科技大学 Answer recommendation method oriented to machine reading understanding
CN112329435A (en) * 2020-11-27 2021-02-05 腾讯科技(深圳)有限公司 Text processing method and device, computer equipment and storage medium
CN112380326A (en) * 2020-10-10 2021-02-19 中国科学院信息工程研究所 Question answer extraction method based on multilayer perception and electronic device
CN112417104A (en) * 2020-12-04 2021-02-26 山西大学 Machine reading understanding multi-hop inference model and method with enhanced syntactic relation
CN112506949A (en) * 2020-12-03 2021-03-16 北京百度网讯科技有限公司 Method and device for generating query statement of structured query language and storage medium
WO2021109690A1 (en) * 2020-06-17 2021-06-10 平安科技(深圳)有限公司 Multi-type question smart answering method, system and device, and readable storage medium
CN112948546A (en) * 2021-01-15 2021-06-11 中国科学院空天信息创新研究院 Intelligent question and answer method and device for multi-source heterogeneous data source

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110245240A (en) * 2019-05-31 2019-09-17 国网电子商务有限公司 A kind of determination method and device of problem data answer
CN110389999A (en) * 2019-07-26 2019-10-29 北京香侬慧语科技有限责任公司 A kind of method, apparatus of information extraction, storage medium and electronic equipment
CN111143507A (en) * 2019-12-05 2020-05-12 重庆兆光科技股份有限公司 Reading understanding method based on composite problems
CN111324717A (en) * 2020-02-24 2020-06-23 武汉大学 Open domain question and answer oriented answer obtaining method and system based on machine reading understanding
CN111611361A (en) * 2020-04-01 2020-09-01 西南电子技术研究所(中国电子科技集团公司第十研究所) Intelligent reading, understanding, question answering system of extraction type machine
WO2021109690A1 (en) * 2020-06-17 2021-06-10 平安科技(深圳)有限公司 Multi-type question smart answering method, system and device, and readable storage medium
CN111782961A (en) * 2020-08-05 2020-10-16 中国人民解放军国防科技大学 Answer recommendation method oriented to machine reading understanding
CN112380326A (en) * 2020-10-10 2021-02-19 中国科学院信息工程研究所 Question answer extraction method based on multilayer perception and electronic device
CN112329435A (en) * 2020-11-27 2021-02-05 腾讯科技(深圳)有限公司 Text processing method and device, computer equipment and storage medium
CN112506949A (en) * 2020-12-03 2021-03-16 北京百度网讯科技有限公司 Method and device for generating query statement of structured query language and storage medium
CN112417104A (en) * 2020-12-04 2021-02-26 山西大学 Machine reading understanding multi-hop inference model and method with enhanced syntactic relation
CN112948546A (en) * 2021-01-15 2021-06-11 中国科学院空天信息创新研究院 Intelligent question and answer method and device for multi-source heterogeneous data source

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114239553A (en) * 2021-12-23 2022-03-25 佳源科技股份有限公司 Log auditing method, device, equipment and medium based on artificial intelligence
CN117744795A (en) * 2023-12-08 2024-03-22 拓元(广州)智慧科技有限公司 Multi-agent collaborative knowledge reasoning framework and system based on large language model

Also Published As

Publication number Publication date
CN113420111B (en) 2023-08-11

Similar Documents

Publication Publication Date Title
CN112633010B (en) Aspect-level emotion analysis method and system based on multi-head attention and graph convolution network
CN111897941A (en) Dialog generation method, network training method, device, storage medium and equipment
CN111930914B (en) Problem generation method and device, electronic equipment and computer readable storage medium
CN111046132A (en) Customer service question and answer processing method and system for retrieving multiple rounds of conversations
CN113127624B (en) Question-answer model training method and device
CN113268609A (en) Dialog content recommendation method, device, equipment and medium based on knowledge graph
CN111597341B (en) Document-level relation extraction method, device, equipment and storage medium
CN113420111B (en) Intelligent question answering method and device for multi-hop reasoning problem
CN111026840A (en) Text processing method, device, server and storage medium
CN111767697B (en) Text processing method and device, computer equipment and storage medium
CN116821301A (en) Knowledge graph-based problem response method, device, medium and computer equipment
CN117313728A (en) Entity recognition method, model training method, device, equipment and storage medium
CN117493505A (en) Intelligent question-answering method, device, equipment and storage medium
CN116975288A (en) Text processing method and text processing model training method
CN113741759B (en) Comment information display method and device, computer equipment and storage medium
CN116702094B (en) Group application preference feature representation method
CN114611529B (en) Intention recognition method and device, electronic equipment and storage medium
CN113157892B (en) User intention processing method, device, computer equipment and storage medium
CN114330701A (en) Model training method, device, computer equipment, storage medium and program product
CN114003708A (en) Automatic question answering method and device based on artificial intelligence, storage medium and server
CN113569867A (en) Image processing method and device, computer equipment and storage medium
CN111428005A (en) Standard question and answer pair determining method and device and electronic equipment
CN116561350B (en) Resource generation method and related device
CN114840697B (en) Visual question-answering method and system for cloud service robot
Narayanan et al. Towards open ended and free form visual question answering: Modeling vqa as a factoid question answering problem

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