An intelligent question answering method based on deep learning

By constructing a knowledge graph and using a multi-point guidance optimization algorithm to optimize the deep learning model, the problems of low answering accuracy and efficiency in the intelligent question and answer system are solved, and an efficient intelligent question and answer system is realized.

CN118520957BActive Publication Date: 2024-10-01CHENGDU BIG DATA GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410988110.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-10-01
Estimated Expiration
2044-07-23

AI Technical Summary

Technical Problem

The existing intelligent question and answer system uses rule matching and keyword search methods, but the answer accuracy is not high, and the deep learning model optimization effect is not ideal, resulting in answer errors and low efficiency.

Method used

Adopt an intelligent question and answer method based on deep learning to build a knowledge graph by acquiring and preprocessing intelligent question and answer corpus. Bi-LSTM, BERT and CNN models are used to build entity recognition, relationship recognition and prediction models, and a multi-point guidance optimization algorithm is used to optimize the model. Optimize to achieve intelligent matching and prediction of entities and relationships.

Benefits of technology

It improves the answer accuracy and efficiency of the intelligent question and answer system, and provides a multi-point guidance optimization algorithm to improve the accuracy of data processing and ensure the quality of answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118520957B_ABST
    Figure CN118520957B_ABST
Patent Text Reader

Abstract

The present invention discloses an intelligent question-answering method based on deep learning, which relates to the fields of deep learning technology and intelligent question-answering technology. By intelligently matching entities and relationships in questions, corresponding knowledge can be matched from intelligent question-answering corpus as answers, thereby realizing fast intelligent question-answering. For questions that cannot be matched, intelligent predictive answers are used to answer them, thereby further improving the accuracy and efficiency of answers. At the same time, a multi-point guided optimization algorithm is provided to optimize various models used to provide the accuracy of data processing, thereby ensuring the accuracy of answers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning technology and intelligent question answering technology, and specifically to an intelligent question answering method based on deep learning. Background Art

[0002] With the popularization of the Internet and the development of information technology, people's demand for intelligent question-answering systems is growing. Intelligent question-answering systems automatically understand users' questions and give correct answers through natural language processing technology. Existing intelligent question-answering systems mainly use methods such as rule matching and keyword search, but there are problems such as low answer accuracy and single answer content. In addition, deep learning models are often used in the process of natural language processing, and the optimization of deep learning models has an important impact on the final processing results. In the prior art, back propagation algorithms are often used to optimize deep learning models, resulting in less than ideal optimization effects and optimization speeds, which leads to errors in the deep learning model when processing data, and ultimately leads to low answer accuracy. Summary of the invention

[0003] The purpose of the present invention is to provide an intelligent question-answering method based on deep learning, which solves the technical problems existing in the prior art.

[0004] The present invention is achieved through the following technical solutions:

[0005] An intelligent question answering method based on deep learning, comprising:

[0006] Acquire intelligent question and answer corpus, preprocess the intelligent question and answer corpus, and construct an intelligent question and answer corpus database using the preprocessed intelligent question and answer corpus; the data in the intelligent question and answer corpus database is a knowledge graph;

[0007] The deep learning technology is used to build the entity recognition model, relationship recognition model and entity relationship prediction model, and the multi-point guided optimization algorithm is used to optimize the entity recognition model, relationship recognition model and entity relationship prediction model respectively;

[0008] Obtain a target question input by a user, pre-process the target question using an optimized entity recognition model and an optimized relationship recognition model, and then determine a first target entity and a target relationship corresponding to the target question in an intelligent question-answering corpus database;

[0009] When the first target entity has the target relationship, the target knowledge corresponding to the first target entity and the target relationship is used as the target answer corresponding to the target question, and the target answer is fed back to the user;

[0010] When the first target entity does not have the target relationship, the relationship of the first target entity is predicted by the optimized entity relationship prediction model to obtain the target answer corresponding to the target question, and the target answer is fed back to the user.

[0011] In a possible implementation, obtaining intelligent question and answer corpus, preprocessing the intelligent question and answer corpus, and using the preprocessed intelligent question and answer corpus to construct an intelligent question and answer corpus database includes:

[0012] Obtain intelligent question and answer corpus from a specified data source or obtain intelligent question and answer corpus input by a user through human-computer interaction;

[0013] After performing word segmentation, stop word removal, entity recognition, relationship extraction and knowledge graph construction steps on the intelligent question and answer corpus, an intelligent question and answer corpus database is obtained.

[0014] In a possible implementation, deep learning technology is used to construct an entity recognition model, a relationship recognition model, and an entity relationship prediction model, and a multi-point guided optimization algorithm is used to optimize the entity recognition model, the relationship recognition model, and the entity relationship prediction model, respectively, including:

[0015] The Bi-LSTM model is used to build an entity recognition model, and the multi-point guided optimization algorithm is used to optimize the entity recognition model to obtain the optimized entity recognition model;

[0016] The BERT model and CNN model are used to build a relationship recognition model, and the multi-point guided optimization algorithm is used to optimize the relationship recognition model to obtain the optimized relationship recognition model;

[0017] A fully connected neural network layer is used to build a relationship prediction model, and a multi-point guided optimization algorithm is used to optimize the relationship prediction model to obtain an optimized entity relationship prediction model.

[0018] In a possible implementation, a Bi-LSTM model is used to construct an entity recognition model, and a multi-point guided optimization algorithm is used to optimize the entity recognition model to obtain an optimized entity recognition model, including:

[0019] Build a Bi-LSTM model and use the Bi-LSTM model as an entity recognition model;

[0020] A multi-point guided optimization algorithm is used to optimize the parameters of the entity recognition model until the optimization end condition is met or the optimization reaches the maximum number of times. The set of parameters with the best fitness is used as the final parameters of the entity recognition model to obtain the optimized entity recognition model.

