CN109408627B - Question-answering method and system fusing convolutional neural network and cyclic neural network - Google Patents

Question-answering method and system fusing convolutional neural network and cyclic neural network Download PDF

Info

Publication number
CN109408627B
CN109408627B CN201811371591.8A CN201811371591A CN109408627B CN 109408627 B CN109408627 B CN 109408627B CN 201811371591 A CN201811371591 A CN 201811371591A CN 109408627 B CN109408627 B CN 109408627B
Authority
CN
China
Prior art keywords
question
neural network
attribute
entity
word
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
CN201811371591.8A
Other languages
Chinese (zh)
Other versions
CN109408627A (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.)
Shanghai Zhongan Information Technology Service Co ltd
Original Assignee
Zhongan Information Technology Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongan Information Technology Service Co Ltd filed Critical Zhongan Information Technology Service Co Ltd
Priority to CN201811371591.8A priority Critical patent/CN109408627B/en
Publication of CN109408627A publication Critical patent/CN109408627A/en
Application granted granted Critical
Publication of CN109408627B publication Critical patent/CN109408627B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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

Abstract

The invention discloses a question-answering method and a question-answering system integrating a convolutional neural network and a cyclic neural network, wherein the method comprises the following steps: acquiring an entity of a question and a query ID of the entity according to the question input by a user; simplifying the question into a question mode according to the entity; collecting the related attributes of the entities according to the query ID, and generating a candidate attribute list; inputting the question mode and the candidate attribute list into a pre-trained attribute discriminator to obtain the score of each candidate attribute and question; and judging the attribute relationship which is most similar to the question according to the score, and taking out the attribute value of the most similar attribute relationship to finish the answer. The invention realizes rapid entity positioning by using a dictionary tree method, can meet a high-concurrency business system, can reduce meaningless character string comparison and improve query efficiency, carries out attribute inference by using a neural network-based method, does not need to manually arrange templates by using vectorized numerical calculation, and can effectively solve the problems of complicated and incomplete manual arrangement operation and the like.

Description

