CN112948546B - Intelligent question and answer method and device for multi-source heterogeneous data source - Google Patents

Intelligent question and answer method and device for multi-source heterogeneous data source Download PDF

Info

Publication number
CN112948546B
CN112948546B CN202110059191.9A CN202110059191A CN112948546B CN 112948546 B CN112948546 B CN 112948546B CN 202110059191 A CN202110059191 A CN 202110059191A CN 112948546 B CN112948546 B CN 112948546B
Authority
CN
China
Prior art keywords
answer
similarity
text
question
input
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
CN202110059191.9A
Other languages
Chinese (zh)
Other versions
CN112948546A (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.)
Aerospace Information Research Institute of CAS
Original Assignee
Aerospace Information Research Institute of CAS
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 Aerospace Information Research Institute of CAS filed Critical Aerospace Information Research Institute of CAS
Priority to CN202110059191.9A priority Critical patent/CN112948546B/en
Publication of CN112948546A publication Critical patent/CN112948546A/en
Application granted granted Critical
Publication of CN112948546B publication Critical patent/CN112948546B/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
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • 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
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/047Probabilistic or stochastic networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/049Temporal neural networks, e.g. delay elements, oscillating neurons or pulsed inputs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/04Inference or reasoning models

Landscapes

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

Abstract

The invention provides an intelligent question-answering method and device for a multi-source heterogeneous data source, wherein the method comprises the following steps: calculating a first similarity between the input question and the candidate relation; acquiring a first answer from a knowledge base according to the first similarity; searching a multi-hop text according to an input problem; calculating a second similarity between sentences in the multi-hop text and the input question and a third similarity between entities in the multi-hop text and the input question; acquiring a second answer from the multi-hop text according to the second similarity and the third similarity; and judging the relation between the first answer and the second answer, and outputting an answer text of the input question. By the intelligent question-answering method and device for the multi-source heterogeneous data source, accuracy and richness of output answers are improved, and a simple and complete answer which is easier to understand by a user can be returned.

Description

