CN113420111B - Intelligent question answering method and device for multi-hop reasoning problem - Google Patents

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

Info

Publication number
CN113420111B
CN113420111B CN202110674586.XA CN202110674586A CN113420111B CN 113420111 B CN113420111 B CN 113420111B CN 202110674586 A CN202110674586 A CN 202110674586A CN 113420111 B CN113420111 B CN 113420111B
Authority
CN
China
Prior art keywords
question
sub
text
prediction result
determining
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.)
Active
Application number
CN202110674586.XA
Other languages
Chinese (zh)
Other versions
CN113420111A (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

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 reasoning, wherein the method comprises the following steps: acquiring a question text; carrying out semantic coding on the problem text to obtain semantic coding representation of the problem text; 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 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; according to the screening document, sequentially answering at least one sub-question 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.

Description

Intelligent question answering method and device for multi-hop reasoning problem
Technical Field
The application relates to the technical field of natural language processing. In particular to an intelligent question answering method and device for multi-hop reasoning questions.
Background
The multi-hop reasoning system is an important technology for intelligently analyzing complex question descriptions and searching a plurality of clues to answer in the intelligent question-answering service scene, and is an important component of the intelligent question-answering service scene.
Deep learning technology has made great progress in traditional single-hop reading and understanding tasks, achieving a level of comparability to humans, but many single-hop reading and understanding tasks can be answered by simple question-to-paragraph sentence matching, and do not involve complex reasoning.
In order for the machine to learn true reasoning capabilities, a number of high quality multi-hop question-answering data sets have recently been proposed, such as HotpotQA, complexWebQuestions, QAngarooWikiHop, R C, 2wikimulti hopqa, etc. These multi-hop question-and-answer tasks are more challenging than traditional reading understanding tasks, with the difficulty mainly manifested in: 1. the machine is required to find clues at several very remote locations in a large number of paragraphs to complete reasoning; 2. the machine is required to have a certain interpretability while finishing reasoning; 3. the machine is required to be capable of adapting to complex and changeable question types and answer types, and can better integrate clues to obtain answers.
The traditional multi-hop question-answering model is mostly a read understanding model based on graph structures or graph neural networks end to end. While these works perform well on many tasks, they also have considerable limitations.
Firstly, the internal reasoning mechanism of the end-to-end reading and understanding model is unclear, and an extra discriminator is usually adopted to judge whether a sentence is a clue sentence or not, so that the extra discriminator has no strong correlation with the reasoning result of the end-to-end reading and understanding model, and the interpretation 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, is not necessary for the multi-hop question-answering problem, and can achieve the same or even better effect by only replacing the graph neural network with the self-answer mechanism of the Transformer 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.
In a first aspect, an embodiment of the present application provides an intelligent question answering method for a multi-hop reasoning problem, including:
acquiring a question text;
carrying out semantic coding on the question text to obtain a semantic coding representation of the question text;
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;
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 the first prediction result according to the semantically encoded representation of the question text includes:
performing first coding on the semantic coding representation of the question text to obtain a first coding representation, wherein the first coding representation is used for searching and predicting the position of at least one question main body of the question text;
performing an attention mechanism operation on the first encoded representation to obtain a first attention-aware representation of the semantic encoded representation for the at least one problem body;
applying at least two pointers to the first attention perception representation through a pointer network architecture, and outputting probability distribution of a starting point and an ending point corresponding to the at least one problem main body;
and determining a prediction result of the position of the at least one problem body according to probability distribution of the starting point and the ending point corresponding to the at least one problem body.
In one possible implementation, the method further comprises:
carrying out 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 pooling semantic coding representation;
determining probability distribution of different problem types according to the pooled semantic coding representation;
and determining the question type corresponding to the largest probability distribution as a third prediction result, wherein the third prediction result is the prediction result of the question type to which the question text belongs.
In one possible implementation, the method further comprises:
aiming at the classification relation extractor, determining probability distribution of different problem relation predictions according to the pooled semantic coding representation;
multiplying the probability distribution of the different problem relation predictions with the probability distribution of the corresponding problem type, and determining a final problem relation prediction result of the problem text; and/or
Performing second encoding on the semantic encoded representation of the question text for an extraction relationship extractor to obtain a second encoded representation, the second encoded representation being used for a lookup prediction of at least one question relationship of the question text;
performing an attention mechanism operation on the second encoded representation to obtain a second attention-aware representation of the semantic encoded representation for the at least one problem relationship;
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 ending 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 ending point corresponding to the at least one question relation;
multiplying a second prediction result corresponding to the prediction result of the question type to which the question text belongs by the probability distribution of the corresponding question type, and determining the prediction result of the final question relation of the question text.
In one possible implementation, the generating the sub-question 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 relation and the first separation identifier; or (b)
Determining a sub-question text by adopting different templates according to the type of the question main body and the type of the at least one question relation; or (b)
And determining the sub-question text according to a preset training model through the question main body and the at least one question 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 screening document and the second separation identifier to obtain a first splicing result;
word segmentation is carried out on the first splicing result, and a word segmentation result is obtained;
performing double-byte coding on the word segmentation result to obtain double-byte coding representation;
determining a vector representation of the first splice result from the double-byte encoded representation;
performing third coding on the vector representation of the first splicing result to obtain a third coding representation;
determining a probability distribution of a start point and an end 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 start point and an end point of the answer of the at least one sub-question included in the sub-question text;
the method comprises the steps of splicing a question main body with a first question relation to obtain a first sub-question, and determining an answer corresponding to the first sub-question as a first answer according to the steps; and splicing the first answer and the second question relation to obtain a second sub-question, determining that the answer corresponding to the second sub-question is the second answer according to the steps, and so on, splicing the N-1 th answer and the final question relation to obtain a last sub-question, determining that the answer corresponding to the last sub-question is the N-th answer according to the steps, wherein N is the number of the sub-questions and is a positive integer.
In one possible implementation, the question text includes the question types: a combined, an inferred, a compared, and/or a cascade compared;
the method further comprises the steps of:
aiming at the situation that the question type to which the question text belongs is a combined type or an inference type, determining an answer corresponding to the last sub-question as a final answer of the question text; or (b)
Aiming at the situation that the question type of the question text is of a comparison type or a cascade comparison type, taking answers corresponding to the last sub-questions respectively corresponding to at least two question main bodies as comparison objects, and splicing the question text and the comparison objects to obtain a second splicing result;
and determining a final answer of the question text according to the second splicing result.
In a second aspect, an embodiment of the present application proposes an intelligent question answering apparatus for multi-hop reasoning questions, including:
the relation extractor module is used for acquiring a problem text; carrying out semantic coding on the question text to obtain semantic coding representation of the question text; 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; 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 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; according to the screening document, sequentially answering the at least one sub-question to obtain an answer corresponding to the at least one sub-question;
and the comparator module is used for 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 question text includes the question types: a combined, an inferred, a compared, and/or a cascade compared;
the determining a second prediction result according to the semantic coding representation of the question text comprises:
and determining second prediction results corresponding to the question types to which the question text belongs respectively according to the semantic coding representation of the question text.
In one possible implementation, the comparator module is specifically configured to:
aiming at the situation that the question type of the question text is of a comparison type or a cascade comparison type, taking answers corresponding to the last sub-questions respectively corresponding to at least two question main bodies as comparison objects, and splicing the question text and the comparison objects to obtain a second splicing result; and determining a final answer of the question text according to the second splicing result.
In a third aspect, embodiments of the present application also provide a computer apparatus comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps as in the first aspect and various possible implementations when executing the computer program.
In a fourth aspect, embodiments of the present application also provide 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 in various possible implementations.
According to the technical scheme, the embodiment of the application decomposes the complex problem and performs three-section problem reasoning. This way of reasoning is more closely related to the behavior pattern of humans. The complex multi-hop reasoning problem is converted into the single-hop problem which can be solved by the skilled method through the problem decomposition. The relation extractor is adopted to flexibly extract the problem relation to generate the sub-problem, so that the limitation of the understanding capability of the traditional end-to-end reading understanding model to complex problem expression is solved. Compared with an end-to-end reading understanding model, the method adopting the comparator can purposefully compare comparison objects in comparison type problems, and has better general type for multi-jump problem texts with different types of the problems.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions of the prior art, the drawings that are necessary for the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application and that other drawings can be obtained from these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of an intelligent question-answering method for multi-hop reasoning questions according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an intelligent question-answering device for multi-hop reasoning according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. The following examples are only for more clearly illustrating the technical aspects of the present application, and are not intended to limit the scope of the present application.
It should be noted that, in the present application, the term "and/or" is merely an association relationship describing the association object, and indicates that three relationships may exist, for example, a and/or B may indicate: a exists alone, A and B exist together, and B exists alone. The terms first, second, third and the like in the description and in the claims of embodiments of the application, are used for distinguishing between different objects and not necessarily for describing a particular sequential or chronological order of the objects. For example, the first, second, third, etc. coded representations are used to distinguish between different coded representations, and are not used to describe a particular order of the target object. In embodiments of the application, words such as "exemplary," "for example," or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary," "by way of example," or "such as" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "by way of example," or "such as" is intended to present related concepts in a concrete fashion.
In one possible implementation, the traditional multi-hop question-answering model mostly adopts a number of end-to-end reading understanding models based on graph structures or graph neural networks. But they have the following drawbacks during use:
firstly, the internal reasoning mechanism of the end-to-end reading and understanding model is unclear, and an extra discriminator is usually adopted to judge whether a sentence is a clue sentence or not, so that the extra discriminator has no strong correlation with the reasoning result of the end-to-end reading and understanding model, and the interpretation 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, is not necessary for the multi-hop question-answering problem, and can achieve the same or even better effect by only replacing the graph neural network with the self-answer mechanism of the Transformer network as long as the same additional adjacency matrix information is provided.
To this end, an embodiment of the present application proposes a flow chart of an intelligent question-answering method for multi-hop reasoning as shown in fig. 1, where the flow chart includes: S102-S114, the complex multi-hop reasoning problem is converted into the single-hop problem which can be solved skillfully by a problem decomposition mode, and the limitation of the traditional end-to-end reading understanding model on the understanding capability of the complex multi-hop reasoning problem expression is solved.
An intelligent question-answering method for multi-hop reasoning questions as shown in fig. 1 provided by the embodiment of the application is described in detail below.
In one possible implementation, the intelligent question answering method for the multi-hop reasoning problem provided by the embodiment of the application is implemented through the following steps:
s102, acquiring a question text.
In the embodiment of the application, a question text is acquired first. Illustratively, the question text obtained is "sleeping tibetan and the box office in the city of October, who is more? ".
S104, carrying out semantic coding on the question text to obtain a semantic coding representation of the question text.
In the embodiment of the application, the problem text acquired in the step S102 is preprocessed, and error codes and/or nonsensical representations in the problem text are removed by a regular expression method so as to acquire clean text. For example, the obtained clean text is "crouching tiger Tibetan october wall box office more. And matching the obtained clean texts 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 performing double-byte encoding (Byte Pair Encoding, BPE) on the word segmentation result to obtain a double-byte encoding representation. The vector representation of the clean text is obtained by querying an Embedding layer of a lightweight BERT (Bidirectional Encoder Representations from Transformers) model. And performing self-interaction calculation by using a transducer coding layer to obtain a semantic coding representation of the problem text, wherein 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 the prediction result of the position of at least one question body of the question text.
In an embodiment of the present application, first, a recurrent neural network (Recurrent Neural Network, RNN) encoder module is constructed for a semantic encoded representation of an obtained question text, and a first encoded representation is obtained, where the first encoded representation is used for a search prediction of a location of at least one question body of the question text. Next, an attention mechanism operation is performed on the first encoded representation to obtain a first attention-aware representation of the semantic encoded representation for the at least one problem subject. Then, applying at least two pointers to the first attention-aware representation through the pointer network architecture, outputting probability distributions for the start point and the end point corresponding to the at least one problem body. And finally, determining the position of the at least one problem body according to probability distribution of the starting point and the ending point corresponding to the at least one problem body.
The semantic code expression of the above-obtained question text "crouching's Tibet Dragon and the box office in October wall" will be described below as an example.
In the embodiment of the application, the obtained question text, namely, the "sleeping tibetan dragon and the ticket houses in the October wall" are more, and the obtained clean text after pretreatment is the "sleeping tibetan dragon and the ticket houses in the October wall" are more. The clean text is further converted into a semantically encoded representation of the question text. And performing first coding on the converted semantic coding representation by using an RNN coder module to obtain a first coding representation. An attention mechanism operation is performed on the first encoded representation to obtain a first attention-aware representation of the semantic encoded representation for at least one problem subject. Since the clean text has two question bodies, four pointers are applied to the first attention perception representation through the pointer network architecture, and probability distributions of starting points and ending points corresponding to the two question bodies are output. In the embodiment of the application, the first determined main body of the problem is 'Tibet dragon', and the second determined main body of the problem is 'Yue Ying'.
S108, determining a second prediction result according to the semantic coding representation of the question text, wherein the second prediction result is the prediction result of at least one question relation of the question text.
In the embodiment of the application, according to the semantic coding representation of the question text, a prediction result of the question type to which the question text belongs is determined, wherein the prediction result of the question type to which the question text belongs is a third prediction result. The question types to which the above-mentioned question text belongs include: a combinatorial, an inference, a comparison, and/or a cascade comparison. The combination type is characterized in that two single-hop problems are connected in series, the inference type is characterized in that the inference of common sense knowledge is required, the comparison type is characterized in that the comparison of comparison objects is required, and the cascade comparison type is characterized in that the combination type and the comparison type are combined. And carrying out maximum average pooling operation on the semantic code representation to obtain a maximum pooling result and an average pooling result. And splicing the maximum pooling result and the average pooling result to obtain the pooling semantic coding representation. The previously obtained pooled semantic encoded representation is transformed into probability distributions for different problem types by a Multi-Layer Perceptron (MLP) and logistic regression Layer. And determining the question type corresponding to the maximum probability distribution as a prediction result of the question type to which the question text belongs. Taking the problem text as a box office of Tibet dragon and October city, and more, determining that the probability distribution of the problem type combination type, the inference type, the comparison type and the cascade comparison type to which the problem text belongs is 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 of a comparative type.
In the embodiment of the application, aiming at the semantic coding representation of the obtained question text, a linear classifier or a pointer network architecture is adopted to respectively construct independent relation extractors for different question types so as to obtain a second prediction result corresponding to the prediction result of the question type to which the question text belongs. Specifically, the number of question relations in the different question texts is not necessarily. In order to extract the problem relations by using a unified model, the number of the problem relations is normalized in a preprocessing stage, and the problem relations are unified into two problem relations. For a question text in which the number of question relations is one, the question relations are repeated as two. And combining the problem texts with the number of the problem relations exceeding two by utilizing human subjective judgment, and finally integrating the problem texts into two problem relations. Therefore, the relationship extractor needs to extract the prediction results of the two problem relationships, and needs to pay attention to the order of the problem relationships.
In the embodiment of the application, for different application scenes, two different relation extractors are provided in the embodiment of the application: a categorical relationship extractor or a decimated relationship extractor. And for the classification relation extractor, a linear classifier structure is adopted, the pooled semantic coding representation obtained before is converted into probability distribution predicted for different problem relation through an MLP and a logistic regression layer, and the probability distribution of the corresponding problem type is multiplied to obtain a multiplication result. Further, the largest probability distribution in the multiplication result is used as a prediction result of the final problem relation of the problem text. For the extraction relation extractor, a pointer network structure is adopted, an RNN encoder module is constructed aiming at the semantic coding representation of the obtained problem text, and second coding is carried out to obtain a second coding representation, wherein the second coding representation is used for searching and predicting at least one problem relation of the problem text. An attention mechanism operation is performed on the second encoded representation to obtain a second attention-aware representation of the semantic encoded representation for the at least one problem relationship. 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 ending point corresponding to at least one problem relation. And determining second prediction results corresponding to the question types to which the question text belongs respectively according to probability distribution of the starting point and the ending point corresponding to at least one question relation. Further, multiplying the second prediction results corresponding to the question types to which the question text belongs with probability distributions of the corresponding question types respectively, and determining the prediction result of the final question relation of the question text.
In the embodiment of the application, the first question relation of the question text ' sleeping tibetan dragon and the ticket houses in the October wall ', who is more ' is ' sleeping tibetan dragon ' and the second question relation is ' the ticket houses in the October wall ', and the third question relation is ' two ticket houses are more ', so that the prediction result of the final question relation can be determined as ' two ticket houses are more '.
S110, 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.
In the embodiment of the application, one of the question main body and at least one question relation is separated by a first separation identifier in the simplest way to be used as a sub-question, and a sub-question text is generated. Or to increase readability, a fixed template is used, and a different template is used to determine the sub-question text based on the type of question body (time, place, person) and the type of at least one question relationship. Or in order to increase the diversity of the sub-problem expression, extracting the problem main body and the problem relation of the single-hop inference data set SQUAD by utilizing the single-hop problems in the single-hop inference data set, training a corresponding generation model to obtain a preset training model, and determining the sub-problem text through the problem main body and at least one problem relation.
By means of the problem decomposition, the complex multi-hop reasoning problem is converted into a single-hop problem which can be solved skillfully.
S112, sequentially answering the at least one sub-question according to a screening document, and obtaining 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 (A Lite BERT, ALBERT) is utilized, and the single-hop model of the span predictor is used for answering the sub-questions one by one. Specifically, the sub-question text, the second separation identifier and the screening document are spliced in sequence, and a first splicing result is obtained. And matching the first splicing result in a dictionary from the positive sequence and the negative sequence respectively by utilizing a forward and backward maximum word segmentation algorithm on 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 ALBERT. And performing third coding on the vector representation of the first splicing result, namely obtaining a third coding representation, namely the coding representation of the first splicing result containing the context semantic information, through an ALBERT Self-attribute-based coding layer. According to the third coded representation, a probability distribution of a start point and an end point of an answer to at least one sub-question included in the sub-question text is determined using the full connection layer. And determining an answer corresponding to the at least one sub-question according to probability distribution of a start point and an end 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 sub-question, and determining an answer corresponding to the first sub-question as a first answer according to the steps; and splicing the first answer and the second question relation to obtain a second sub-question, determining that the answer corresponding to the second sub-question is the second answer according to the steps, and so on, splicing the N-1 answer and the final question relation to obtain the last sub-question, determining that the answer corresponding to the last sub-question is the N answer according to the steps, wherein N is the number of the sub-questions and is a positive integer.
The embodiment of the application adopts the relation extractor to flexibly extract the problem relation to generate the sub-problem, and solves the problem that the traditional end-to-end reading and understanding model has limitation on the understanding capability of complex problem expression.
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 situation that the question type of the question text is a combined type or an inference type, determining the answer corresponding to the last sub-question as the final answer of the question text; or aiming at the situation that the question type to which the question text belongs is of a comparison type or a cascade comparison type, taking answers corresponding to the last sub-questions respectively corresponding to at least two question main bodies as comparison objects (for example, time sequence and quantity), and splicing the question text and the comparison objects to obtain a second splicing result. And inputting the second splicing result into a quantitative relation Comparator calculator based on the BERT classifier model for comparison, and determining a final answer of the question text.
Compared with an end-to-end reading and understanding model, the embodiment of the application adopts a comparator method to purposefully compare comparison objects in comparison type problems, and has better general type 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 multi-hop reasoning according to an embodiment of the present application, where the schematic structural diagram includes: the relationship extractor module 202, the reader module 204 and the comparator module 206 are three-stage multi-hop reasoning devices based on complex problem decomposition, perform multi-hop reasoning in a manner of complex problem decomposition by imitating the behavior pattern of human beings for complex problem answers, and divide the multi-hop reasoning process into the relationship extractor module 202, the reader module 204 and the comparator module 206. The device adopts a deep learning technology to accurately extract a question main body and a question relation, automatically answer each sub-question, and utilizes comparison objects contained in a question text to construct a comparator, so as to automatically compare and answer the comparison objects of the question text.
A relationship extractor module 202 for obtaining a question text; carrying out semantic coding on the question text to obtain semantic coding representation of the question text; 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; 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;
a reader module 204, configured to generate a sub-question text according to the first prediction result and the second prediction result, where the sub-question text includes at least one sub-question; according to the screening document, sequentially answering the at least one sub-question to obtain an answer corresponding to the at least one sub-question;
and the comparator module 206 is configured to determine a final answer of the question text according to the answer corresponding to the at least one sub-question.
In one possible implementation, the question types to which the question text belongs include: a combined, an inferred, a compared, and/or a cascade compared;
determining a second prediction result according to the semantic coding representation of the question text, wherein the method comprises the following steps:
and determining second prediction results corresponding to the question types to which the question text belongs respectively according to the semantic coding representation of the question text.
In one possible implementation, the comparator module 206 is specifically configured to: aiming at the situation that the question type to which the question text belongs is of a comparison type or a cascade comparison type, taking answers corresponding to the last sub-questions respectively corresponding to at least two question main bodies as comparison objects, and splicing the question text and the comparison objects to obtain a second splicing result; and determining a final answer of the question text according to the second splicing result.
The embodiment of the application provides a computer device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes an intelligent question-answering method for multi-hop reasoning problems as shown in figure 1 when executing the computer program.
Embodiments of the present application provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements an intelligent question-answering method for multi-hop reasoning problems as corresponding to fig. 1.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present application without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
It should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. An intelligent question-answering method for multi-hop reasoning questions, comprising:
acquiring a question text;
carrying out semantic coding on the question text to obtain a semantic coding representation of the question text;
determining a first prediction result according to the semantic coding representation of the question text and probability distribution of a starting point and an ending point corresponding to at least one question main body, wherein the first prediction result is a prediction result of the position of the at least one question main body of the question text;
according to the semantic coding representation of the question text, determining probability distribution of different question types; determining a problem type corresponding to the largest 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; determining a second predicted result through the third predicted result, wherein the second predicted result is a predicted result of at least one problem relation of the problem text;
respectively constructing independent relation extractors for different question types to obtain a second prediction result corresponding to the prediction result of the question type to which the question text belongs, multiplying the second prediction result by probability distribution of the corresponding question type, and determining a prediction result of a final 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 the first prediction result based on probability distributions of start points and end points corresponding to at least one problem body comprises:
performing first coding on the semantic coding representation of the question text to obtain a first coding representation, wherein the first coding representation is used for searching and predicting the position of at least one question main body of the question text;
performing an attention mechanism operation on the first encoded representation to obtain a first attention-aware representation of the semantic encoded representation for the at least one problem body;
and applying at least two pointers to the first attention perception representation through a pointer network architecture, and outputting probability distribution of a starting point and an ending point corresponding to the at least one problem main body.
3. The method of claim 1, wherein the obtaining of the third prediction result comprises:
carrying out 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 pooling semantic coding representation;
determining probability distribution of different problem types according to the pooled semantic coding representation;
and determining the question type corresponding to the largest probability distribution as a third prediction result, wherein the third prediction result is the prediction result of the question type to which the question text belongs.
4. A method according to any one of claims 1 or 3, wherein said determining a prediction of a final question relationship of said question text comprises:
aiming at the classification relation extractor, determining probability distribution of different problem relation predictions according to the pooled semantic coding representation;
multiplying the probability distribution predicted by the different question relations with the probability distribution of the corresponding question type to determine the prediction result of the final question relation of the question text; and/or
Performing second encoding on the semantic encoded representation of the question text for an extraction relationship extractor to obtain a second encoded representation, the second encoded representation being used for a lookup prediction of at least one question relationship of the question text;
performing an attention mechanism operation on the second encoded representation to obtain a second attention-aware representation of the semantic encoded representation for the at least one problem relationship;
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 ending 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 ending point corresponding to the at least one question relation;
multiplying a second prediction result corresponding to the prediction result of the question type to which the question text belongs by the probability distribution of the corresponding question type, and determining the prediction result of the final question relation of the question text.
5. The method of claim 1, wherein generating the sub-question text from the first prediction result and the second prediction result comprises:
determining a sub-question text according to the question body, the at least one question relation and the first separation identifier; or (b)
Determining a sub-question text by adopting different templates according to the type of the question main body and the type of the at least one question relation; or (b)
And determining the sub-question text according to a preset training model through the question main body and the at least one question relation.
6. The method of claim 4, wherein 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, comprises:
splicing the sub-question text, the screening document and the second separation identifier to obtain a first splicing result;
word segmentation is carried out on the first splicing result, and a word segmentation result is obtained;
performing double-byte coding on the word segmentation result to obtain double-byte coding representation;
determining a vector representation of the first splice result from the double-byte encoded representation;
performing third coding on the vector representation of the first splicing result to obtain a third coding representation;
determining a probability distribution of a start point and an end 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 start point and an end point of the answer of the at least one sub-question included in the sub-question text;
the method comprises the steps of splicing a question main body with a first question relation to obtain a first sub-question, and determining an answer corresponding to the first sub-question as a first answer according to the steps; and splicing the first answer and the second question relation to obtain a second sub-question, determining that the answer corresponding to the second sub-question is the second answer according to the steps, and so on, splicing the N-1 th answer and the final question relation to obtain a last sub-question, determining that the answer corresponding to the last sub-question is the N-th answer according to the steps, wherein N is the number of the sub-questions and is a positive integer.
7. The method of claim 3, wherein the question text belongs to a question type comprising: a combined, an inferred, a compared, and/or a cascade compared;
the method further comprises the steps of:
aiming at the situation that the question type to which the question text belongs is a combined type or an inference type, determining an answer corresponding to the last sub-question as a final answer of the question text; or (b)
Aiming at the situation that the question type of the question text is of a comparison type or a cascade comparison type, taking answers corresponding to the last sub-questions respectively corresponding to at least two question main bodies as comparison objects, and splicing the question text and the comparison objects to obtain a second splicing result;
and determining a final answer of the question text according to the second splicing result.
8. An intelligent question answering device for multi-hop reasoning questions, comprising:
the relation extractor module is used for acquiring a problem text; carrying out semantic coding on the question text to obtain semantic coding representation of the question text; determining a first prediction result according to the semantic coding representation of the question text and probability distribution of a starting point and an ending point corresponding to at least one question main body, wherein the first prediction result is a prediction result of the position of the at least one question main body of the question text; according to the semantic coding representation of the question text, determining probability distribution of different question types; determining a problem type corresponding to the largest 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; determining a second predicted result through the third predicted result, wherein the second predicted result is a predicted result of at least one problem relation of the problem text; respectively constructing independent relation extractors for different question types to obtain a second prediction result corresponding to the prediction result of the question type to which the question text belongs, multiplying the second prediction result by probability distribution of the corresponding question type, and determining a prediction result of a final question relation of the question text;
the reader module is used for 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; according to the screening document, sequentially answering the at least one sub-question to obtain an answer corresponding to the at least one sub-question;
and the comparator module is used for determining a 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, wherein the processor implements the method of any of claims 1-7 when executing the computer program.
10. A non-transitory computer readable storage medium, having stored thereon a computer program, which when executed by a processor, implements the method according to any of claims 1-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 CN113420111A (en) 2021-09-21
CN113420111B true 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)