[0021] In a possible implementation, a BERT model and a CNN model are used to construct a relationship recognition model, and a multi-point guided optimization algorithm is used to optimize the relationship recognition model to obtain an optimized relationship recognition model, including:

[0022] Build a BERT model to extract semantic information from the target question input by the user;

[0023] After removing the output layer of the CNN model, the target CNN model is obtained, and the first feature extraction sub-model and the second feature extraction sub-model are constructed using the two target CNN models;

[0024] Constructing a similarity calculation sub-model to obtain the similarity between the first feature output by the first feature extraction sub-model and the second feature output by the second feature extraction sub-model;

[0025] The output of the BERT model is used as the input of the first feature extraction sub-model, and the output of the first feature extraction sub-model and the output of the second feature extraction sub-model are used as the input of the similarity calculation sub-model to obtain a relationship recognition model; wherein the parameters of the first feature extraction sub-model and the second feature extraction sub-model are to be optimized;

[0026] The multi-point guided optimization algorithm is used to optimize the parameters of the relationship recognition model until the optimization end condition is met or the optimization reaches the maximum number of times. The set of parameters with the best fitness is used as the final parameters of the relationship recognition model to obtain the optimized relationship recognition model.

[0027] In a possible implementation, a fully connected neural network layer is used to construct a relationship prediction model, and a multi-point guided optimization algorithm is used to optimize the relationship prediction model to obtain an optimized entity relationship prediction model, including:

[0028] Constructing an entity vector extraction sub-model to extract vectors from entities;

[0029] An importance calculation sub-model is built based on a fully connected neural network layer to evaluate the importance of other entities in the entity domain;

[0030] The output of the entity vector extraction sub-model is used as the input of the importance calculation sub-model to obtain a relationship prediction model; the parameters of the importance calculation sub-model are to be optimized;

[0031] The multi-point guided optimization algorithm is used to optimize the parameters of the relationship prediction model until the optimization end condition is met or the optimization reaches the maximum number of times. The set of parameters with the best fitness is used as the final parameters of the relationship prediction model to obtain the optimized relationship prediction model.

[0032] In a possible implementation, the multi-point guidance optimization algorithm includes:

[0033] A1. Randomly initialize the parameters of the model to be optimized, and form a parameter vector with all the parameters to obtain a preset number of parameter vectors, and any two parameter vectors are different from each other; wherein the model to be optimized is an entity recognition model, a relationship recognition model, or an entity relationship prediction model;

[0034] A2. Obtain the fitness value of each parameter vector, select H parameter vectors according to the fitness value of the parameter vector, and obtain the first reverse solution corresponding to the H parameter vectors;

[0035] A3. When the fitness of the first reverse solution increases, the first reverse solution is used to replace the corresponding parameter vector to obtain the initial updated parameter vector;

[0036] A4. Based on the initially updated parameter vector, re-obtain the fitness value corresponding to each parameter vector, and determine the best parameter vector and the worst parameter vector according to the fitness value corresponding to each parameter vector;

[0037] A5. Based on the best parameter vector and the worst parameter vector, a multi-point guidance strategy is used to guide and update the parameter vector, and the parameter vector after the second update is obtained:

[0038] ;

[0039] ;

[0040] in, Indicated in t The first optimization process after the initial update i parameter vector, i =1,2,…, I, I represents the total number of parameter vectors, Indicated in t +1 parameter vector during optimization The increment of Represents the parameter vector after the second update , represents the first guide weight, Indicates the neighborhood radius r The parameter vector in the neighborhood of The corresponding j A neighborhood parameter vector, J represents the total number of neighborhood parameter vectors, represents the second guide weight, represents the third guide weight, represents the fourth guide weight, represents the optimal parameter vector, represents the fifth guide weight, represents the worst parameter vector, represents the inertia weight, Indicated in t The parameter vector in the sub-optimization process The increment of

[0041] Neighborhood radius r for:

[0042] ;

[0043] in, represents the upper bound vector of the parameter, represents the parameter lower bound vector, represents the Euclidean distance between the upper bound vector of the parameter and the lower bound vector of the parameter, and T represents the maximum number of optimization times;

[0044] A6. Based on the parameter vector after the second update, the parameter vector is guided and updated using a multi-point information fusion strategy to obtain the parameter vector after the third update:

[0045] ;

[0046] ;

[0047] in, Indicated in t After the second update in the optimization process n The parameter vector corresponds to d Dimension parameters, Indicated in t After the second update in the optimization process m The parameter vector corresponds to d dimensional parameters, and , Indicates updated , d =1,2,…,D, where D represents the total dimension of the parameter. represents the adaptive update factor, Indicates the first d Dimension parameters, Indicates the first d Dimension parameters, Represents the parameter vector With parameter vector The Euclidean distance between represents the population information fusion strength factor, and , represents the information fusion coefficient, e represents a natural constant, represents the information fusion range factor, represents the preset maximum value of the adaptive update factor, represents the preset minimum value of the adaptive update factor, represents the optimal parameter vector d Dimension parameters;

[0048] A7, obtaining the fitness values ​​corresponding to the parameter vectors after three updates, and determining the three target parameter vectors with the smallest fitness values ​​and the best parameter vector according to the fitness values ​​corresponding to the parameter vectors obtained in step A7;

[0049] A8. Based on the optimal parameter vector, an adaptive guidance strategy is used to guide and update the target parameter vector, and the updated target parameter vector is:

[0050] ;

[0051] in, Indicated in t During the optimization process k A target parameter vector, k =1,2,3, Indicates updated , represents pi, represents the optimal parameter vector, represents the first random number uniformly distributed in [0,1], represents the second random number uniformly distributed in [0,1], |*| represents taking the absolute value of each dimension parameter;