Intelligent question and answer method and device for multi-source heterogeneous data source
Technical Field
The invention relates to the technical field of deep learning and intelligent question answering, in particular to an intelligent question answering method and device for a multi-source heterogeneous data source.
Background
The realization of intelligent question answering relates to a plurality of technologies such as knowledge base question answering, information retrieval, knowledge representation and the like, and is gradually applied to scenes such as knowledge acquisition, chat robots and the like. According to the source of the question answers, the question-answering technology can be divided into two directions, wherein one direction is the knowledge base question-answering technology with answers from the structured information; another is a text question-and-answer technique where the answers are derived from unstructured information.
On one hand, with the rapid development of deep learning technology, more and more researchers try to perform short text semantic modeling on questions and knowledge of a knowledge base by using a deep neural network, and obtain the best matching knowledge as the answer of the questions by calculating the similarity between the questions and the knowledge base, the knowledge base question-answer method based on vector modeling does not need expert knowledge and manual intervention, and can ensure certain answer accuracy, but the existing vector modeling method still has some limitations: the knowledge representation of the knowledge base is not comprehensive enough and lacks knowledge base information; the model cannot distinguish literally similar knowledge and the like, and further improvement of the accuracy of the model is limited.
On the other hand, in recent years, the graph neural network has made a great progress in the field of natural language processing, and the development of the graph neural network in the multi-hop text question-answering task is promoted. The existing multi-hop text question-answering method based on the graph neural network obtains the most relevant answer clues in the text by reasoning on the constructed entity graph by using the graph neural networks such as the graph convolutional network, the graph cyclic network, the graph attention network and the like. But these methods only focus on entity information in the text; lack of filtering of noisy sentences, etc., thereby reducing the reasoning ability of the model.
In addition, the existing intelligent question-answering technology rarely researches a method for combining a multi-source heterogeneous information source and the information source to complement the advantages of the two.
Disclosure of Invention
Technical problem to be solved
Aiming at the technical problems in the prior art, the invention provides an intelligent question-answering method and device for a multi-source heterogeneous data source, which are used for at least partially solving the technical problems.
(II) technical scheme
The invention provides an intelligent question-answering method for a multi-source heterogeneous data source, which comprises the following steps: calculating a first similarity between the input question and a candidate relation, wherein the candidate relation is a relation related to the input question in a knowledge base; acquiring a first answer from a knowledge base according to the first similarity; searching a multi-hop text according to an input problem; calculating a second similarity between sentences in the multi-hop text and the input question and a third similarity between entities in the multi-hop text and the input question; acquiring a second answer from the multi-hop text according to the second similarity and the third similarity; and judging the relation between the first answer and the second answer, and outputting an answer text of the input question.
Optionally, querying the entity type of the entity in the input question in the knowledge base; acquiring the hierarchical information of a knowledge base and the literal information of input problems and candidate relations; and calculating a first similarity of the input question and the candidate relation according to the entity type, the hierarchy information and the literal information.
Optionally, calculating a first similarity between the input question and the candidate relationship according to the entity type information and the hierarchy information of the knowledge base and the literal information of the input question and the candidate relationship, including: removing entities contained in the input problems to obtain a problem template; integrating the characteristics of global information and local information of the entity type; calculating the similarity of the entity type and the candidate relationship after the feature integration to obtain a first similarity score; respectively carrying out semantic matching and literal matching on the problem template and the candidate relationship, calculating the similarity of the problem template and the candidate relationship, and obtaining a second similarity score and a third similarity score, wherein the semantic matching comprises the following steps: and dividing the candidate relation into two parts, namely mapping the relation in the entity and the problem template respectively, based on the hierarchical information of the knowledge base, and calculating to obtain a second similarity score.
Optionally, obtaining the first answer from the knowledge base according to the first similarity includes: and obtaining a candidate relation which is most matched with the input question according to the first similarity score, the second similarity score and the third similarity score, carrying out entity detection on the input question according to the candidate relation which is most matched with the input question to obtain a subject entity, and obtaining a first answer according to the subject entity.
Optionally, calculating a second similarity between a sentence in the multi-hop text and the input question and a third similarity between an entity in the multi-hop text and the input question comprises: screening sections associated with the input problem and splicing the sections into a long text; coding the long text and the input problem, and calculating the attention expression of the coded long text and the input problem; respectively taking sentences and entities in the long text as nodes, constructing a sentence graph neural network and an entity graph neural network, and reasoning to obtain coarse-grained graph neural network information and fine-grained graph neural network information; based on the attention representation, a global representation of the long text is computed using a self-attention mechanism.
Optionally, obtaining a second answer from the multi-hop text according to the second similarity and the third similarity, including: and fusing the global representation of the long text with the coarse-grained graph neural network information and the fine-grained graph neural network information, and predicting clue sentences, answer starting words and answer ending words of the fused long text to obtain a second answer.
Alternatively, a first similarity of the input problem to the candidate relationship may be calculated, using opponent training to introduce an input vector with interference capability.
Optionally, determining a relationship between the first answer and the second answer comprises: vector-coding the first answer and the second answer; and inputting the first answer and the second answer after vector coding into a classifier to obtain a relation, judging the relation to be inclusive or independent or contradictory, and combining the independent first answer and the independent second answer to obtain a combined answer text.
Optionally, outputting the answer text of the input question, including: outputting the implied first answer or the implied second answer; or outputting the merged answer text; or outputting a first answer and a second answer which are contradictory; and outputting the basis of obtaining the answer text.
Another aspect of the present invention provides an intelligent question answering apparatus for a multi-source heterogeneous data source, including: the question input module is used for inputting questions; the knowledge base question-answering module is used for calculating first similarity of the input questions and candidate relations, wherein the candidate relations are relations related to the input questions in the knowledge base; acquiring a first answer from a knowledge base according to the first similarity; the multi-hop text question-answering module is used for retrieving a multi-hop text according to an input question; calculating a second similarity between sentences in the multi-hop text and the input question and a third similarity between entities in the multi-hop text and the input question; acquiring a second answer from the multi-hop text according to the second similarity and the third similarity; the answer fusion module is used for judging the relationship between the first answer and the second answer to obtain an answer text of the input question; and the answer output module is used for outputting the answer text of the input question.
(III) advantageous effects
The invention provides an intelligent question-answering method and device facing a multi-source heterogeneous data source, which can fully understand and represent knowledge through multi-angle knowledge base information by simultaneously searching relevant answers of input questions from a structured knowledge base and an unstructured text, can greatly enrich answer contents through detection of a multi-hop text, can fully utilize multi-source heterogeneous information to return answers by combining the two, can better integrate more knowledge through integrating the knowledge base information and text semantic information compared with a single information source, provides more information sources and supports for answer reasoning, retains the advantages of accuracy and convenience of obtaining answers by the knowledge base question-answering, can well utilize the advantage of comprehensive answer coverage range of the text question-answering, and improves the accuracy and richness of output answers.
When the knowledge base is asked and answered, various information contained in the knowledge base is fully utilized to be matched with the questions, and a countermeasure training method is used, so that the performance of the knowledge base is improved, the accuracy of matching the knowledge base with the questions is improved, and the robustness of a question and answer model (device) is improved.
When the text question-answering is carried out, a multi-granularity graph neural network with the nodes being entities and the nodes being sentences is constructed and respectively used as coarse-granularity reasoning modules and fine-granularity reasoning modules, the graph neural network is used for carrying out information propagation on the sentence granularity and the entity granularity, different weights are given to the nodes according to the correlation degree with the question, noise text information is further filtered, and the performance of text answer clue extraction is improved.
The question-answer output and the text question-answer output of the knowledge base are unified, so that multi-source heterogeneous information can be effectively combined, and a simple and complete answer which is easier to understand by a user can be returned.
Drawings
Fig. 1 schematically shows a flowchart of an intelligent question-answering method for a multi-source heterogeneous data source according to an embodiment of the present invention;
FIG. 2 schematically illustrates a knowledge base question answering module structure diagram according to an embodiment of the invention;
FIG. 3 schematically illustrates a diagram of an antagonistic training model according to an embodiment of the present invention;
FIG. 4 is a block diagram schematically illustrating a multi-hop text question answering module according to an embodiment of the present invention;
FIG. 5 is a block diagram schematically illustrating an answer fusion module according to an embodiment of the present invention;
FIG. 6 is a block diagram schematically illustrating an intelligent question answering device oriented to a multi-source heterogeneous data source according to an embodiment of the present invention;
fig. 7 schematically shows an overall structure diagram of an intelligent question answering device for a multi-source heterogeneous data source according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to specific embodiments and the accompanying drawings.
It should be noted that in the drawings or description, the same drawing reference numerals are used for similar or identical parts. Features of the embodiments illustrated in the description may be freely combined to form new embodiments without conflict, and each claim may be individually referred to as an embodiment or features of the claims may be combined to form a new embodiment, and in the drawings, the shape or thickness of the embodiment may be enlarged and simplified or conveniently indicated. Further, elements or implementations not shown or described in the drawings are of a form known to those of ordinary skill in the art. Additionally, while exemplifications of parameters including particular values may be provided herein, it is to be understood that the parameters need not be exactly equal to the respective values, but may be approximated to the respective values within acceptable error margins or design constraints.
Unless a technical obstacle or contradiction exists, the above-described various embodiments of the present invention may be freely combined to form further embodiments, which are within the scope of the present invention.
Although the present invention has been described in connection with the accompanying drawings, the embodiments disclosed in the drawings are intended to be illustrative of preferred embodiments of the present invention and should not be construed as limiting the invention. The dimensional proportions in the figures are merely schematic and are not to be understood as limiting the invention.
Although a few embodiments of the present general inventive concept have been shown and described, it would be appreciated by those skilled in the art that changes may be made in these embodiments without departing from the principles and spirit of the general inventive concept, the scope of which is defined in the claims and their equivalents.
The invention provides a specific embodiment to explain the technical scheme of the invention, for example, a natural language question is respectively input into a knowledge base question-answer module and a multi-hop text question-answer module, answer retrieval is carried out in a multi-source heterogeneous information source, after answer triples returned by the knowledge base question-answer module and answer texts returned by the text question-answer module are obtained, the answer triples and the answer texts are taken as candidate answers and sent to an answer fusion module, and the relation between the answer triples and the answer text is judged, so that uniform answer output is obtained. The multi-source data refers to a plurality of data sources, and the heterogeneous data refers to inconsistency of types, characteristics and the like of data, and comprises structured data, semi-structured data, unstructured data and the like.
Fig. 1 schematically shows a flowchart of an intelligent question-answering method for a multi-source heterogeneous data source according to an embodiment of the present invention, and as shown in fig. 1, the method includes:
s101, calculating a first similarity between the input question and a candidate relation, wherein the candidate relation is a relation related to the input question in a knowledge base.
According to the embodiment of the invention, before calculating the first similarity of the input problem and the candidate relation, the subject entity is detected according to the input problem, all the relations connected with the entity are inquired and obtained in the knowledge base to serve as the candidate relation, and then the entity type of the entity in the input problem in the knowledge base is inquired; acquiring the hierarchical information of a knowledge base and the literal information of input problems and candidate relations; and calculating a first similarity of the input question and the candidate relation according to the entity type, the hierarchy information and the literal information.
According to the embodiment of the invention, calculating the first similarity of the input question and the candidate relation according to the entity type information and the hierarchy information of the knowledge base and the literal information of the input question and the candidate relation comprises the following steps: removing entities contained in the input problems to obtain a problem template; integrating the characteristics of global information and local information of the entity type; calculating the similarity of the entity type and the candidate relationship after the feature integration to obtain a first similarity score; respectively carrying out semantic matching and literal matching on the problem template and the candidate relationship, calculating the similarity of the problem template and the candidate relationship, and obtaining a second similarity score and a third similarity score, wherein the semantic matching comprises the following steps: and dividing the candidate relation into two parts, namely mapping the relation in the entity and the problem template respectively to obtain a second similarity score by calculation based on the hierarchical information of the knowledge base, namely the multi-angle knowledge base information.
FIG. 2 schematically illustrates a knowledge base question answering module structure diagram according to an embodiment of the invention.
According to an embodiment of the present invention, as shown in fig. 2, in the method for question-answering by a knowledge base according to an embodiment of the present invention, the obtaining a first answer by a knowledge base may include: firstly, entity recognition is carried out on an input problem, a subject entity in the input problem is found, other parts of the input problem except the subject entity are used as a problem template, and data preprocessing is carried out for matching candidate relations. The subject entity may query the knowledge base for its entity type and query all the relationships to which it is connected (relationships refer to "subject", "couple", "parent", etc., a subset FB5M of Freebase includes seven thousand relationships) as candidates. Next, sending the entity type and the candidate relationship to an entity type-relationship matching module; on the other hand, the problem template and the candidate relation are input into a problem template-relation matching module, in the module, matching is divided into two paths, one path is matched with the semantic information of the problem template and the relation, and the other path is matched with the literal information of the problem template and the relation. The matching modules obtain three matching scores, which will be described below. And integrating the three scores to obtain a final score, wherein the candidate with the highest score is the knowledge base relationship which is most matched with the question, and then combining the subject entity obtained by the entity detection tool to obtain an answer knowledge triple of the question and answer of the knowledge base, namely the first answer obtained from the knowledge base.
According to the embodiment of the invention, when entity type-relation matching is carried out, in order to fully utilize entity type information, two levels of vector representation are used, one level is that the entity type is regarded as a whole, so that the global information of the entity type is fully expressed, the other level is that the entity type is divided into words, so that the local information of the entity type is fully utilized, after vector representation is respectively carried out, the features of different levels of the entity type are integrated by using the maximum pooling, the vector representation t of the entity type is obtained, then the vector representation r of the relation is obtained, the distance between the two vectors is measured by using cosine similarity, and a first similarity score S for measuring the similarity between the two vectors is obtainedtypeThe formula is as follows:
Figure BDA0002899218950000071
according to the embodiment of the invention, when semantic matching of the problem template-relation is carried out, considering that information contained in different parts of one relation is different, namely hierarchy information of a knowledge base, one relation is divided into two parts, the first part can be used for mapping information of a subject entity in the problem template, and the second part maps a relation reference in the problem template, for example, the relation of't v.t _ program.program _ creator' in the knowledge base Freebase, wherein the 't.t.v _ program' part represents the attribute of the subject entity, and the 'program _ creator' part contains a relation referenceAnd generating information. Then using a bidirectional long-short term memory network based on an attention mechanism to obtain a problem representation vector q with different emphasis points1And q is2And a relation representation vector r of different parts1And r2Respectively calculating the semantic similarity to obtain the score S of the semantic similaritysemanticThe formula is as follows:
Ssemantic=q1·r1+q2·r2 (2)
according to the embodiment of the invention, when the face matching of the problem template-relation is carried out, considering that some words in the problem template possibly correspond to some words in the relation, the relation is divided into a word sequence, so that the word sequence corresponding to the problem is realized, and the problem word sequence and the relation word sequence are respectively expressed into vectors q and rwThen, a similarity matrix containing the corresponding relation of the two word sequences is obtained by carrying out the operation of matrix multiplication, similar features are extracted by convolution, and thus, the similarity score S of the face is obtainedliteralThe formula is as follows:
Sliteral=conv(q·rw) (3)
according to the embodiment of the invention, when the first similarity of the input problem and the candidate relation is calculated, the input vector with the interference capability can be introduced by using the countertraining.
FIG. 3 schematically illustrates a diagram of an antagonistic training model according to an embodiment of the present invention.
According to the embodiment of the invention, during model training, a confrontation training method is used, namely, disturbance is added to an input sequence, the input with the disturbance is used for replacing the original input for subsequent training so as to enhance the robustness of the model, the network model of the part is shown in FIG. 3, the vector of the input obtained after the word embedding layer is assumed to be represented as w, and the added disturbance is radvThen the input vector after adding the perturbation becomes radvAnd + w. The calculation method of the disturbance is as follows:
radv=-∈g/||g||2 (4)
Figure BDA0002899218950000081
wherein | | xi | purple2Representing a two-norm, F represents the loss function of the model,
Figure BDA0002899218950000082
are gradient operators.
S102, acquiring a first answer from the knowledge base according to the first similarity.
According to the embodiment of the present invention, according to the first similarity, the obtaining of the first answer triplet from the knowledge base includes: and obtaining a candidate relation which is most matched with the input question according to the first similarity score, the second similarity score and the third similarity score, carrying out entity detection on the input question according to the candidate relation which is most matched with the input question to obtain a subject entity, and obtaining a first answer according to the subject entity.
S103, searching the multi-hop text according to the input question.
According to an embodiment of the invention, for each question, for example, we retrieve ten articles related to the question from Wikipedia. The system returns answers and clue sentences after multi-hop understanding. For example, the question is "what is the party to whom 45 th american president belongs? ", corresponding to 10 text articles.
S104, calculating a second similarity between the sentences in the multi-hop text and the input question and a third similarity between the entity in the multi-hop text and the input question.
According to the embodiment of the invention, calculating a second similarity between a sentence in the multi-hop text and an input question and a third similarity between an entity in the multi-hop text and the input question comprises the following steps: screening sections associated with the input problem and splicing the sections into a long text; coding the long text and the input problem, and calculating the attention expression of the coded long text and the input problem; respectively taking sentences and entities in the long text as nodes, constructing a sentence graph neural network and an entity graph neural network, and reasoning to obtain coarse-grained graph neural network information and fine-grained graph neural network information; based on the attention representation, a global representation of the long text is computed using a self-attention mechanism.
Fig. 4 is a diagram schematically illustrating a multi-hop text question answering module structure according to an embodiment of the present invention.
According to the embodiment of the invention, as shown in fig. 4, first, a chapter screening module is used to remove chapters with low relevance to the problem, the chapter screening module is designed, and after being encoded by using a large-scale semantic model BERT, a sigmoid activation function is used to calculate two classifications, so as to determine whether each article is relevant to the problem. And splicing the screened remaining chapters into a long text. Then, long texts and questions are encoded using the pre-trained language model BERT, and a bi-directional attention model is used to compute the question-to-answer and the attention representation of the answer-to-question. And then respectively establishing a graph neural network with nodes being sentences and a graph neural network with nodes being entities, wherein the inference process of the graph network with the nodes being sentences is used as coarse-grained inference, and the graph network with the nodes being entities is used as fine-grained inference. And calculating the similarity score of the node and the problem, and masking the node. Information propagation between nodes relies on a graph attention mechanism, information of one node is propagated to adjacent nodes, and a self-attention mechanism is applied on a sentence graph neural network to obtain a global representation of the whole long text.
And S105, acquiring a second answer from the multi-hop text according to the second similarity and the third similarity.
According to an embodiment of the present invention, obtaining a second answer from the multi-hop text according to the second similarity and the third similarity includes: and fusing the global representation of the long text with coarse-grained graph neural network information and fine-grained graph neural network information, and predicting clue sentences, answer starting words and answer ending words of the fused long text to obtain a second answer, wherein the second answer can be a text, for example.
According to the embodiment of the invention, as shown in fig. 4, the graph neural network information with different granularities is spliced on the long text and used as the input of the cyclic neural network, so that the effect of multi-granularity fusion is achieved. And predicting the clue sentences, the answer starting words and the answer ending words on the long texts after the information is updated, so as to obtain corresponding answer texts.
According to the embodiment of the invention, clue sentences are extracted from long texts spliced by 10 text articles, and the first serves as the 45 th American president. "and" A "belong to the United states Congress Party. The answer is "American Council Party". When using model prediction, we predict the clue sentences and the answer start word index position and end word index position.
And S106, judging the relation between the first answer and the second answer, and outputting an answer text of the input question.
According to an embodiment of the present invention, determining the relationship between the first answer and the second answer includes: vector-coding the first answer and the second answer; and inputting the first answer and the second answer after vector coding into a classifier to obtain a relation, judging whether the relation is implied or independent or contradictory, and combining the independent first answer and the independent second answer to obtain a combined answer.
According to an embodiment of the present invention, outputting answer text of an input question includes: outputting the implied first answer or the implied second answer; or outputting the merged answer; or outputting a first answer and a second answer which are contradictory; and outputting the basis of obtaining the answer text.
Fig. 5 schematically shows a structure diagram of an answer fusion module according to an embodiment of the present invention.
According to the embodiment of the present invention, as shown in fig. 5, the input of the module is the output of the two modules, and firstly, the input answer to be processed is vector-coded; and then, a classifier is used for judging the answer relation of the multiple candidate answers, namely, judging whether the answers are in an inclusion, independent or contradictory relation. Specifically, the answer triples obtained by the knowledge base question-answering module and the answer texts output by the multi-hop text question-answering module are connected end to obtain a word sequence, the word sequence is embedded to obtain vector representation of the word sequence, a bidirectional long-time and short-time memory network is input, and finally a softmax layer is used for obtaining the relation between answers. And selecting the included answers for the answers containing the relations, outputting the answers containing the relations, combining the answers with the independent relations, reserving all the answers with the contradictory relations, and obtaining the basis of the answers for the user to select the answers.
In summary, the embodiment of the present invention provides an intelligent question answering method. The relevant answers of the input questions are retrieved from the structured knowledge base and the unstructured text at the same time, wherein knowledge can be fully understood and expressed through multi-angle knowledge base information, answer content can be greatly enriched by detecting the multi-hop text, the multi-source heterogeneous information can be fully utilized to return answers by combining the multi-angle knowledge base information and the unstructured text information, more knowledge can be better integrated by integrating the knowledge base information and the text semantic information compared with a single information source, more information sources and support are provided for answer reasoning, the advantage that the knowledge base question answering is accurate and convenient is kept, the advantage that the text question answering covers the advantage of the comprehensive answer range is well utilized, and the accuracy and the richness of the output answers are improved.
Fig. 6 schematically shows a block diagram of an intelligent question-answering device for a multi-source heterogeneous data source according to an embodiment of the present invention.
As shown in fig. 6, another aspect of the present invention provides an intelligent question answering device 600, including:
a question input module 610 for inputting a question.
A knowledge base question-answering module 620, configured to calculate a first similarity between the input question and a candidate relationship, where the candidate relationship is a relationship in the knowledge base related to the input question; and acquiring a first answer from the knowledge base according to the first similarity.
According to the embodiment of the invention, before calculating the first similarity between the input question and the candidate relationship, a subject entity is detected according to the input question, all the relationships connected with the entity are obtained as the candidate relationship by querying in a knowledge base, and the subject entity can be, for example, a structured triple.
A multi-hop text question-and-answer module 630, configured to retrieve a multi-hop text according to an input question; calculating a second similarity between sentences in the multi-hop text and the input question and a third similarity between entities in the multi-hop text and the input question; and acquiring a second answer from the multi-hop text according to the second similarity and the third similarity.
And the answer fusion module 640 is configured to determine a relationship between the first answer and the second answer to obtain an answer text of the input question.
And an answer output module 650 for outputting an answer text of the input question.
Fig. 7 schematically shows an overall structure diagram of an intelligent question answering device for a multi-source heterogeneous data source according to an embodiment of the present invention.
According to the embodiment of the present invention, as shown in fig. 7, a question is input in the question input module 610, answers to the input question are retrieved in the knowledge base question-answering module 620 and the multi-hop text question-answering module 630, respectively, and then the answers obtained from the knowledge base question-answering module 620 and the multi-hop text question-answering module 630 are determined and fused in the answer fusion module 640 to obtain the determined and fused answer, which may be, for example, an implied answer, a parallel independent answer, or all contradictory answers. Finally, the above answer text of the input question is output through the answer output module 650.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the present invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (9)

