A knowledge graph question answering method based on shared coding and collaborative attention
By using the self-trained E-GCNR model and CA-BiLSTM method, combined with GCN and collaborative attention mechanisms, the problem of insufficient feature extraction for entity linking and answer reasoning in knowledge graph question answering is solved, thereby improving recognition accuracy and answer prediction efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING UNIV OF POSTS & TELECOMM
- Filing Date
- 2022-12-15
- Publication Date
- 2026-04-21
AI Technical Summary
In existing knowledge graph question answering methods, entity linking tasks rely on external tools with insufficient accuracy and ignore neighbor information, resulting in low accuracy in topic word recognition; answer reasoning methods rely on human intervention and have insufficient feature representation capabilities, making it difficult to effectively distinguish between correct and incorrect answers.
We employ a self-trained entity linking E-GCNR model, extracting candidate topic word neighbor aggregation features through GCN and relation matching dimensionality reduction mechanisms. We also combine shared encoding and collaborative attention mechanisms to enhance question feature representation, thus solving the problem of insufficient feature extraction for entity linking and answer reasoning.
It improves the accuracy of entity linking and the efficiency of answer reasoning, enhances the applicability and performance of the model, and can more accurately identify keywords and predict answers.
Smart Images

Figure CN115905493B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent question answering based on knowledge graphs, specifically involving a question answering method for knowledge graphs based on shared encoding and collaborative attention. Background Technology
[0002] A knowledge graph (KG) represents massive amounts of information about the objective world as interconnected triples, forming a vast knowledge network with powerful semantic expression, storage, and reasoning capabilities. Since its introduction by Google in 2012, knowledge graphs have been widely used in fields such as intelligent question answering, recommendation systems, and search engines, greatly accelerating the development and application of artificial intelligence. Knowledge graph question answering (KGQA), as an important branch of intelligent question answering, performs semantic understanding and content parsing of questions, then queries the knowledge graph to obtain the answer.
[0003] Knowledge graph question answering consists of two parts: entity linking and answer reasoning. Entity linking aims to first identify keywords from the question, and then identify the corresponding keyword entities from multiple entities in the knowledge graph. Conversely, answer reasoning centers on the keyword entities identified in the entity linking task, considering all entities within a K-hop radius as candidate answers. Natural language processing techniques are used to determine the degree of matching between the candidate answer graph information and the question, thereby deriving the predicted answer.
[0004] Regarding entity linking tasks in knowledge graph question answering methods, current research largely relies on external entity linking tools, such as DBpedia lookup, Freebase Search API, and S_MART. However, these methods suffer from low accuracy. Current self-trained entity linking methods neglect neighbor information of candidate topic entities, leading to insufficient feature extraction. For example, in determining whether "Apple 14" is a topic entity in the knowledge graph for the question "What are the product parameters of Apple 14?", neighbor information such as "product parameters" plays a decisive role. Ignoring this information reduces the accuracy of topic entity recognition.
[0005] Current answer reasoning methods are mainly divided into two categories: semantic parsing-based and information retrieval-based. Semantic parsing-based methods suffer from drawbacks such as reliance on human intervention and lack of transferability. Information retrieval-based answer reasoning methods are limited to obtaining efficient feature representations, neglecting the importance of similarity scores between the question and the feature representations of the graph information. This results in small differences in similarity scores between correct and incorrect answers, impacting the model's efficiency and performance.
[0006] In summary, entity linking and answer reasoning methods have various shortcomings. In entity linking tasks, 1) over-reliance on entity linking tools with insufficient accuracy leads to low accuracy in topic word recognition, affecting downstream answer reasoning tasks; 2) when judging candidate topics in different domains, neighbor information plays a decisive role, but current entity linking methods ignore the entity information surrounding the candidate topic word entities, resulting in low recognition accuracy. In answer reasoning tasks, 3) semantic parsing methods rely on a large number of manually defined templates or rules, lacking transferability, making such methods difficult to apply on a large scale; 4) information retrieval methods are limited to obtaining better feature representations, which improves the prediction scores of all candidate answers without significantly differentiating the scores between correct and incorrect answers, thus causing these methods to perform poorly in practice. Summary of the Invention
[0007] To address the problems existing in the prior art, this invention proposes a knowledge graph question answering method based on shared encoding and collaborative attention. The method includes: constructing a knowledge graph; obtaining the question to be answered; retrieving candidate topic word sets and candidate topic word entity graph information from the knowledge graph based on the question; inputting the question, candidate topic word sets, and candidate topic word entity graph information into a trained entity linking E-GCNR model to obtain candidate topic word entities; retrieving candidate answer sets and candidate answer entity graph information from the knowledge graph based on the candidate topic word entities; and inputting the question, candidate answer sets, and candidate answer entity graph information into a trained answer reasoning CA-BiLSTM model to obtain the answer to the question.
[0008] Preferably, the process of training the entity link E-GCNR model includes:
[0009] S1. Obtain the original question-and-answer dataset and the corresponding knowledge graph, and divide the original question-and-answer dataset into training dataset, validation dataset and test dataset in a ratio of 7:2:1.
[0010] S2. Based on the question-and-answer data in the original question-and-answer dataset, search for the candidate topic words and the graph information of the candidate topic word entities for each question in the knowledge graph;
[0011] S3. Input the graph information of candidate topic words and candidate topic word entities from the training dataset and the validation dataset into the entity link E-GCNR model, perform K training cycles, and obtain the K-trained model.
[0012] S4: Input the data in the test dataset into K trained models for detection, and select the entity link E-GCNR model with the best performance from the K models. This model is then used as the trained entity link E-GCNR model.
[0013] Preferably, the process of training the CA-BiLSTM model for answer reasoning includes:
[0014] Step 1: Obtain the question-and-answer dataset and the corresponding knowledge graph, and divide the question-and-answer dataset into training dataset, validation dataset and test dataset in a ratio of 7:2:1;
[0015] Step 2: Based on the question-and-answer dataset, search the knowledge graph for the set of candidate answers and the graph information of the candidate answer entities for each question;
[0016] Step 3: Input the data from the training dataset and the validation dataset into the answer reasoning CA-BiLSTM model, perform K training cycles, and obtain K trained answer reasoning CA-BiLSTM models;
[0017] Step 4: Input the data from the test dataset into the trained K answer reasoning CA-BiLSTM models for performance comparison, and select the answer reasoning CA-BiLSTM model with the best performance.
[0018] The beneficial effects of this invention are:
[0019] This invention proposes an E-GCNR method for autonomously training entity linking models. This method obtains the feature representation of candidate topic words after neighbor aggregation through GCN and relation matching dimensionality reduction mechanisms, solving the problems of current entity linking tasks relying on external tools with low accuracy and ignoring neighbor node information. This invention also proposes a CA-BiLSTM method that obtains feature representations of questions and graph information through a shared encoding method and enhances the question feature representation through a collaborative attention mechanism, solving the problem of insufficient feature expression capabilities in information retrieval methods. This invention, through its shared encoding method and collaborative attention mechanism, can be applied to both entity linking and answer reasoning tasks, and has broad applicability. Attached Figure Description
[0020] Figure 1 This is a flowchart of a knowledge graph question answering method based on shared encoding and collaborative attention according to the present invention;
[0021] Figure 2 This is a diagram of the entity link E-GCNR model of the present invention;
[0022] Figure 3 This is a diagram of the CA-BiLSTM model for answer reasoning in this invention;
[0023] Figure 4 This is a comparison diagram of the traditional encoding method of this invention and the shared encoding method proposed in this paper;
[0024] Figure 5This is a schematic diagram illustrating the enhanced question feature representation using the collaborative attention mechanism of the present invention;
[0025] Figure 6 This is a schematic diagram of the subgraph aggregation mechanism of the present invention. Detailed Implementation
[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] A knowledge graph question answering method based on shared encoding and collaborative attention, such as Figure 1 As shown, the method includes: constructing a knowledge graph; obtaining the question to be answered; obtaining the graph information of the candidate topic word set and candidate topic word entities from the knowledge graph based on the question; inputting the graph information of the question, the candidate topic word set, and the candidate topic word entities into a trained entity linking E-GCNR model to obtain candidate topic word entities; obtaining the graph information of the candidate answer set and candidate answer entities from the knowledge graph based on the candidate topic word entities; and inputting the graph information of the question, the candidate answer set, and the candidate answer entities into a trained answer reasoning CA-BiLSTM model to obtain the answer to the question.
[0028] The process of training the entity link E-GCNR model includes:
[0029] S1. Obtain the original question-and-answer dataset and the corresponding knowledge graph. Divide the original question-and-answer dataset into training dataset, validation dataset and test dataset in a ratio of 7:2:1. The original question-and-answer dataset is the WebQusetions dataset.
[0030] S2. Based on the question-and-answer data in the original question-and-answer dataset, search for the candidate topic words and the graph information of the candidate topic word entities for each question in the knowledge graph;
[0031] S3. Input the graph information of candidate topic words and candidate topic word entities from the training dataset and the validation dataset into the entity link E-GCNR model, perform K training cycles, and obtain the K-trained model.
[0032] S4: Input the data in the test dataset into K trained models for detection, and select the entity link E-GCNR model with the best performance from the K models. This model is then used as the trained entity link E-GCNR model.
[0033] The graph information of candidate keyword entities includes the name, type, neighbor entity names, and neighbor path information of the candidate keyword entities, represented as follows: in, and They represent the i-th candidate keyword entities respectively. ci Name, type, neighbor entity name, and neighbor path information.
[0034] like Figure 2 As shown, the process of processing the input data using the Entity Link E-GCNR model includes: the Entity Link E-GCNR model comprises a feature extraction module, an information exchange module, and a matching module; in the feature extraction module of the Entity Link E-GCNR model, the "shared coding method" is used to extract features from the graph information of the question and candidate topic words. The inputs to the feature extraction module include: q, Their meanings are respectively the name information, type information, neighbor entity names, and neighbor path information of the i-th candidate topic word entity; the output includes: q, which is the feature representation extracted by three different embedding representations and a recurrent neural network. Feature representation Feature representation Feature representation Feature representation
[0035] In the information exchange module of the E-GCNR model for entity linking: This module includes a collaborative attention mechanism to enhance the local feature representation of questions and a subgraph aggregation mechanism to aggregate candidate topic word subgraphs. The E-GCNR model is configured with two collaborative attention mechanisms: Catt. n and Catt t Their outputs are respectively The output of the subgraph aggregation mechanism is
[0036] Matching module. By concatenating various graph information and the final output of all questions, a similarity calculation function is used to obtain the final score for each candidate answer. The formula for similarity calculation is as follows:
[0037]
[0038] Among them, f s It uses the dot product operation to calculate similarity. The final score for the i-th candidate keyword; This is for splicing operations.
[0039] In this embodiment, the shared encoding method refers to configuring the same embedding representation model and recurrent neural network for the same type of graph information and questions to extract their feature representations. This differs from the current related methods that configure embedding representation models and recurrent neural networks separately for different types of information. Figure 4 As shown, in subgraph (a), the entity name information and The same model is used for learning as for question q, while in subgraph (b), each type of information is learned using an independent model. Shared encoding is proposed to address the insufficient feature representation capabilities of answer reasoning methods in information retrieval, enabling the learning of higher-quality feature representations for questions and graph information, which is beneficial for obtaining question answers. Given that shared encoding requires less data and can obtain higher-quality feature representations, this paper applies shared encoding to the entity linking task for problem solving. The graph information input to the E-GCNR model includes entity name information, entity type information, and path information between entities. Therefore, this paper sets corresponding embedding representation models for these three types of graph information, namely… and Simultaneously, recurrent neural networks are configured for extracting feature representations from these three types of information, namely... and When extracting feature representations, and All of these belong to the entity name category, therefore they are used together with q. and To extract feature representations, the process can be formalized as follows:
[0040]
[0041]
[0042] in, and For embedded representation model The embedded representation of the output, and For recurrent neural networks Output feature representation.
[0043] The embedding representation model used in this paper is GloVe, and the recurrent neural network used is a bidirectional long short-term memory network (BiLSTM). The process of obtaining the feature representation is as follows:
[0044] e = Glove(x)
[0045] h = BiLSTM(e)
[0046] The input to GloVe is a sequence of words x = {x1, x2, ..., x...}n}, x i Let e = {e1, e2, ..., e} represent the vector representation of the i-th word. n} represents the embedded representation of the output; the input of BiLSTM is e, and the output is h = {h1, h2, ..., h}. n}, h i for xi The characteristics are represented.
[0047] Similarly, q and Using the same embedding representation model as above and recurrent neural networks The extracted features are represented as q and use and The extracted features are represented as
[0048] The recurrent neural network mentioned in shared encoding can be a bidirectional long short-term memory (BiLSTM) neural network. A BiLSTM consists of a forget gate, an input gate, an output gate, and a cell structure. The specific process of using a BiLSTM model to process sequence vectors containing rich semantic features and obtain sequence information includes processing the sequence vectors using the input and forget gates of the BiLSTM, discarding useless sequence information and retaining useful information; during the sequence processing using the BiLSTM model, forward and backward LSTMs process the contextual information of each word vector, and the output information at the same time step is merged to obtain the sequence information.
[0049] The GloVe model mentioned in shared encoding is an unsupervised word embedding method, i.e., a word vector learning method. GloVe is a Global Log Bilinear Regression Model. This model is trained using global features of the corpus (the co-occurrence frequency matrix of words); and its optimization objective function is log-linear and solved in the form of regression.
[0050] Optionally, collaborative attention mechanisms can enhance the local feature representation of the question. In the field of visual question answering, a bidirectional collaborative attention mechanism that highlights the local feature representation of the image based on the question has been proposed and achieved good results. In knowledge graph question answering methods, different types of graph information also form correspondences with different parts of the question. For example, in the question "When will Avatar be released in the UK?", "when", "UK", and "release" correspond to the entity type information "date", entity name information "UK", and path information "release" in the knowledge graph, respectively. This is similar to the characteristic of questions corresponding to local image information in the field of visual question answering. Inspired by this, this paper proposes a collaborative attention mechanism that operates on graph information and the question. It takes the feature representation of a certain type of graph information and the question as input, and enhances the question feature representation that the graph information focuses on by promoting feature interaction between different information. Figure 2 As shown, the collaborative attention mechanism uses the feature representation obtained by the feature extraction module as input. Specifically, for the name and type information within this representation, this paper sets up two collaborative attention mechanisms: Catt. n and C att t Perform feature enhancement. (Using C) att n For example, its input is the feature representation of the question. Feature representation of candidate keyword name information The output is and To obtain feature information through interaction The schematic diagram is from Figure 5 As shown, the specific process can be described as follows.
[0051] 1) In order to and Perform feature interaction and utilize self-attention encoding mechanism to The process of changing the dimension can be represented as follows:
[0052]
[0053] in, l is the number of words in the question sequence, d is the dimension of the feature representation of each word; f a It is a self-attention encoding mechanism, whose function is to change the dimension of the question feature representation; f a The output has a dimension of 1×d.
[0054] 2) The process of obtaining collaborative attention for questions can be represented as:
[0055]
[0056]
[0057]
[0058] First of all, and Multiplying by the transposes and normalizing, we obtain the joint matrix C. n ∈R 1×M M is the number of candidate keywords; secondly, C n and Multiplying them yields a further joint matrix. Finally and Multiplying by the transpose and normalizing, we obtain the collaborative attention a. n ∈R 1×l .
[0059] 3) with a n Enhanced question features can be represented as follows:
[0060]
[0061] in, This is the enhanced feature representation of the question.
[0062] Similar to the above process, Catt t by As input, the enhanced feature representation of the question can be obtained through computation.
[0063] Subgraph aggregation mechanism: The framework of the subgraph aggregation mechanism is as follows Figure 6 As shown, it includes 1) graph neural network layer; 2) path matching dimensionality reduction mechanism.
[0064] 1) The graph neural network layer is used to aggregate the feature representations of candidate topic word entity neighbor information. The aggregation process is as follows:
[0065]
[0066] Among them, A i =D i -1 / 2 ·A i Let g be the adjacency matrix of the subgraph formed by the i-th candidate keyword entity and its neighboring entities. i The aggregated feature representation is represented by W0 and W1, which are the trainable weight matrices of the first and second layers of the GCN, respectively.
[0067] 2) In order to calculate the similarity with the question during the matching stage, g needs to be... i Dimensionality reduction is performed. Unlike traditional pooling-based dimensionality reduction methods, this paper proposes a path-matching dimensionality reduction mechanism, which performs dimensionality reduction on g. iDuring dimensionality reduction, the correlation between path information and the question is used as the weight score for dimensionality reduction, so that neighboring entities with higher correlation contribute more to the feature representation of candidate keywords during dimensionality reduction. For g... i The dimensionality reduction process is as follows:
[0068] First, the similarity score between the adjacency paths from candidate keyword entities to neighboring entities and the question can be calculated and expressed as:
[0069]
[0070] in, Depend on Obtained through a self-attention encoding mechanism, The similarity score is calculated between the adjacency path information from candidate keyword entities to neighboring entities and the question.
[0071] Secondly, utilize For g i Dimensionality reduction can be represented as:
[0072]
[0073] in, This represents the feature representation of the candidate keyword entities after dimensionality reduction.
[0074] The process of training the CA-BiLSTM model for answer reasoning includes:
[0075] Step 1: Obtain the question-and-answer dataset and the corresponding knowledge graph, and divide the question-and-answer dataset into training dataset, validation dataset and test dataset in a ratio of 7:2:1;
[0076] Step 2: Based on the question-answering dataset, search the knowledge graph for the set of candidate answers and the graph information of the candidate answer entities for each question. in, and Represent the type information of the i-th candidate answer entity and the information of the keyword entity c, respectively. t Path information, neighbor background information, This refers to the neighbor whose name information and question information have the highest overlap among all neighbors.
[0077] Step 3: Input the data from the training dataset and the validation dataset into the answer reasoning CA-BiLSTM model, perform K training cycles, and obtain K trained answer reasoning CA-BiLSTM models;
[0078] Step 4: Input the data from the test dataset into the trained K answer reasoning CA-BiLSTM models for performance comparison, and select the answer reasoning CA-BiLSTM model with the best performance.
[0079] like Figure 4 As shown, the CA-BiLSTM model for answer reasoning processes the input data in the following ways: The CA-BiLSTM model for answer reasoning includes a feature extraction module, an information exchange module, and a matching module. In the feature extraction module, feature representations of the graph information of the question and candidate answer entities are extracted through shared encoding. In the information exchange module, a collaborative attention mechanism is used to promote the information interaction between the graph information of the question and the candidate answer, resulting in a feature-enhanced representation of the question. In the matching module, the answer to the question is predicted by concatenating and calculating the similarity scores between various types of graph information and the feature representation of the question.
[0080] The feature extraction module in the CA-BiLSTM model uses a shared encoding method to extract features from the question and graph information. For example... Figure 3 As shown in the bottom section, the input to this module is the question q and the graph information of the candidate answer entities. The output is A G Corresponding feature representation The feature representations extracted from h and q in different embedding representation models and recurrent neural networks, i.e. qt ,
[0081] Preferably, the information exchange module in the CA-BiLSTM model obtains the enhanced feature representation of the question through a collaborative attention mechanism. For example... Figure 3 As shown in the middle section, the CA-BiLSTM model incorporates three collaborative attention mechanisms (Catt). t Catt p and Catt c .Catt t The input is and The output is the enhanced feature representation of the question. Similarly, Catt p Catt c The output is
[0082] Preferably, the matching module in the CA-BiLSTM model calculates the similarity score of each candidate answer entity by concatenating the feature representations of the question and candidate answer entity graph information. For example... Figure 3 As shown in the top section, the enhanced feature representation of the question has and The feature representation of the entity graph information of the i-th candidate answer is: and Therefore, the similarity score between the question and each candidate answer entity can be expressed as:
[0083]
[0084] in, A similarity score is assigned to each candidate answer.
[0085] In this embodiment, the loss function of the entity link E-GCNR model is:
[0086]
[0087]
[0088] Among them, f score This indicates the similarity calculation method based on the dot product.
[0089] The loss function of the CA-BiLSTM model for answer reasoning is:
[0090]
[0091]
[0092]
[0093] Among them, f s For similarity calculation using dot product, A + A- represents the set of true candidate answers and the set of false candidate answers.
[0094] In the entity link E-GCNR model, precision is used to evaluate model performance. Precision (Acc) represents the proportion of correctly predicted data out of the total number of predicted data. Its expression is:
[0095]
[0096] Where TP represents the number of correct matches and FP represents the number of incorrect matches.
[0097] In the feature extraction module of the CA-BiLSTM model for answer reasoning, the F1 score is used to evaluate the model performance. The F1 score is a harmonic mean of recall and precision.
[0098]
[0099] Where TP represents the number of correct matches, FP represents the number of incorrect matches, and FN represents the number of correct matches not found.
[0100] The above-described embodiments further illustrate the purpose, technical solution, and advantages of the present invention. It should be understood that the above-described embodiments are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made to the present invention within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A knowledge graph question answering method based on shared encoding and collaborative attention, characterized in that, include: Constructing knowledge graphs; Obtain the question to be answered, and retrieve the candidate topic word set and candidate topic word entity graph information from the knowledge graph based on the question; input the question, candidate topic word set and candidate topic word entity graph information into the trained entity linking E-GCNR model to obtain candidate topic word entities; Based on the candidate topic word entities, obtain the candidate answer set and the graph information of the candidate answer entities from the knowledge graph; input the question, the candidate answer set, and the graph information of the candidate answer entities into the trained answer reasoning CA-BiLSTM model to obtain the answer to the question; The entity linking E-GCNR model includes a feature extraction module, an information exchange module, and a matching module; In the feature extraction module, feature representations of the question and candidate topic word graph information are extracted through shared encoding. In the information exchange module, a collaborative attention mechanism is used to promote the information interaction between the feature representations of the question and candidate topic word graph information, and a subgraph aggregation mechanism is used to aggregate the neighbor information of the candidate topic words to obtain the feature-enhanced question feature representation. In the matching module, the question topic words are predicted by concatenating and calculating the similarity scores between various graph information and the question feature representation. The graph information of candidate keyword entities includes the name information, type information, neighbor entity names, and neighbor path information of the candidate keyword entities; The answer reasoning CA-BiLSTM model includes a feature extraction module, an information exchange module, and a matching module; In the feature extraction module, feature representations of the graph information of the question and candidate answer entities are extracted through shared encoding. In the information exchange module, a collaborative attention mechanism is used to promote the information interaction between the graph information of the question and the candidate answer, resulting in a feature-enhanced question feature representation. In the matching module, the question answer is predicted by concatenating and calculating the similarity scores between various types of graph information and the question feature representation. The graph information of the candidate answer entities includes the type information of the candidate answer entities, the path information to the topic word entities, and the background information of the neighbors. The shared encoding method configures the same embedding representation model and recurrent neural network for the same type of graph information and questions to extract their feature representations.
2. The knowledge graph question answering method based on shared encoding and collaborative attention as described in claim 1, characterized in that, The process of training the entity link E-GCNR model includes: S1. Obtain the original question-and-answer dataset and the corresponding knowledge graph, and divide the original question-and-answer dataset into training dataset, validation dataset and test dataset in a ratio of 7:2:
1. S2. Based on the question-and-answer data in the original question-and-answer dataset, search for the candidate topic words and the graph information of the candidate topic word entities for each question in the knowledge graph; S3. Input the graph information of candidate topic words and candidate topic word entities from the training dataset and the validation dataset into the entity link E-GCNR model, perform K training cycles, and obtain the K-trained model. S4: Input the data in the test dataset into K trained models for detection, and select the entity link E-GCNR model with the best performance from the K models. This model is then used as the trained entity link E-GCNR model.
3. The knowledge graph question answering method based on shared encoding and collaborative attention according to claim 2, characterized in that, The original question-and-answer dataset is the WebQusetions dataset.
4. The knowledge graph question answering method based on shared encoding and collaborative attention according to claim 2, characterized in that, In selecting the best-performing entity link E-GCNR model, accuracy is used to evaluate model performance; its expression is: ; Where TP represents the number of correct matches and FP represents the number of incorrect matches.
5. The knowledge graph question answering method based on shared encoding and collaborative attention according to claim 1, characterized in that, The process of training the CA-BiLSTM model for answer reasoning includes: Step 1: Obtain the question-and-answer dataset and the corresponding knowledge graph, and divide the question-and-answer dataset into training dataset, validation dataset and test dataset in a ratio of 7:2:1; Step 2: Based on the question-and-answer dataset, search the knowledge graph for the set of candidate answers and the graph information of the candidate answer entities for each question; Step 3: Input the data from the training dataset and the validation dataset into the answer reasoning CA-BiLSTM model, perform K training cycles, and obtain K trained answer reasoning CA-BiLSTM models; Step 4: Input the data from the test dataset into the trained K answer reasoning CA-BiLSTM models for performance comparison, and select the answer reasoning CA-BiLSTM model with the best performance.
6. The knowledge graph question answering method based on shared encoding and collaborative attention according to claim 5, characterized in that, In the process of selecting the best-performing answer reasoning CA-BiLSTM model, the F1 score is used to evaluate the model performance, and its calculation expression is as follows: ; Where TP represents the number of correct matches, FP represents the number of incorrect matches, and FN represents the number of correct matches not found.
Citation Information
Patent Citations
Cross-domain recommendation method and device, electronic equipment and storage medium
CN115098692A
Entity recognition method, apparatus, electronic device and computer readable storage medium
US20220245347A1