[0052] A9. Based on the population including the updated target parameter vector, re-obtain the fitness value of each parameter vector, and determine whether the optimal fitness value converges or whether the current optimization times reaches the maximum optimization times. If so, the parameter vector corresponding to the optimal fitness value is used as the final parameter of the model to be optimized to complete the optimization, otherwise return to step A2.

[0053] In a possible implementation, a target question input by a user is obtained, and after preprocessing the target question by using an optimized entity recognition model and an optimized relationship recognition model, a first target entity and a target relationship corresponding to the target question are determined in an intelligent question-answering corpus database, including:

[0054] Obtain a target question input by a user, segment the target question, convert the obtained words into word vectors, and construct a question vector by combining all the word vectors in the order of the words;

[0055] Input the question vector into the optimized entity recognition model to obtain the entity corresponding to the target question;

[0056] Based on the entity corresponding to the target question, matching is performed in the intelligent question answering corpus database to obtain the first target entity and the knowledge corresponding to the first target entity;

[0057] After directly converting the target question into a word vector, the target question is converted into a word vector through the optimized relationship recognition model to determine the target relationship corresponding to the target question.

[0058] In a possible implementation, when the first target entity has the target relationship, the target knowledge corresponding to the first target entity and the target relationship is used as the target answer corresponding to the target question sentence, and the target answer is fed back to the user, including:

[0059] Determine whether the target relationship corresponding to the target question is located in the knowledge corresponding to the first target entity. If so, determine that the first target entity has the target relationship, use the target knowledge corresponding to the first target entity and the target relationship as the target answer corresponding to the target question, and feed back the target answer to the user. Otherwise, determine that the first target entity does not have the target relationship.

[0060] In a possible implementation, when the first target entity does not have the target relationship, predicting the relationship of the first target entity by using the optimized entity relationship prediction model to obtain a target answer corresponding to the target question, and feeding back the target answer to the user includes:

[0061] When the first target entity does not have the target relationship, extracting a first target entity feature vector corresponding to the first target entity through an entity vector extraction sub-model;

[0062] The same-knowledge entity feature vector and the neighborhood entity feature vector corresponding to the first target entity are extracted through the entity vector extraction submodel; wherein the same-knowledge entity feature vector represents the feature vector corresponding to the entity in the same knowledge as the first target entity, and the neighborhood entity feature vector represents the feature vector of the entity in the knowledge that has at least one entity identical to the first target entity, the knowledge represents a triple, and the same-knowledge entity feature vector is different from the neighborhood entity feature vector;

[0063] Determine the first importance corresponding to the same knowledge entity and the second importance corresponding to the neighboring entity through the importance calculation sub-model;

[0064] Determine the first knowledge corresponding to the first target entity according to the first importance corresponding to the knowledge entity;

[0065] Acquire other knowledge corresponding to the same knowledge entity corresponding to the first target entity in the first knowledge to obtain second knowledge;

[0066] Determine the target knowledge and the second target entity in the second knowledge according to the second importance corresponding to the neighborhood entity;

[0067] The first target entity, the relationship contained in the target knowledge, and the second target entity are used to reconstruct the knowledge, obtain a target answer corresponding to the target question, and feed back the target answer to the user.

[0068] The present invention provides an intelligent question-answering method based on deep learning. By intelligently matching entities and relationships in questions, corresponding knowledge can be matched from the intelligent question-answering corpus as answers, thereby realizing fast intelligent question-answering. For questions that cannot be matched, intelligent predictive answers are used to answer them, which can further improve the accuracy and efficiency of the answers. At the same time, a multi-point guided optimization algorithm is provided to optimize the various models used to improve the accuracy of data processing, thereby ensuring the accuracy of the answers. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without creative work. In the drawings:

[0070] Figure 1 A flowchart of an intelligent question-answering method based on deep learning provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0071] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.

[0072] like Figure 1 As shown, an embodiment of the present invention provides an intelligent question answering method based on deep learning, comprising:

[0073] S101. Obtain intelligent question and answer corpus, preprocess the intelligent question and answer corpus, and use the preprocessed intelligent question and answer corpus to construct an intelligent question and answer corpus database; the data in the intelligent question and answer corpus database is a knowledge graph.

[0074] The intelligent question and answer corpus can be divided into questions and their corresponding answers. By extracting triples of questions and their corresponding answers, we can obtain data for building a knowledge graph, and store the knowledge graph in a graph database to facilitate subsequent intelligent question and answering.

[0075] S102, using deep learning technology to build an entity recognition model, a relationship recognition model, and an entity relationship prediction model, and using a multi-point guided optimization algorithm to optimize the entity recognition model, the relationship recognition model, and the entity relationship prediction model respectively;

[0076] The entity recognition model can identify entities in questions, thereby facilitating searches in the intelligent question-answering corpus database to find knowledge related to the question.

[0077] The relationship recognition model can match the text of the question with the relationships existing in the intelligent question-answering corpus database to find the most appropriate relationship, and thus determine whether an answer exists based on the found entity.

[0078] The entity relationship prediction model can perform relationship prediction without finding a corresponding answer, thereby reconstructing triples and generating answers for questions entered by users.

[0079] S103, obtaining a target question input by a user, preprocessing the target question by using an optimized entity recognition model and an optimized relationship recognition model, and then determining a first target entity and a target relationship corresponding to the target question in an intelligent question-answering corpus database;

[0080] Determining a first target entity and a target relationship corresponding to a target question in an intelligent question and answer corpus database may include: searching the intelligent question and answer corpus database for an entity identical to the target question to obtain a first target entity; searching the intelligent question and answer corpus database for a relationship identical to or most similar to the target question to obtain a target relationship.

[0081] S104. When the first target entity has the target relationship, the target knowledge corresponding to the first target entity and the target relationship is used as the target answer corresponding to the target question, and the target answer is fed back to the user.