1. An intelligent question-answering method for a multi-source heterogeneous data source is characterized by comprising the following steps:
calculating a first similarity between an input question and a candidate relation, wherein the candidate relation is a relation related to the input question in a knowledge base;
acquiring a first answer from the knowledge base according to the first similarity;
retrieving a multi-hop text according to the input question;
calculating a second similarity between a sentence in the multi-hop text and the input question and a third similarity between an entity in the multi-hop text and the input question;
acquiring a second answer from the multi-hop text according to the second similarity and the third similarity;
judging the relation between the first answer and the second answer, and outputting an answer text of the input question;
wherein calculating the second similarity and the third similarity comprises:
screening sections associated with the input problems and splicing the sections into long texts;
coding the long text and the input question by using a pre-training language model, and calculating the attention representation of the coded long text and the input question;
respectively taking sentences in the long text and the entities as nodes, constructing a sentence graph neural network and an entity graph neural network, and reasoning to obtain coarse-grained graph neural network information and fine-grained graph neural network information;
and calculating a global representation of the long text by adopting a self-attention mechanism based on the attention representation.
2. The intelligent question-answering method for the multi-source heterogeneous data source according to claim 1, wherein the entity type of the entity in the input question in the knowledge base is queried;
acquiring the hierarchical information of the knowledge base and the literal information of the input question and the candidate relation;
calculating a first similarity of the input question and the candidate relationship according to the entity type, the hierarchical information, and the literal information.
3. The multi-source heterogeneous data source-oriented intelligent question answering method according to claim 2, wherein the calculating of the first similarity between the input question and the candidate relationship according to the entity type information and the hierarchy information of the knowledge base and the literal information of the input question and the candidate relationship comprises:
removing entities contained in the input questions to obtain a question template;
integrating the characteristics of the global information and the local information of the entity type;
calculating the similarity of the entity type and the candidate relationship after feature integration to obtain a first similarity score;
respectively carrying out semantic matching and literal matching on the problem template and the candidate relationship, calculating the similarity of the problem template and the candidate relationship, and obtaining a second similarity score and a third similarity score, wherein the semantic matching comprises the following steps:
and dividing the candidate relation into two parts respectively mapping relation references in the entity and the problem template based on the hierarchical information of the knowledge base to calculate the second similarity score.
4. The intelligent question-answering method for the multi-source heterogeneous data source according to claim 3, wherein the obtaining of the first answer from the knowledge base according to the first similarity comprises:
and obtaining the candidate relationship which is most matched with the input question according to the first similarity score, the second similarity score and the third similarity score, performing entity detection on the input question according to the candidate relationship which is most matched with the input question to obtain a subject entity, and obtaining the first answer according to the subject entity.
5. The multi-source heterogeneous data source-oriented intelligent question answering method according to claim 1, wherein the obtaining of a second answer from the multi-hop text according to the second similarity and the third similarity comprises:
and fusing the global representation of the long text with the coarse-grained graph neural network information and the fine-grained graph neural network information, and predicting clue sentences, answer starting words and answer ending words of the fused long text to obtain the second answer.
6. The multi-source heterogeneous data source-oriented intelligent question answering method according to claim 1, wherein when first similarity of the input question and the candidate relation is calculated, an input vector with interference capability can be introduced by using countermeasure training.
7. The multi-source heterogeneous data source-oriented intelligent question answering method according to claim 1, wherein the judging of the relationship between the first answer and the second answer comprises:
vector-encoding the first answer and the second answer;
inputting the first answer and the second answer after the vector coding into a classifier to obtain the relationship, and judging whether the relationship is implied or independent or contradictory, wherein the independent first answer and the independent second answer are combined to obtain the combined answer text.
8. The intelligent question-answering method for the multi-source heterogeneous data source according to claim 7, wherein the outputting of the answer text of the input question comprises:
outputting the implied first answer or the implied second answer;
or outputting the merged answer text;
or, outputting the first answer and the second answer which are contradictory;
and outputting the basis for obtaining the answer text.
9. An intelligent question answering device for a multi-source heterogeneous data source is characterized by comprising:
the question input module is used for inputting questions;
the knowledge base question-answering module is used for calculating first similarity of the input question and a candidate relation, wherein the candidate relation is a relation related to the input question in a knowledge base; acquiring a first answer from the knowledge base according to the first similarity;
the multi-hop text question-answering module is used for retrieving a multi-hop text according to the input question; calculating a second similarity between a sentence in the multi-hop text and the input question and a third similarity between an entity in the multi-hop text and the input question; acquiring a second answer from the multi-hop text according to the second similarity and the third similarity;
wherein calculating the second similarity and the third similarity comprises:
screening sections associated with the input problems and splicing the sections into long texts;
coding the long text and the input question by using a pre-training language model, and calculating the attention representation of the coded long text and the input question;
respectively taking sentences in the long text and the entities as nodes, constructing a sentence graph neural network and an entity graph neural network, and reasoning to obtain coarse-grained graph neural network information and fine-grained graph neural network information;
calculating to obtain a global representation of the long text by adopting a self-attention mechanism based on the attention representation;
the answer fusion module is used for judging the relationship between the first answer and the second answer to obtain an answer text of the input question;
and the answer output module is used for outputting the answer text of the input question.
CN202110059191.9A 2021-01-15 2021-01-15 Intelligent question and answer method and device for multi-source heterogeneous data source Active CN112948546B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110059191.9A CN112948546B (en) 2021-01-15 2021-01-15 Intelligent question and answer method and device for multi-source heterogeneous data source

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110059191.9A CN112948546B (en) 2021-01-15 2021-01-15 Intelligent question and answer method and device for multi-source heterogeneous data source