Question-answering method and system fusing convolutional neural network and cyclic neural network
Technical Field
The invention relates to the technical field of information retrieval, in particular to a question answering method and system fusing a convolutional neural network and a cyclic neural network.
Background
Question-Answering system (QA) is one of the problems of long-term research in the field of machine learning and artificial intelligence. The most famous story is that IBM Watson participated in the Jeopardy race in 2011, defeating all human competitors and awarded $ 100 million. In recent years, a number of large generic knowledge maps have been developed, such as YAGO, Freebase, NELL, DBpedie, zhishi. How to ask and answer by using knowledge stored in a knowledge graph structure becomes a hot spot of current research.
Knowledge question answering (also called knowledge base question answering, knowledge map question answering, abbreviated as KBQA) refers to a given natural language question, and answers are obtained by semantic analysis and understanding of the question and further by means of knowledge map query and reasoning. KBQA generally derives answers from knowledge in a knowledge base. There are a large number of triples in a knowledge base, e.g. (Shanghai city, population, 2400 ten thousand) indicating that the Shanghai city population is 2400 ten thousand. Each triplet is a fact or knowledge. The existing knowledge question-answering system has two difficulties: entity location and attribute inference.
Entity positioning, namely extracting entities (entity establishment) mentioned in a question, the current mainstream method of comparison is to perform semantic parsing (semantic parser) and entity recognition (entity recognition) on the question to obtain entity words, and then perform matching query with the entities in the knowledge base. However, this method has many unnecessary character string comparisons, resulting in problems such as low query efficiency.
Attribute inference, i.e. mapping a question to the corresponding entity attribute, and analyzing which attribute the question asks. As in "how many people are in Shanghai City? In this example, attribute inference is intended to accurately infer the "demographic" attributes for the entity "Shanghai City". The common method is to use rule template matching, however, similar matching based on the template requires a lot of manual arrangement, enumerates the questioning mode of each attribute of the entity, which is very complicated, and manual arrangement easily causes problems such as incompleteness.
In view of the above, it is desirable to provide a new knowledge question-answering system to solve the two problems of entity location and attribute inference in the existing knowledge question-answering system.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a question-answering method and system fusing a convolutional neural network and a recurrent neural network, so as to overcome the problems in the prior art that the query efficiency is low and attribute inference requires a large amount of manual sorting due to unavoidable character string comparison in entity positioning, the question-asking mode of each attribute of an entity is enumerated, the query is very complicated, and manual sorting easily causes incompleteness.
In one aspect, a question-answering method fusing a convolutional neural network and a cyclic neural network is provided, and the method includes the following steps:
s1: acquiring an entity of a question and a query ID of the entity according to the question input by a user;
s2: simplifying the question into a question mode according to the entity;
s3: collecting the related attributes of the entity according to the query ID, and generating a candidate attribute list;
s4: inputting the question mode and the candidate attribute list into a pre-trained attribute discriminator to obtain the score of each candidate attribute and question;
s5: and judging the attribute relationship which is most similar to the question according to the score, and taking out the attribute value of the most similar attribute relationship to finish the answer.
Further, the step S1 specifically includes:
according to a question input by a user, utilizing a pre-constructed dictionary tree to perform entity positioning on the question, and matching out an entity of the question and a query ID corresponding to the entity.
Further, the step S3 specifically includes:
and inquiring and taking out all attribute relations connected with the entity in a pre-constructed knowledge graph according to the inquiry ID to generate a candidate attribute list.
Further, the step S4 specifically includes:
s4.1: semantic modeling is carried out on the question by utilizing a recurrent neural network, and a attention mechanism is added according to each candidate attribute to obtain a semantic feature vector;
s4.2: performing word similarity modeling on the question by using a convolutional neural network to obtain word feature vectors;
s4.3: and combining the semantic feature vector and the word feature vector, and acquiring the score of each candidate attribute and question through a linear neural network.
Further, the step S4.1 specifically includes:
s4.1.1: segmenting the question and the candidate attribute, acquiring a word vector corresponding to the question and a relation vector corresponding to the candidate attribute according to a pre-constructed word vector library, and splicing the word vectors into a sentence vector;
s4.1.2: inputting the sentence vectors into a cyclic neural network, and splicing the output into a new sentence containing the semantic relation before and after;
s4.1.3: multiplying the new sentence by an attention weight vector to obtain a new sentence representation for the candidate attribute;
s4.1.4: and acquiring the semantic feature vector of the candidate attribute according to the new sentence expression and the relation vector.
Further, the step S4.2 specifically includes:
s4.2.1: performing similarity calculation according to the word vector corresponding to the question and the relation vector corresponding to the candidate attribute to obtain a similarity matrix consisting of two similarity scores;
s4.2.2: and inputting the similarity matrix into a convolutional neural network, and obtaining word characteristic vectors through calculation.
In another aspect, a question-answering system fusing a convolutional neural network and a cyclic neural network is provided, the system including:
the entity acquisition module is used for acquiring an entity of a question and a query ID of the entity according to the question input by a user;
the question simplifying module is used for simplifying the question into a question mode according to the entity;
the attribute acquisition module is used for collecting the related attributes of the entity according to the query ID of the entity and generating a candidate attribute list;
the attribute inference module is used for inputting the question pattern and the candidate attribute list into a pre-trained attribute discriminator to obtain the score of each candidate attribute and the question;
and the answer feedback module is used for judging the attribute which is most similar to the question according to the score and completing an answer according to the most similar attribute.
Further, the entity obtaining module is specifically configured to:
according to a question input by a user, utilizing a pre-constructed dictionary tree to perform entity positioning on the question, and matching out an entity of the question and a query ID corresponding to the entity.
Further, the attribute obtaining module is specifically configured to:
and inquiring and taking out all attribute relations connected with the entity in a pre-constructed knowledge graph according to the inquiry ID to generate a candidate attribute list.
Further, the attribute inference module comprises:
the semantic understanding unit is used for carrying out semantic modeling on the question by utilizing a recurrent neural network and adding an attention mechanism according to each candidate attribute to obtain a semantic feature vector;
the lexical similarity unit is used for performing word similarity modeling on the question by utilizing a convolutional neural network to obtain word feature vectors;
and the score output unit is used for combining the semantic feature vector and the word feature vector and acquiring the score of each candidate attribute and question through a linear neural network.
Further, the semantic understanding unit includes:
the vectorization subunit is used for segmenting the question and the candidate attributes, acquiring word vectors corresponding to the question and relation vectors corresponding to the candidate attributes according to a pre-constructed word vector library, and splicing the word vectors into sentence vectors;
the splicing subunit is used for inputting the sentence vectors into a cyclic neural network and splicing the output into a new sentence containing a front semantic relation and a rear semantic relation;
a fusion subunit, configured to multiply the new sentence by an attention weight vector to obtain a new sentence representation for the candidate attribute;
and the point multiplication subunit is used for acquiring the semantic feature vector of the candidate attribute according to the new sentence expression and the relation vector.
Further, the lexical similarity unit includes:
the similarity matrix subunit is used for performing similarity calculation according to the word vectors corresponding to the question sentences and the relation vectors corresponding to the candidate attributes to obtain a similarity matrix consisting of two similarity scores;
and the calculating subunit is used for inputting the similarity matrix into the convolutional neural network and acquiring word characteristic vectors through calculation.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
1. according to the question-answering method and system fusing the convolutional neural network and the cyclic neural network, provided by the embodiment of the invention, the query sentence is rapidly and physically positioned by utilizing the pre-constructed dictionary tree, and the entity of the query sentence and the query ID corresponding to the entity are matched, so that a high-concurrency commercial system can be met, meaningless character string comparison can be reduced, and the query efficiency is improved;
2. according to the question-answering method and system fusing the convolutional neural network and the cyclic neural network, attribute inference is carried out through a neural network-based method, vectorization numerical calculation does not need manual template arrangement, and the problems of complicated operation, incompleteness and the like of manual arrangement can be effectively solved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow diagram illustrating a question-answering method that merges a convolutional neural network and a recurrent neural network in accordance with an exemplary embodiment;
FIG. 2 is a diagram illustrating a dictionary tree constructed from a collection of entities in accordance with an illustrative embodiment;
FIG. 3 is a flowchart illustrating inputting the question pattern and the candidate attribute list into a pre-trained attribute discriminator to obtain a score for each candidate attribute and question according to an exemplary embodiment;
FIG. 4 is a schematic diagram illustrating the structure of a question-answering system that merges convolutional and recurrent neural networks, according to an exemplary embodiment;
FIG. 5 is a diagram illustrating a structure of attribute inference in accordance with an exemplary embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the preset precondition of the embodiment of the present invention is that the knowledge graph is constructed, wherein the knowledge graph used for the description in the embodiment of the present invention uses an open-source Freebase knowledge base, but the knowledge graph used in the present invention is not limited to the Freebase knowledge base, and for example, YAGO, NELL, DBpedie, zhishi.
Fig. 1 is a flowchart illustrating a question-answering method fusing a convolutional neural network and a recurrent neural network according to an exemplary embodiment, and referring to fig. 1, the method includes the following steps:
s1: and acquiring an entity of the question and the query ID of the entity according to the question input by the user.
Further, in the embodiment of the present invention, a specific implementation manner of entity positioning is: according to a question input by a user, utilizing a pre-constructed dictionary tree to perform entity positioning on the question, and matching out an entity of the question and a query ID corresponding to the entity.
Specifically, in embodiments of the present invention, a generic knowledge graph (e.g., the Freebase knowledge base) has been established by default. The method comprises the steps of firstly constructing a dictionary tree according to all entity names in a knowledge map, wherein an entity set is [ Shanghai city, Shanghai city people's court, Shanghai transportation university, Shanghai Zhongzhong, Shanghai Glochun center, Glochun finance center and Jinmao Xiong ], wherein the Shanghai Glochun finance center has a nickname of the Glochun finance center, and common nicknames can be manually added. The steps of constructing the dictionary tree are as follows:
1. constructing a Root node Root;
2. traversing the entity name list, searching the prefix of the entity name of the current node according to the word, and adding a suffix node;
3. adding query ID corresponding to the entity as a leaf node;
fig. 2 is a schematic diagram of a dictionary tree constructed according to an entity set according to an exemplary embodiment, and referring to fig. 2, the online entity positioning refers to querying the constructed dictionary tree, and a plurality of leaf nodes can be searched through the dictionary tree. For example: the question "is the national court of Shanghai city? Two leaf nodes of Shanghai city and Shanghai city people court can be searched by the question sentence, and according to the rule of the embodiment of the invention, the result given by the entity positioning only has the longest matching 'Shanghai city people court'.
It should be noted that a dictionary tree, i.e., a Trie tree, also called a word-lookup tree or a key tree, is a hash tree variation. A typical application is for counting and sorting a large number of strings (but not limited to strings), and is therefore often used by search engine systems for text word frequency statistics. The dictionary tree has three basic features: 1. the root node does not contain any characters; 2. connecting the characters passing through the path from the root node to a certain node, and taking the connected characters as a character string corresponding to the node; 3. all the byte points of each node contain different characters. The core idea of the dictionary tree is to change the time by space and reduce the cost of query time by using the common prefix of the character string so as to achieve the purpose of improving the efficiency. By utilizing the characteristics of the dictionary tree, the embodiment of the invention can meet the high-concurrency business system when the question is rapidly and physically positioned, reduce meaningless character string comparison and improve the query efficiency.
S2: and simplifying the question into a question mode according to the entity.
Specifically, in the embodiment of the present invention, before attribute inference is performed on a question, the question needs to be simplified into a question mode, that is, the name of the related entity is replaced with a specific character, for example, the question "where is the national court of Shanghai? "can be simplified to" < s > where? "the Shanghai city people court" is replaced by "< s >".
S3: and collecting the related attributes of the entity according to the query ID to generate a candidate attribute list.
Further, according to the query ID, querying and taking out all attribute relations connected with the entity from a pre-constructed knowledge graph, and generating a candidate attribute list.
Specifically, after the entity location is completed, the query ID corresponding to the entity is obtained at the same time, and the system queries all possible candidate attribute relations in the knowledge graph according to the query ID, such as [ organization, location, organization, telephone, organization, brief introduction, … ], and takes out all candidate attribute relations to generate a candidate attribute list.
S4: and inputting the question pattern and the candidate attribute list into a pre-trained attribute discriminator to obtain the score of each candidate attribute and question.
Specifically, the question pattern and the candidate attribute list obtained in the above steps are input into a pre-trained attribute inference discriminator to obtain the score of each candidate attribute and question. It should be noted here that the training process of the attribute inference arbiter requires a tagged data set of question and attribute relationship, the data format of the tag can be expressed as (subject, relationship, object, query), and the corresponding knowledge question and answer can be understood as (entity, attribute relationship, attribute value, question). In the embodiment of the invention, an open-source SimpleQuestion data set is used for explanation, but the invention is not limited to the data set, and any labeled data set meeting the format requirement can be used for training the model. Since there are only positive examples and no negative examples in the labeled dataset, the data also needs to be augmented in the training attribute inference arbiter.
For each item in the labeled dataset, all attribute relationships of the entity are extracted from the knowledge graphIs a candidate attribute list. The attribute relationship in the embodiment of the invention is composed of two parts, wherein the front part is a descriptor of the entity type, and the rear part is a descriptor of the attribute relationship. And respectively processing the words of the positive sample attribute relationship, and correspondingly, taking out corresponding data from the knowledge graph to assemble into negative samples with the same format. One assembled data item can be represented as (A)
Figure BDA0001866828040000083
p) in which r+Expressed as labeling positive samples within the data set, and r-Representing the following negative examples complemented by data.
In addition, in order to ensure the accuracy of the attribute inference arbiter, the embodiment of the present invention adopts a method of minimizing the maximum interval as a loss function to train parameters of the whole network, wherein an empirical constant of the loss function is set to 1.0. The simple description of the maximum interval method is the score S (r) of the negative sample-) Subtract the score of the positive sample S (r)+) After adding an empirical constant γ, if it is greater than 0, it will take itself, otherwise it will take 0. The labeled data set used for the description of the invention only has one positive sample and a plurality of negative samples, so the positive samples and the negative samples are combined into data items one by one to be calculated and then are summed and averaged. Is formulated as:
Figure BDA0001866828040000081
Figure BDA0001866828040000082
s5: judging the attribute relationship which is most similar to the question sentence according to the score, and taking out the attribute value of the most similar attribute relationship to finish the answer
Specifically, the attribute relationship most similar to the question is judged according to the score to serve as the most accurate attribute relationship, and the attribute value of the most similar attribute relationship is taken out to serve as an answer to be fed back to the user, so that the answer is completed.
Fig. 3 is a flowchart illustrating inputting the question pattern and the candidate attribute list into a pre-trained attribute discriminator to obtain a score of each candidate attribute and question according to an exemplary embodiment, and referring to fig. 3, the flowchart includes the following steps:
s4.1: and performing semantic modeling on the question by using a recurrent neural network, and adding an attention mechanism according to each candidate attribute to obtain a semantic feature vector.
The specific process is as follows:
s4.1.1: and segmenting the question and the candidate attribute, acquiring a word vector corresponding to the question and a relation vector corresponding to the candidate attribute according to a pre-constructed word vector library, and splicing the word vectors into a sentence vector.
Specifically, we usually need to convert the words or sentences into a computable vector to use the computational advantages of the computer to perform numerical computation on the sentence vector or the word vector. In the embodiment of the invention, the sentence vector is simply formed by word vector splicing. For example, a word vector matrix is initialized by random assignment, and then the vectors of the input sentences one-hot are subjected to looking up-up table lookup to obtain word vectors which are then spliced into sentence vectors. It should be noted that, in the embodiment of the present invention, all word vectors in the vectorization layer are initialized by using pre-trained GloVe 300-dimensional input, and the attribute relation word selects a random initialization 150-dimensional vector.
S4.1.2: and inputting the sentence vectors into a cyclic neural network, and splicing the output into a new sentence containing the semantic relation before and after.
Specifically, in the embodiment of the invention, a sentence vector is input into a bidirectional recurrent neural network, and the hidden layer output h at each moment is outputt(including forward and reverse, i.e.
Figure BDA0001866828040000091
) A new sentence structure H containing the semantic relation before and after is formed by splicing1:L=[h1;...;hL]. In the embodiment of the present invention, the hidden layer size of the bidirectional recurrent neural network is set to 200.
S4.1.3: multiplying the new sentence by an attention weight vector to obtain a new sentence representation for the candidate attribute.
Specifically, the new sentence is multiplied by an attention weight vector to obtain a candidate attribute riNew sentence representation of
Figure BDA0001866828040000101
Wherein, aijRepresenting a candidate attribute riWith each word w in the sentencejAttention weight of (1). It should be noted that the weight matrix in the embodiment of the present invention is trained in advance. The attention weight is a correlation coefficient of a word corresponding to each position of the input question and an attribute relation word, the correlation is weighed through the inner product of word vectors, and then the words are normalized by softmax. An attention weight vector is a vector of weights of respective positions in a sentence [ a1, a2]。
S4.1.4: and acquiring the semantic feature vector of the candidate attribute according to the new sentence expression and the relation vector.
In particular, p is finally represented by a new sentenceiPerforming point multiplication on the sum relation vector to obtain a semantic feature vector related to the candidate attribute
Figure BDA0001866828040000102
S4.2: and performing word similarity modeling on the question by using a convolutional neural network to obtain word feature vectors.
The specific process is as follows:
s4.2.1: and performing similarity calculation according to the word vector corresponding to the question and the relation vector corresponding to the candidate attribute to obtain a similarity matrix formed by two similarity scores.
Specifically, the question and the candidate attribute are segmented according to the word granularity, the word vector corresponding to the question and the relation vector corresponding to the candidate attribute are obtained according to a word vector library constructed in advance, and then cosine similarity scores are mutually calculated to form a similarity matrix.
S4.2.2: and inputting the similarity matrix into a convolutional neural network, and obtaining word characteristic vectors through calculation.
In particular, a similarity matrix M is formedijInputting the data into a convolutional neural network, multiplying the data by a convolution kernel with a specific size and elements in a similar matrix to obtain a characteristic matrix, and performing maximum pooling operation from the transverse direction and the longitudinal direction to obtain c1And c2And obtaining lexical feature vectors Z through a linear network layer respectively1And Z2
It should be noted here that, in the embodiment of the present invention, the convolution kernel in the convolutional neural network is set to 3 × 3, and the channel is set to 4.
S4.3: and combining the semantic feature vector and the word feature vector, and acquiring the score of each candidate attribute and question through a linear neural network.
Specifically, the semantic feature vector and the word feature vector obtained in the previous step are spliced to obtain input data Z ═ Z of the output layer1;...;zn]. Then according to the formula S (p, r) ═ sigmoid (W)TZ + b) to obtain scores for the question and the candidate attributes.
Fig. 4 is a schematic structural diagram illustrating a question-answering system fusing a convolutional neural network and a recurrent neural network according to an exemplary embodiment, and referring to fig. 4, the system includes:
the entity acquisition module is used for acquiring an entity of a question and a query ID of the entity according to the question input by a user;
in the embodiment of the present invention, the specific process of the entity obtaining module for entity positioning of the question sentence is as follows:
according to a question input by a user, utilizing a pre-constructed dictionary tree to perform entity positioning on the question, and matching out an entity of the question and a query ID corresponding to the entity.
The question simplifying module is used for simplifying the question into a question mode according to the entity;
the attribute acquisition module is used for collecting the related attributes of the entity according to the query ID of the entity and generating a candidate attribute list;
in the embodiment of the present invention, the specific process of the attribute obtaining module obtaining the related attribute relationship of the question is as follows:
and inquiring and taking out all attribute relations connected with the entity in a pre-constructed knowledge graph according to the inquiry ID to generate a candidate attribute list.
The attribute inference module is used for inputting the question pattern and the candidate attribute list into a pre-trained attribute discriminator to obtain the score of each candidate attribute and the question;
and the answer feedback module is used for judging the attribute which is most similar to the question according to the score and completing an answer according to the most similar attribute.
Further, the attribute inference module comprises:
the semantic understanding unit is used for carrying out semantic modeling on the question by utilizing a recurrent neural network and adding an attention mechanism according to each candidate attribute to obtain a semantic feature vector;
specifically, in the embodiment of the present invention, the semantic understanding unit is embodied as a recurrent neural network structure with attention mechanism.
And the lexical similarity unit is used for performing word similarity modeling on the question by utilizing a convolutional neural network to obtain word feature vectors.
And the score output unit is used for combining the semantic feature vector and the word feature vector and acquiring the score of each candidate attribute and question through a linear neural network.
Specifically, in the embodiment of the present invention, the score output unit is preferably a BP neural network, that is, the neuron is a perceptron of a sigmoid function.
Further, the semantic understanding unit includes:
the vectorization subunit is used for segmenting the question and the candidate attributes, acquiring word vectors corresponding to the question and relation vectors corresponding to the candidate attributes according to a pre-constructed word vector library, and splicing the word vectors into sentence vectors;
the splicing subunit is used for inputting the sentence vectors into a cyclic neural network and splicing the output into a new sentence containing a front semantic relation and a rear semantic relation;
a fusion subunit, configured to multiply the new sentence by an attention weight vector to obtain a new sentence representation for the candidate attribute;
and the point multiplication subunit is used for acquiring the semantic feature vector of the candidate attribute according to the new sentence expression and the relation vector.
Further, the lexical similarity unit includes:
the similarity matrix subunit is used for performing similarity calculation according to the word vectors corresponding to the question sentences and the relation vectors corresponding to the candidate attributes to obtain a similarity matrix consisting of two similarity scores;
and the calculating subunit is used for inputting the similarity matrix into the convolutional neural network and acquiring word characteristic vectors through calculation.
Fig. 5 is a schematic structural diagram of attribute inference according to an exemplary embodiment, and referring to fig. 5, the specific process is as follows:
suppose that the question entered by the user is "who the director of xx is? Firstly, an entity obtaining module carries out entity positioning on a question, an entity of the question is positioned to be 'xx', then a query ID of 'xx' is obtained, and an attribute obtaining module collects relevant attributes of the question according to the query ID of 'xx', and generates a candidate attribute list. Then, the question reduction module replaces "xx" with a specific character, such as replacing it with < s >, who is the director of "xx? "simplify to" who the director of < s > is "question mode.
On the one hand, who the director of the question pattern "< s > is" and the candidate attribute list are input into the attribute inference module, and the score of each candidate attribute and question is obtained. The specific process is as follows: firstly, inputting a director who a question pattern is's' and a candidate attribute list into a vectorization subunit, vectorizing the vectorization subunit respectively, obtaining word vectors corresponding to the question and relation vectors corresponding to the candidate attributes, and splicing the word vectors into sentence vectors. And then, inputting the sentence vectors into a cyclic neural network of a splicing subunit, and splicing the output into a new sentence containing the semantic relation before and after. The fusion subunit then multiplies the new sentence by the attention weight vector, obtaining a new sentence representation for the candidate attribute. And finally, the point multiplication subunit performs point multiplication on the new sentence expression and the relation vector to acquire the semantic feature vector of the candidate attribute.
And on the other hand, the similar matrix subunit performs similar calculation according to the word vector corresponding to the question and the relation vector corresponding to the candidate attribute to obtain a similar matrix consisting of two similar scores. Then the calculating subunit inputs the similar matrix into a convolutional neural network, a feature matrix is obtained by utilizing a convolution kernel with a specific size and the element point multiplication in the similar matrix, then the maximum pooling operation is carried out from the transverse direction and the longitudinal direction, and then word feature vectors are obtained through a linear network layer respectively.
And finally, inputting the semantic feature vectors and the word feature vectors into a score output unit, and acquiring the score of each candidate attribute and question through a linear neural network.
All the above-mentioned optional technical solutions can be combined arbitrarily to form the optional embodiments of the present invention, and are not described herein again.
In summary, the technical solution provided by the embodiment of the present invention has the following beneficial effects:
1. according to the question-answering method and system fusing the convolutional neural network and the cyclic neural network, provided by the embodiment of the invention, the query sentence is rapidly and physically positioned by utilizing the pre-constructed dictionary tree, and the entity of the query sentence and the query ID corresponding to the entity are matched, so that a high-concurrency commercial system can be met, meaningless character string comparison can be reduced, and the query efficiency is improved;
2. according to the question-answering method and system fusing the convolutional neural network and the cyclic neural network, attribute inference is carried out through a neural network-based method, vectorization numerical calculation does not need manual template arrangement, and the problems of complicated operation, incompleteness and the like of manual arrangement can be effectively solved.
It should be noted that: in the above-described embodiment, when the question-answering system fusing the convolutional neural network and the cyclic neural network triggers the question-answering service, the above-described division of the functional modules is merely used as an example, and in practical applications, the above-described function distribution may be completed by different functional modules according to needs, that is, the internal structure of the system is divided into different functional modules to complete all or part of the above-described functions. In addition, the question-answering system fusing the convolutional neural network and the cyclic neural network and the question-answering method fusing the convolutional neural network and the cyclic neural network provided by the embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again. In addition, the question-answering system fusing the convolutional neural network and the cyclic neural network can be realized based on the question-answering method fusing the convolutional neural network and the cyclic neural network.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A question-answering method fusing a convolutional neural network and a cyclic neural network is characterized by comprising the following steps:
s1: acquiring an entity of a question and a query ID of the entity according to the question input by a user;
s2: simplifying the question into a question mode according to the entity;
s3: collecting the related attributes of the entity according to the query ID, and generating a candidate attribute list;
s4: inputting the question mode and the candidate attribute list into a pre-trained attribute discriminator to obtain the score of each candidate attribute and question;
s5: judging the attribute relationship which is most similar to the question according to the score, and taking out the attribute value of the most similar attribute relationship to finish an answer;
the step S4 specifically includes:
s4.1: semantic modeling is carried out on the question by utilizing a recurrent neural network, and a attention mechanism is added according to each candidate attribute to obtain a semantic feature vector;
s4.2: performing word similarity modeling on the question by using a convolutional neural network to obtain word feature vectors;
s4.3: and combining the semantic feature vector and the word feature vector, and acquiring the score of each candidate attribute and question through a linear neural network.
2. The method for question answering fusing a convolutional neural network and a recurrent neural network as claimed in claim 1, wherein the step S1 specifically includes:
according to a question input by a user, utilizing a pre-constructed dictionary tree to perform entity positioning on the question, and matching out an entity of the question and a query ID corresponding to the entity.
3. The question-answering method fusing the convolutional neural network and the recurrent neural network as claimed in claim 1 or 2, wherein the step S3 specifically includes:
and inquiring and taking out all attribute relations connected with the entity in a pre-constructed knowledge graph according to the inquiry ID to generate a candidate attribute list.
4. The question-answering method fusing the convolutional neural network and the recurrent neural network as claimed in claim 1, wherein the step S4.1 specifically includes:
s4.1.1: segmenting the question and the candidate attribute, acquiring a word vector corresponding to the question and a relation vector corresponding to the candidate attribute according to a pre-constructed word vector library, and splicing the word vectors into a sentence vector;
s4.1.2: inputting the sentence vectors into a cyclic neural network, and splicing the output into a new sentence containing the semantic relation before and after;
s4.1.3: multiplying the new sentence by an attention weight vector to obtain a new sentence representation for the candidate attribute;
s4.1.4: and acquiring the semantic feature vector of the candidate attribute according to the new sentence expression and the relation vector.
5. The question-answering method fusing the convolutional neural network and the recurrent neural network as claimed in claim 1, wherein the step S4.2 specifically includes:
s4.2.1: performing similarity calculation according to the word vector corresponding to the question and the relation vector corresponding to the candidate attribute to obtain a similarity matrix consisting of two similarity scores;
s4.2.2: and inputting the similarity matrix into a convolutional neural network, and obtaining word characteristic vectors through calculation.
6. A question-answering system fusing a convolutional neural network and a cyclic neural network, the system comprising at least:
the entity acquisition module is used for acquiring an entity of a question and a query ID of the entity according to the question input by a user;
the question simplifying module is used for simplifying the question into a question mode according to the entity;
the attribute acquisition module is used for collecting the related attributes of the entity according to the query ID of the entity and generating a candidate attribute list;
the attribute inference module is used for inputting the question pattern and the candidate attribute list into a pre-trained attribute discriminator to obtain the score of each candidate attribute and the question;
the answer feedback module is used for judging the attribute which is most similar to the question according to the score and completing an answer according to the most similar attribute;
the attribute inference module includes:
the semantic understanding unit is used for carrying out semantic modeling on the question by utilizing a recurrent neural network and adding an attention mechanism according to each candidate attribute to obtain a semantic feature vector;
the lexical similarity unit is used for performing word similarity modeling on the question by utilizing a convolutional neural network to obtain word feature vectors;
and the score output unit is used for combining the semantic feature vector and the word feature vector and acquiring the score of each candidate attribute and question through a linear neural network.
7. The system for question-answering fusing a convolutional neural network and a recurrent neural network as claimed in claim 6, wherein the entity acquisition module is specifically configured to:
according to a question input by a user, utilizing a pre-constructed dictionary tree to perform entity positioning on the question, and matching out an entity of the question and a query ID corresponding to the entity.
8. The question-answering system fusing the convolutional neural network and the recurrent neural network as claimed in claim 6 or 7, wherein the attribute acquisition module is specifically configured to:
and inquiring and taking out all attribute relations connected with the entity in a pre-constructed knowledge graph according to the inquiry ID to generate a candidate attribute list.
9. The question-answering system fusing the convolutional neural network and the cyclic neural network as claimed in claim 6, wherein the semantic understanding unit comprises:
the vectorization subunit is used for segmenting the question and the candidate attributes, acquiring word vectors corresponding to the question and relation vectors corresponding to the candidate attributes according to a pre-constructed word vector library, and splicing the word vectors into sentence vectors;
the splicing subunit is used for inputting the sentence vectors into a cyclic neural network and splicing the output into a new sentence containing a front semantic relation and a rear semantic relation;
a fusion subunit, configured to multiply the new sentence by an attention weight vector to obtain a new sentence representation for the candidate attribute;
and the point multiplication subunit is used for acquiring the semantic feature vector of the candidate attribute according to the new sentence expression and the relation vector.
10. The system of claim 9, wherein the lexical similarity unit comprises:
the similarity matrix subunit is used for performing similarity calculation according to the word vectors corresponding to the question sentences and the relation vectors corresponding to the candidate attributes to obtain a similarity matrix consisting of two similarity scores;
and the calculating subunit is used for inputting the similarity matrix into the convolutional neural network and acquiring word characteristic vectors through calculation.
CN201811371591.8A 2018-11-15 2018-11-15 Question-answering method and system fusing convolutional neural network and cyclic neural network Active CN109408627B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811371591.8A CN109408627B (en) 2018-11-15 2018-11-15 Question-answering method and system fusing convolutional neural network and cyclic neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811371591.8A CN109408627B (en) 2018-11-15 2018-11-15 Question-answering method and system fusing convolutional neural network and cyclic neural network