[0082] Optionally, when the target knowledge found is from the answer corpus, the target knowledge is directly used as the target answer corresponding to the target question, and the target answer is fed back to the user. However, in rare cases, the target knowledge matched may also be a question, so the target knowledge and the answer corresponding to the target knowledge can be used together as the corresponding target answer, and the target answer is fed back to the user.

[0083] S105. When the target relationship does not exist for the first target entity, the relationship of the first target entity is predicted by using the optimized entity relationship prediction model to obtain a target answer corresponding to the target question, and the target answer is fed back to the user.

[0084] There may not be a direct answer to the target question in the intelligent question-answering corpus database. Therefore, the target answer to the target question can be generated by predicting the relationship between entities, making the answer more intelligent.

[0085] In a possible implementation, obtaining intelligent question and answer corpus, preprocessing the intelligent question and answer corpus, and using the preprocessed intelligent question and answer corpus to construct an intelligent question and answer corpus database includes:

[0086] Obtain intelligent question and answer corpus from a specified data source or obtain intelligent question and answer corpus input by a user through human-computer interaction; by obtaining intelligent question and answer corpus input by a user through human-computer interaction, a customized question and answer service can be implemented, which can be suitable for different enterprises or users.

[0087] After performing word segmentation, stop word removal, entity recognition, relationship extraction and knowledge graph construction steps on the intelligent question and answer corpus, an intelligent question and answer corpus database is obtained.

[0088] Processing the question and answer corpus and generating an intelligent question and answer corpus database containing a knowledge graph is a relatively conventional technical means, which will not be described in detail in this embodiment.

[0089] In a possible implementation, deep learning technology is used to construct an entity recognition model, a relationship recognition model, and an entity relationship prediction model, and a multi-point guided optimization algorithm is used to optimize the entity recognition model, the relationship recognition model, and the entity relationship prediction model, respectively, including:

[0090] The Bi-LSTM model is used to build an entity recognition model, and the multi-point guided optimization algorithm is used to optimize the entity recognition model to obtain the optimized entity recognition model;

[0091] The BERT model and CNN model are used to build a relationship recognition model, and the multi-point guided optimization algorithm is used to optimize the relationship recognition model to obtain the optimized relationship recognition model;

[0092] A fully connected neural network layer is used to build a relationship prediction model, and a multi-point guided optimization algorithm is used to optimize the relationship prediction model to obtain an optimized entity relationship prediction model.

[0093] Optionally, error functions can be set for the entity recognition model, relationship recognition model and entity relationship prediction model respectively, and after adding the error function value to a constant, the inverse is taken as the fitness to facilitate the optimization of the entity recognition model, relationship recognition model and entity relationship prediction model.

[0094] In a possible implementation, a Bi-LSTM model is used to construct an entity recognition model, and a multi-point guided optimization algorithm is used to optimize the entity recognition model to obtain an optimized entity recognition model, including:

[0095] Build a Bi-LSTM model and use the Bi-LSTM model as an entity recognition model;

[0096] A multi-point guided optimization algorithm is used to optimize the parameters of the entity recognition model until the optimization end condition is met or the optimization reaches the maximum number of times. The set of parameters with the best fitness is used as the final parameters of the entity recognition model to obtain the optimized entity recognition model.

[0097] In order to facilitate understanding of the embodiments of the present invention, the working principle of the Bi-LSTM model is briefly introduced here, which may include: after obtaining a question sentence (such as: Where is the capital of China?), the question sentence is first segmented to obtain a segmentation result of where / is / the / capital / of / China, and its corresponding tag sequence is (0,0,1,0,0). After the segmentation result is converted into a word vector and input into the Bi-LSTM model, a predicted sequence can be obtained, so that the Bi-LSTM model can be trained based on the difference between the tag sequence and the predicted sequence until the maximum number of optimizations is reached.

[0098] In a possible implementation, a BERT model and a CNN model are used to construct a relationship recognition model, and a multi-point guided optimization algorithm is used to optimize the relationship recognition model to obtain an optimized relationship recognition model, including:

[0099] Build a BERT (Bidirectional Encoder Representation from Transformers, a pre-trained language representation model) model to extract semantics from the target question input by the user;

[0100] After removing the output layer of the CNN (Convolutional Neural Networks) model, a target CNN model is obtained, and the first feature extraction sub-model and the second feature extraction sub-model are constructed using the two target CNN models;

[0101] Constructing a similarity calculation sub-model to obtain the similarity between the first feature output by the first feature extraction sub-model and the second feature output by the second feature extraction sub-model;

[0102] The output of the BERT model is used as the input of the first feature extraction sub-model, and the output of the first feature extraction sub-model and the output of the second feature extraction sub-model are used as the input of the similarity calculation sub-model to obtain a relationship recognition model; wherein the parameters of the first feature extraction sub-model and the second feature extraction sub-model are to be optimized;

[0103] The multi-point guided optimization algorithm is used to optimize the parameters of the relationship recognition model until the optimization end condition is met or the optimization reaches the maximum number of times. The set of parameters with the best fitness is used as the final parameters of the relationship recognition model to obtain the optimized relationship recognition model.

[0104] In order to make it easier to match relationships, we can first replace the entities in the target question input by the user with the corresponding types, so that we can find various relationships of the same type. For example, replace "where is the capital of China" with "where is the capital of the country", where "country" represents a wildcard, and any entity that is a country can be matched. Therefore, we can obtain multiple candidate knowledge related to countries, that is, candidate relationships.

[0105] After the semantic information corresponding to the replaced question is extracted by the BERT model, it can be input into the first feature extraction sub-model for feature extraction to obtain the first feature; then the candidate knowledge or candidate relationship is input into the second feature extraction sub-model for feature extraction to obtain the second feature;

[0106] Based on the first feature and the second feature, the similarity calculation sub-model is used to calculate the similarity, and finally the candidate relationship with the highest similarity is used as the target relationship.