Publications (2)

Publication Number Publication Date
CN112948546A CN112948546A (en) 2021-06-11
CN112948546B true CN112948546B (en) 2021-11-23

Family

ID=76235465

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110059191.9A Active CN112948546B (en) 2021-01-15 2021-01-15 Intelligent question and answer method and device for multi-source heterogeneous data source

Country Status (1)

Country Link
CN (1) CN112948546B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113420111B (en) * 2021-06-17 2023-08-11 中国科学院声学研究所 Intelligent question answering method and device for multi-hop reasoning problem
CN113590779B (en) * 2021-06-30 2023-04-25 四川大学 Construction method of intelligent question-answering system of knowledge graph in air traffic control field
CN113987156B (en) * 2021-12-21 2022-03-22 飞诺门阵(北京)科技有限公司 Long text generation method and device and electronic equipment
CN114443824A (en) * 2022-01-24 2022-05-06 支付宝(杭州)信息技术有限公司 Data processing method and device, electronic equipment and computer storage medium
CN117407515B (en) * 2023-12-15 2024-04-30 湖南三湘银行股份有限公司 Answer system based on artificial intelligence

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104216913A (en) * 2013-06-04 2014-12-17 Sap欧洲公司 Problem answering frame
CN104573028A (en) * 2015-01-14 2015-04-29 百度在线网络技术(北京)有限公司 Intelligent question-answer implementing method and system
WO2019012908A1 (en) * 2017-07-13 2019-01-17 国立研究開発法人情報通信研究機構 Non-factoid question answering device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104216913A (en) * 2013-06-04 2014-12-17 Sap欧洲公司 Problem answering frame
CN104573028A (en) * 2015-01-14 2015-04-29 百度在线网络技术(北京)有限公司 Intelligent question-answer implementing method and system
WO2019012908A1 (en) * 2017-07-13 2019-01-17 国立研究開発法人情報通信研究機構 Non-factoid question answering device