Publications (2)

Publication Number Publication Date
CN109408627A CN109408627A (en) 2019-03-01
CN109408627B true CN109408627B (en) 2021-03-02

Family

ID=65473926

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811371591.8A Active CN109408627B (en) 2018-11-15 2018-11-15 Question-answering method and system fusing convolutional neural network and cyclic neural network

Country Status (1)

Country Link
CN (1) CN109408627B (en)

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110134771B (en) * 2019-04-09 2022-03-04 广东工业大学 Implementation method of multi-attention-machine-based fusion network question-answering system
CN110232113B (en) * 2019-04-12 2021-03-26 中国科学院计算技术研究所 Method and system for improving question and answer accuracy of knowledge base
CN110084323B (en) * 2019-05-09 2021-04-06 苏州思必驰信息科技有限公司 End-to-end semantic analysis system and training method
CN110222127B (en) * 2019-06-06 2021-07-09 中国电子科技集团公司第二十八研究所 Knowledge graph-based information aggregation method, device and equipment
CN110442689A (en) * 2019-06-25 2019-11-12 平安科技(深圳)有限公司 A kind of question and answer relationship sort method, device, computer equipment and storage medium
CN110399912B (en) * 2019-07-12 2023-04-07 广东浪潮大数据研究有限公司 Character recognition method, system, equipment and computer readable storage medium
CN110717019A (en) * 2019-08-28 2020-01-21 厦门快商通科技股份有限公司 Question-answering processing method, question-answering system, electronic device and medium
CN112445899A (en) * 2019-08-29 2021-03-05 南京大学 Neural network-based attribute matching method in knowledge base question answering
CN110895533B (en) * 2019-11-29 2023-01-17 北京锐安科技有限公司 Form mapping method and device, computer equipment and storage medium
CN111008272A (en) * 2019-12-04 2020-04-14 深圳市新国都金服技术有限公司 Knowledge graph-based question and answer method and device, computer equipment and storage medium
CN112925961A (en) * 2019-12-06 2021-06-08 北京海致星图科技有限公司 Intelligent question and answer method and device based on enterprise entity
CN111310438B (en) * 2020-02-20 2021-06-08 齐鲁工业大学 Chinese sentence semantic intelligent matching method and device based on multi-granularity fusion model
CN111400455A (en) * 2020-03-18 2020-07-10 北京工业大学 Relation detection method of question-answering system based on knowledge graph
CN111506722B (en) * 2020-06-16 2024-03-08 平安科技(深圳)有限公司 Knowledge graph question-answering method, device and equipment based on deep learning technology
CN111753553B (en) * 2020-07-06 2022-07-05 北京世纪好未来教育科技有限公司 Statement type identification method and device, electronic equipment and storage medium
CN111813914B (en) * 2020-07-13 2021-07-06 龙马智芯(珠海横琴)科技有限公司 Question-answering method and device based on dictionary tree, recognition equipment and readable storage medium
CN113761140A (en) * 2020-08-13 2021-12-07 北京沃东天骏信息技术有限公司 Answer sorting method and device
CN112860867B (en) * 2021-02-25 2022-07-12 电子科技大学 Attribute selecting method and storage medium for Chinese question-answering system based on convolution neural network
CN113095361B (en) * 2021-03-08 2023-05-12 西安交通大学 Graph matching network-based comparison learning object generation method and system
CN113553844B (en) * 2021-08-11 2023-07-25 四川长虹电器股份有限公司 Domain identification method based on prefix tree features and convolutional neural network

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107632979A (en) * 2017-10-13 2018-01-26 华中科技大学 The problem of one kind is used for interactive question and answer analytic method and system
CN108228703B (en) * 2017-10-31 2020-05-08 北京市商汤科技开发有限公司 Image question-answering method, device, system and storage medium
CN108154235A (en) * 2017-12-04 2018-06-12 盈盛资讯科技有限公司 A kind of image question and answer inference method, system and device
CN108345640B (en) * 2018-01-12 2021-10-12 上海大学 Question and answer corpus construction method based on neural network semantic analysis
CN108491421B (en) * 2018-02-07 2021-04-16 北京百度网讯科技有限公司 Method, device and equipment for generating question and answer and computing storage medium
CN108345690B (en) * 2018-03-09 2020-11-13 广州杰赛科技股份有限公司 Intelligent question and answer method and system
CN108446404B (en) * 2018-03-30 2021-01-05 中国科学院自动化研究所 Search method and system for unconstrained visual question-answer pointing problem
CN108764753A (en) * 2018-06-06 2018-11-06 平安科技(深圳)有限公司 Test method, apparatus, computer equipment and the storage medium of business personnel's ability
CN108804654A (en) * 2018-06-07 2018-11-13 重庆邮电大学 A kind of collaborative virtual learning environment construction method based on intelligent answer