[0107] The working principle of the similarity calculation sub-model is to calculate the cosine similarity between the first feature and the second feature. In order to better calculate the line of sight similarity sub-model, a CNN model can be used to learn the process of calculating cosine similarity, so that the softmax layer outputs a probability, which is the cosine similarity.

[0108] In a possible implementation, a fully connected neural network layer is used to construct a relationship prediction model, and a multi-point guided optimization algorithm is used to optimize the relationship prediction model to obtain an optimized entity relationship prediction model, including:

[0109] Constructing an entity vector extraction sub-model to extract vectors from entities;

[0110] An importance calculation sub-model is built based on a fully connected neural network layer to evaluate the importance of other entities in the entity domain;

[0111] The output of the entity vector extraction sub-model is used as the input of the importance calculation sub-model to obtain a relationship prediction model; the parameters of the importance calculation sub-model are to be optimized;

[0112] The multi-point guided optimization algorithm is used to optimize the parameters of the relationship prediction model until the optimization end condition is met or the optimization reaches the maximum number of times. The set of parameters with the best fitness is used as the final parameters of the relationship prediction model to obtain the optimized relationship prediction model.

[0113] Optionally, an entity vector extraction submodel can be constructed through a graph attention network to achieve vector extraction of entities. The importance calculation submodel can include a fully connected neural network layer, multiple aggregation layers, an averaging layer, and a nonlinear activation function layer. After calculating the initial score through the fully connected neural network layer, the score aggregation is performed independently through multiple aggregation layers, and then averaged through the averaging layer, and then output through the nonlinear activation function layer.

[0114] Therefore, in the relationship prediction model, the hyperparameters of the fully connected neural network layer are mainly updated.

[0115] Optionally, in addition to the relationship prediction method described in the embodiment of the present invention, other methods may be used to predict relationships or calculate entity importance, thereby achieving relationship prediction.

[0116] In the prior art, the back propagation algorithm is often used to optimize the neural network. Although the back propagation algorithm is widely used in the training of neural networks, it also has some limitations and disadvantages: the back propagation algorithm needs to calculate the gradient of the entire network, which may be very time-consuming in large networks. In particular, when the number of network layers is large or the data set is large, the amount of calculation will increase significantly. The back propagation algorithm may fall into an optimization dilemma due to the local minimum problem. Since the algorithm is based on gradients, it may stagnate at points where the gradient is zero, especially in non-convex optimization problems. In deep networks, the gradient may decrease (disappear) or increase (explode) rapidly during the back propagation process, which makes it difficult for the network to learn deep features. Therefore, an embodiment of the present invention provides a multi-point guided optimization algorithm to solve the technical problems existing in the prior art and improve the data processing effect of neural networks.

[0117] In a possible implementation, the multi-point guidance optimization algorithm includes:

[0118] A1. Randomly initialize the parameters of the model to be optimized, and form all the parameters into a parameter vector to obtain a preset number of parameter vectors, and any two parameter vectors are different; wherein the model to be optimized is an entity recognition model, a relationship recognition model, or an entity relationship prediction model.

[0119] Optionally, a chaotic mapping initialization method can be used to optimize the hyperparameters of the optimization model, thereby achieving a better initial solution distribution, which helps to improve the convergence speed and convergence effect of the algorithm.

[0120] A2. Obtain the fitness value of each parameter vector, select H parameter vectors according to the fitness value of the parameter vector, and obtain the first reverse solution corresponding to the H parameter vectors.

[0121] A3. When the fitness of the first reverse solution increases, the first reverse solution is used to replace the corresponding parameter vector to obtain the initial updated parameter vector.

[0122] Through reverse learning and the greedy principle, the search of the solution space can be expanded, and there is no need for complex parameter calculations, which can increase the probability of finding the global optimal position to a certain extent.

[0123] A4. Based on the initially updated parameter vector, re-obtain the fitness value corresponding to each parameter vector, and determine the best parameter vector and the worst parameter vector according to the fitness value corresponding to each parameter vector;

[0124] A5. Based on the best parameter vector and the worst parameter vector, a multi-point guidance strategy is used to guide and update the parameter vector, and the parameter vector after the second update is obtained:

[0125] ;

[0126] ;

[0127] in, Indicated in t The first optimization process after the initial update i parameter vector, i =1,2,…, I, I represents the total number of parameter vectors, Indicated in t +1 parameter vector during optimization The increment of Represents the parameter vector after the second update , represents the first guide weight, Indicates the neighborhood radius r The parameter vector in the neighborhood of The corresponding j A neighborhood parameter vector, J represents the total number of neighborhood parameter vectors, represents the second guide weight, represents the third guide weight, represents the fourth guide weight, represents the optimal parameter vector, represents the fifth guide weight, represents the worst parameter vector, represents the inertia weight, Indicated in t The parameter vector in the sub-optimization process increment.

[0128] The multi-point guidance strategy proposed in the present invention can keep different parameter vectors at a certain distance and keep the forward direction consistent, which can effectively approach the best position and move away from the worst position, and is more conducive to searching for a better position in the solution space.

[0129] Neighborhood radius r for:

[0130] ;

[0131] in, represents the upper bound vector of the parameter, represents the parameter lower bound vector, represents the Euclidean distance between the upper bound vector of the parameter and the lower bound vector of the parameter, and T represents the maximum number of optimization times.

[0132] Neighborhood radius r It will change with the number of optimizations until the positions of all parameter vectors are gathered together, which can effectively improve the convergence speed of the algorithm.

[0133] A6. Based on the parameter vector after the second update, the parameter vector is guided and updated using a multi-point information fusion strategy to obtain the parameter vector after the third update:

[0134] ;

[0135] ;