Families Citing this family (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

Also Published As

Publication number Publication date
CN113420111A (en) 2021-09-21

Similar Documents

Publication Publication Date Title
CN110534087B (en) Text prosody hierarchical structure prediction method, device, equipment and storage medium
CN108153913B (en) Training method of reply information generation model, reply information generation method and device
CN112633010B (en) Aspect-level emotion analysis method and system based on multi-head attention and graph convolution network
CN113420111B (en) Intelligent question answering method and device for multi-hop reasoning problem
CN111831789A (en) Question-answer text matching method based on multilayer semantic feature extraction structure
CN113987147A (en) Sample processing method and device
CN114676234A (en) Model training method and related equipment
CN111767697B (en) Text processing method and device, computer equipment and storage medium
CN116341562A (en) Similar problem generation method based on Unilm language model
CN113392265A (en) Multimedia processing method, device and equipment
CN116050496A (en) Determination method and device, medium and equipment of picture description information generation model
CN117313728A (en) Entity recognition method, model training method, device, equipment and storage medium
CN111597816A (en) Self-attention named entity recognition method, device, equipment and storage medium
CN117634459A (en) Target content generation and model training method, device, system, equipment and medium
CN112749556B (en) Multi-language model training method and device, storage medium and electronic equipment
CN116958738A (en) Training method and device of picture recognition model, storage medium and electronic equipment
CN116208772A (en) Data processing method, device, electronic equipment and computer readable storage medium
CN114611529A (en) Intention recognition method and device, electronic equipment and storage medium
CN114330701A (en) Model training method, device, computer equipment, storage medium and program product
CN113849624A (en) Word slot extraction device and method for multi-turn conversation
CN113569867A (en) Image processing method and device, computer equipment and storage medium
CN112052320A (en) Information processing method and device and computer readable storage medium
CN111428005A (en) Standard question and answer pair determining method and device and electronic equipment
Cao A portable English translation system through deep learning and internet of things
CN116561350B (en) Resource generation method and related device

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