Also Published As

Publication number Publication date
CN109408627A (en) 2019-03-01

Similar Documents

Publication Publication Date Title
CN109408627B (en) Question-answering method and system fusing convolutional neural network and cyclic neural network
CN112650840A (en) Intelligent medical question-answering processing method and system based on knowledge graph reasoning
CN105528437B (en) A kind of question answering system construction method extracted based on structured text knowledge
CN111444344B (en) Entity classification method, entity classification device, computer equipment and storage medium
CN106446162A (en) Orient field self body intelligence library article search method
CN109145083B (en) Candidate answer selecting method based on deep learning
Zhang et al. STCS lexicon: Spectral-clustering-based topic-specific Chinese sentiment lexicon construction for social networks
CN109783806A (en) A kind of text matching technique using semantic analytic structure
CN111639165A (en) Intelligent question-answer optimization method based on natural language processing and deep learning
CN112966091A (en) Knowledge graph recommendation system fusing entity information and heat
CN111325018A (en) Domain dictionary construction method based on web retrieval and new word discovery
CN110888970B (en) Text generation method, device, terminal and storage medium
CN112784590A (en) Text processing method and device
Budikova et al. ConceptRank for search-based image annotation
CN112417170B (en) Relationship linking method for incomplete knowledge graph
CN114328800A (en) Text processing method and device, electronic equipment and computer readable storage medium
Srivastav et al. A Novel Fuzzy Graph Connectivity Measure to Perform Word Sense Disambiguation Using Fuzzy Hindi WordNet
CN111414755A (en) Network emotion analysis method based on fine-grained emotion dictionary
CN116069876A (en) Knowledge graph-based question and answer method, device, equipment and storage medium
KR102454261B1 (en) Collaborative partner recommendation system and method based on user information
KR102198780B1 (en) Method for providing correlation based internet search service specialized in professional areas
Mozafari et al. Attention-based pairwise multi-perspective convolutional neural network for answer selection in question answering
Gupta et al. Knowledge based deep inception model for web page classification
CN116226320A (en) Method and device for predicting context information, electronic equipment and storage medium
CN113987145B (en) Method, system, equipment and storage medium for accurately reasoning user attribute entity

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
TR01 Transfer of patent right

Effective date of registration: 20240306

Address after: Room 1179, W Zone, 11th Floor, Building 1, No. 158 Shuanglian Road, Qingpu District, Shanghai, 201702

Patentee after: Shanghai Zhongan Information Technology Service Co.,Ltd.

Country or region after: China

Address before: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Patentee before: ZHONGAN INFORMATION TECHNOLOGY SERVICE Co.,Ltd.

Country or region before: China

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240415

Address after: Room 1179, W Zone, 11th Floor, Building 1, No. 158 Shuanglian Road, Qingpu District, Shanghai, 201702

Patentee after: Shanghai Zhongan Information Technology Service Co.,Ltd.

Country or region after: China

Address before: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Patentee before: ZHONGAN INFORMATION TECHNOLOGY SERVICE Co.,Ltd.

Country or region before: China