[0136] in, Indicated in t After the second update in the optimization process n The parameter vector corresponds to d Dimension parameters, Indicated in t After the second update in the optimization process m The parameter vector corresponds to d dimensional parameters, and , Indicates updated , d =1,2,…,D, where D represents the total dimension of the parameter. represents the adaptive update factor, Indicates the first d Dimension parameters, Indicates the first d Dimension parameters, Represents the parameter vector With parameter vector The Euclidean distance between represents the population information fusion strength factor, and , represents the information fusion coefficient, e represents a natural constant, represents the information fusion range factor, represents the preset maximum value of the adaptive update factor, represents the preset minimum value of the adaptive update factor, represents the optimal parameter vector d Dimension parameters.

[0137] The multi-point information fusion strategy provided by the embodiment of the present invention can realize the fusion of population information, and realize the search based on the best position with the help of the information of other parameter vectors. In the early stage of the algorithm, the population is relatively scattered, which can greatly improve the global search capability. In the later stage of the algorithm, the population gathers together, which can also expand the search range to a certain extent.

[0138] A7. Obtain the fitness values ​​corresponding to the parameter vectors after three updates, and determine the three target parameter vectors with the smallest fitness values ​​and the best parameter vector according to the fitness values ​​corresponding to the parameter vectors obtained in step A7.

[0139] A8. Based on the optimal parameter vector, an adaptive guidance strategy is used to guide and update the target parameter vector, and the updated target parameter vector is:

[0140] ;

[0141] in, Indicated in t During the optimization process k A target parameter vector, k =1,2,3, Indicates updated , represents pi, represents the optimal parameter vector, represents the first random number uniformly distributed in [0,1], Represents the second random number uniformly distributed in [0,1], and |*| represents taking the absolute value of each dimension parameter.

[0142] As the algorithm progresses, the global search capability of the algorithm weakens and gradually tends to local search. Therefore, the present invention adopts an adaptive guidance strategy to guide the update of the target parameter vector, which can not only avoid the worsening of the convergence effect of the algorithm, but also retain the ability of global search. At the same time, searching with a regular trajectory can also avoid repeated searches to a certain extent. The adaptive guidance strategy is used in conjunction with the multi-point information fusion strategy to achieve early global search and later convergent search with two different search trajectories.

[0143] A9. Based on the population including the updated target parameter vector, re-obtain the fitness value of each parameter vector, and determine whether the optimal fitness value converges or whether the current optimization times reaches the maximum optimization times. If so, the parameter vector corresponding to the optimal fitness value is used as the final parameter of the model to be optimized to complete the optimization, otherwise return to step A2.

[0144] Optionally, after each parameter vector update, the parameter vector may be processed for out-of-bounds to ensure that the hyperparameters are always valid, and the greedy principle may be used to control several strategies.

[0145] In a possible implementation, a target question input by a user is obtained, and after preprocessing the target question by using an optimized entity recognition model and an optimized relationship recognition model, a first target entity and a target relationship corresponding to the target question are determined in an intelligent question-answering corpus database, including:

[0146] Obtain a target question input by a user, segment the target question, convert the obtained words into word vectors, and construct a question vector by combining all the word vectors in the order of the words;

[0147] Input the question vector into the optimized entity recognition model to obtain the entity corresponding to the target question;

[0148] Based on the entity corresponding to the target question, matching is performed in the intelligent question answering corpus database to obtain the first target entity and the knowledge corresponding to the first target entity;

[0149] After directly converting the target question into a word vector, the target question is converted into a word vector through the optimized relationship recognition model to determine the target relationship corresponding to the target question.

[0150] Optionally, when the first target entity does not exist, it can be determined that the entity corresponding to the target question does not exist in the intelligent question and answer corpus database, and thus an unanswerable prompt statement can be generated.

[0151] In a possible implementation, when the first target entity has the target relationship, the target knowledge corresponding to the first target entity and the target relationship is used as the target answer corresponding to the target question sentence, and the target answer is fed back to the user, including:

[0152] Determine whether the target relationship corresponding to the target question is located in the knowledge corresponding to the first target entity. If so, determine that the first target entity has the target relationship, use the target knowledge corresponding to the first target entity and the target relationship as the target answer corresponding to the target question, and feed back the target answer to the user. Otherwise, determine that the first target entity does not have the target relationship.

[0153] In a possible implementation, when the first target entity does not have the target relationship, predicting the relationship of the first target entity by using the optimized entity relationship prediction model to obtain a target answer corresponding to the target question, and feeding back the target answer to the user includes:

[0154] When the first target entity does not have the target relationship, extracting the same knowledge entity feature vector and the neighborhood entity feature vector corresponding to the first target entity through the entity vector extraction sub-model;

[0155] Among them, the same knowledge entity feature vector represents the feature vector corresponding to the entity in the same knowledge as the first target entity, the neighborhood entity feature vector represents the feature vector of the entity in the knowledge that has at least one entity in common with the first target entity, the knowledge represents a triple, and the same knowledge entity feature vector is different from the neighborhood entity feature vector;

[0156] Determine the first importance corresponding to the same knowledge entity and the second importance corresponding to the neighboring entity through the importance calculation sub-model;

[0157] According to the first importance corresponding to the knowledge entity, the first knowledge corresponding to the first target entity is determined, that is, the knowledge with the greatest first importance in the first-order neighborhood of the first target entity is determined as the first knowledge, so that the first related entity strongly related to the first target entity can be determined.

[0158] The other knowledge corresponding to the same knowledge entity corresponding to the first target entity in the first knowledge is obtained to obtain the second knowledge.

[0159] According to the second importance corresponding to the neighborhood entity, the target knowledge and the second target entity are determined in the second knowledge, that is, the second knowledge with the second greatest importance in the second-order neighborhood of the first target entity is determined as the target knowledge, and the second target entity having a correlation with the first related entity is determined in the target knowledge;