Also Published As

Publication number Publication date
CN112948546A (en) 2021-06-11

Similar Documents

Publication Publication Date Title
CN112948546B (en) Intelligent question and answer method and device for multi-source heterogeneous data source
CN111639171A (en) Knowledge graph question-answering method and device
CN112487168B (en) Semantic question-answering method and device of knowledge graph, computer equipment and storage medium
CN112989055B (en) Text recognition method and device, computer equipment and storage medium
CN109726274A (en) Problem generation method, device and storage medium
EP3940582A1 (en) Method for disambiguating between authors with same name on basis of network representation and semantic representation
WO2015034622A1 (en) Methods and systems of four valued analogical transformation operators used in natural language processing and other applications
CN114936287A (en) Knowledge injection method for pre-training language model and corresponding interactive system
CN115390806A (en) Software design mode recommendation method based on bimodal joint modeling
CN115964459B (en) Multi-hop reasoning question-answering method and system based on food safety cognition spectrum
CN115688753A (en) Knowledge injection method and interaction system of Chinese pre-training language model
CN113779190B (en) Event causal relationship identification method, device, electronic equipment and storage medium
Li et al. Neural factoid geospatial question answering
CN112417170B (en) Relationship linking method for incomplete knowledge graph
CN110750632B (en) Improved Chinese ALICE intelligent question-answering method and system
CN116861269A (en) Multi-source heterogeneous data fusion and analysis method in engineering field
CN116992040A (en) Knowledge graph completion method and system based on conceptual diagram
CN115982338A (en) Query path ordering-based domain knowledge graph question-answering method and system
CN115859963A (en) Similarity judgment method and system for new word and semantic recommendation
CN116069876A (en) Knowledge graph-based question and answer method, device, equipment and storage medium
CN115658845A (en) Intelligent question-answering method and device suitable for open-source software supply chain
Chang et al. An unsupervised approach of truth discovery from multi-sourced text data
Quiroz-Mercado et al. Semantic similarity estimation using vector symbolic architectures
CN113821610A (en) Information matching method, device, equipment and storage medium
Monea Graph force: Rhetorical machines and the n-arization of knowledge

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
CB03 Change of inventor or designer information

Inventor after: Sun Xian

Inventor after: Liu Qing

Inventor after: Li Shuchao

Inventor after: Zhang Zequn

Inventor after: Liu Kang

Inventor after: Li Xiaoyu

Inventor after: Li Xinlong

Inventor after: Lv Bo

Inventor after: Deng Bo

Inventor before: Sun Xian

Inventor before: Liu Qing

Inventor before: Li Shuchao

Inventor before: Zhang Zequn

Inventor before: Liu Kang

Inventor before: Li Xiaoyu

Inventor before: Li Xinlong

Inventor before: Lv Bo

CB03 Change of inventor or designer information