[0160] The first target entity, the relationship contained in the target knowledge, and the second target entity are used to reconstruct the knowledge, obtain a target answer corresponding to the target question, and feed back the target answer to the user.

[0161] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0162] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0163] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0164] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0165] A person of ordinary skill in the art can understand that all or part of the steps in realizing the above-mentioned facts and methods can be completed by instructing the relevant hardware through a program, and the program involved or the program described can be stored in a computer-readable storage medium. When the program is executed, it includes the following steps: At this time, the corresponding method steps are derived, and the storage medium can be ROM / RAM, a disk, an optical disk, etc.

[0166] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. An intelligent question-answering method based on deep learning, It is characterized in that include: Acquire intelligent question and answer corpus, preprocess the intelligent question and answer corpus, and use the preprocessed intelligent question and answer corpus to build an intelligent question and answer corpus database; The data in the intelligent question-answering corpus database is a knowledge graph; The deep learning technology is used to build the entity recognition model, relationship recognition model and entity relationship prediction model, and the multi-point guided optimization algorithm is used to optimize the entity recognition model, relationship recognition model and entity relationship prediction model respectively; Obtain a target question input by a user, pre-process the target question using an optimized entity recognition model and an optimized relationship recognition model, and then determine a first target entity and a target relationship corresponding to the target question in an intelligent question-answering corpus database; When the first target entity has the target relationship, the target knowledge corresponding to the first target entity and the target relationship is used as the target answer corresponding to the target question, and the target answer is fed back to the user; When the first target entity does not have the target relationship, the relationship of the first target entity is predicted by the optimized entity relationship prediction model to obtain the target answer corresponding to the target question, and the target answer is fed back to the user; Acquiring intelligent question and answer corpus, preprocessing the intelligent question and answer corpus, and using the preprocessed intelligent question and answer corpus to construct an intelligent question and answer corpus database, including: Obtain intelligent question and answer corpus from a specified data source or obtain intelligent question and answer corpus input by a user through human-computer interaction; After sequentially performing word segmentation, stop word removal, entity recognition, relationship extraction, and knowledge graph construction steps on the intelligent question and answer corpus, an intelligent question and answer corpus database is obtained; Deep learning technology is used to build entity recognition model, relationship recognition model and entity relationship prediction model, and multi-point guided optimization algorithm is used to optimize the entity recognition model, relationship recognition model and entity relationship prediction model respectively, including: The Bi-LSTM model is used to build an entity recognition model, and the multi-point guided optimization algorithm is used to optimize the entity recognition model to obtain the optimized entity recognition model; The BERT model and CNN model are used to build a relationship recognition model, and the multi-point guided optimization algorithm is used to optimize the relationship recognition model to obtain the optimized relationship recognition model; A fully connected neural network layer is used to build a relationship prediction model, and a multi-point guided optimization algorithm is used to optimize the relationship prediction model to obtain an optimized entity relationship prediction model; The Bi-LSTM model is used to build an entity recognition model, and the multi-point guided optimization algorithm is used to optimize the entity recognition model to obtain the optimized entity recognition model, including: Build a Bi-LSTM model and use the Bi-LSTM model as an entity recognition model; The parameters of the entity recognition model are optimized by using a multi-point guided optimization algorithm until the optimization end condition is met or the optimization reaches the maximum number of times, and the set of parameters with the best fitness is used as the final parameters of the entity recognition model to obtain the optimized entity recognition model; The BERT model and CNN model are used to build a relationship recognition model, and the multi-point guided optimization algorithm is used to optimize the relationship recognition model to obtain the optimized relationship recognition model, including: Build a BERT model to extract semantic information from the target question input by the user; After removing the output layer of the CNN model, the target CNN model is obtained, and the first feature extraction sub-model and the second feature extraction sub-model are constructed using the two target CNN models; Constructing a similarity calculation sub-model to obtain the similarity between the first feature output by the first feature extraction sub-model and the second feature output by the second feature extraction sub-model; The output of the BERT model is used as the input of the first feature extraction sub-model, and the output of the first feature extraction sub-model and the output of the second feature extraction sub-model are used as the input of the similarity calculation sub-model to obtain a relationship recognition model; wherein the parameters of the first feature extraction sub-model and the second feature extraction sub-model are to be optimized; The multi-point guided optimization algorithm is used to optimize the parameters of the relationship recognition model until the optimization end condition is met or the optimization reaches the maximum number of times, and the set of parameters with the best fitness is used as the final parameters of the relationship recognition model to obtain the optimized relationship recognition model; The fully connected neural network layer is used to build a relationship prediction model, and the multi-point guided optimization algorithm is used to optimize the relationship prediction model to obtain the optimized entity relationship prediction model, including: Constructing an entity vector extraction sub-model to extract vectors from entities; An importance calculation sub-model is built based on a fully connected neural network layer to evaluate the importance of other entities in the entity domain; The output of the entity vector extraction sub-model is used as the input of the importance calculation sub-model to obtain a relationship prediction model; the parameters of the importance calculation sub-model are to be optimized; The parameters of the relationship prediction model are optimized by using a multi-point guided optimization algorithm until the optimization end condition is met or the optimization reaches the maximum number of times, and a set of parameters with the best fitness is used as the final parameters of the relationship prediction model to obtain the optimized relationship prediction model; The multi-point guidance optimization algorithm comprises: A1. Randomly initialize the parameters of the model to be optimized, and form a parameter vector with all the parameters to obtain a preset number of parameter vectors, and any two parameter vectors are different from each other; wherein the model to be optimized is an entity recognition model, a relationship recognition model, or an entity relationship prediction model; A2. Obtain the fitness value of each parameter vector, select H parameter vectors according to the fitness value of the parameter vector, and obtain the first reverse solution corresponding to the H parameter vectors; A3. When the fitness of the first reverse solution increases, the first reverse solution is used to replace the corresponding parameter vector to obtain the initial updated parameter vector; A4. Based on the initially updated parameter vector, re-obtain the fitness value corresponding to each parameter vector, and determine the best parameter vector and the worst parameter vector according to the fitness value corresponding to each parameter vector; A5. Based on the best parameter vector and the worst parameter vector, a multi-point guidance strategy is used to guide and update the parameter vector, and the parameter vector after the second update is obtained: ; ; in, Indicated in t The first optimization process after the initial update i parameter vector, i =1,2,…, I, I represents the total number of parameter vectors, Indicated in t +1 parameter vector during optimization The increment of Represents the parameter vector after the second update , represents the first guide weight, Indicates the neighborhood radius r The parameter vector in the neighborhood of The corresponding j A neighborhood parameter vector, J represents the total number of neighborhood parameter vectors, represents the second guide weight, represents the third guide weight, represents the fourth guide weight, represents the optimal parameter vector, represents the fifth guide weight, represents the worst parameter vector, represents the inertia weight, Indicated in t The parameter vector in the sub-optimization process The increment of Neighborhood radius r for: ; in, represents the upper bound vector of the parameter, represents the parameter lower bound vector, represents the Euclidean distance between the upper bound vector of the parameter and the lower bound vector of the parameter, and T represents the maximum number of optimization times; A6. Based on the parameter vector after the second update, the parameter vector is guided and updated using a multi-point information fusion strategy to obtain the parameter vector after the third update: ; ; in, Indicated in t After the second update in the optimization process n The parameter vector corresponds to d Dimension parameters, Indicated in t After the second update in the optimization process m The parameter vector corresponds to d dimensional parameters, and , Indicates updated , d =1,2,…,D, where D represents the total dimension of the parameter. represents the adaptive update factor, Indicates the first d Dimension parameters, Indicates the first d Dimension parameters, Represents the parameter vector With parameter vector The Euclidean distance between represents the population information fusion strength factor, and , represents the information fusion coefficient, e represents a natural constant, represents the information fusion range factor, represents the preset maximum value of the adaptive update factor, represents the preset minimum value of the adaptive update factor, represents the optimal parameter vector d Dimension parameters; A7, obtaining the fitness values ​​corresponding to the parameter vectors after three updates, and determining the three target parameter vectors with the smallest fitness values ​​and the best parameter vector according to the fitness values ​​corresponding to the parameter vectors obtained in step A7; A8. Based on the optimal parameter vector, an adaptive guidance strategy is used to guide and update the target parameter vector, and the updated target parameter vector is: ; in, Indicated in t During the optimization process k A target parameter vector, k =1,2,3, Indicates updated , represents pi, represents the optimal parameter vector, represents the first random number uniformly distributed in [0,1], represents the second random number uniformly distributed in [0,1], |*| represents taking the absolute value of each dimension parameter; A9. Based on the population including the updated target parameter vector, re-obtain the fitness value of each parameter vector, and determine whether the optimal fitness value converges or whether the current optimization times reaches the maximum optimization times. If so, the parameter vector corresponding to the optimal fitness value is used as the final parameter of the model to be optimized to complete the optimization, otherwise return to step A2.

2. According to the deep learning-based intelligent question-answering method of claim 1, It is characterized in that Obtaining a target question input by a user, preprocessing the target question by using an optimized entity recognition model and an optimized relationship recognition model, and then determining a first target entity and a target relationship corresponding to the target question in an intelligent question-answering corpus database, including: Obtain a target question input by a user, segment the target question, convert the obtained words into word vectors, and construct a question vector by combining all the word vectors in the order of the words; Input the question vector into the optimized entity recognition model to obtain the entity corresponding to the target question; Based on the entity corresponding to the target question, matching is performed in the intelligent question answering corpus database to obtain the first target entity and the knowledge corresponding to the first target entity; After directly converting the target question into a word vector, the target question is converted into a word vector through the optimized relationship recognition model to determine the target relationship corresponding to the target question.

3. According to the deep learning-based intelligent question-answering method of claim 2, It is characterized in that When the first target entity has the target relationship, the target knowledge corresponding to the first target entity and the target relationship is used as the target answer corresponding to the target question, and the target answer is fed back to the user, including: Determine whether the target relationship corresponding to the target question is located in the knowledge corresponding to the first target entity. If so, determine that the first target entity has the target relationship, use the target knowledge corresponding to the first target entity and the target relationship as the target answer corresponding to the target question, and feed back the target answer to the user. Otherwise, determine that the first target entity does not have the target relationship.

4. The intelligent question-answering method based on deep learning according to claim 3, It is characterized in that When the first target entity does not have the target relationship, the relationship of the first target entity is predicted by the optimized entity relationship prediction model to obtain a target answer corresponding to the target question, and the target answer is fed back to the user, including: When the first target entity does not have the target relationship, the same knowledge entity feature vector and the neighborhood entity feature vector corresponding to the first target entity are extracted through the entity vector extraction submodel; wherein the same knowledge entity feature vector represents the feature vector corresponding to the entity in the same knowledge as the first target entity, and the neighborhood entity feature vector represents the feature vector of the entity in the knowledge that has at least one entity identical to the first target entity, the knowledge represents a triple, and the same knowledge entity feature vector is different from the neighborhood entity feature vector; Determine the first importance corresponding to the same knowledge entity and the second importance corresponding to the neighboring entity through the importance calculation sub-model; Determine the first knowledge corresponding to the first target entity according to the first importance corresponding to the knowledge entity; Acquire other knowledge corresponding to the same knowledge entity corresponding to the first target entity in the first knowledge to obtain second knowledge; Determine the target knowledge and the second target entity in the second knowledge according to the second importance corresponding to the neighborhood entity; The first target entity, the relationship contained in the target knowledge, and the second target entity are used to reconstruct the knowledge, obtain a target answer corresponding to the target question, and feed back the target answer to the user.