A knowledge graph question generation method based on key semantic information enhancement

By adopting the method of key semantic information enhancement in the generation of knowledge graph problems, using technologies such as node answer interaction layer and bidirectional gated graph neural network, the problem of node and edge information capturing semantic information is solved, and the quality and ability of problem generation are improved Responsive, suitable for Q&A, education and e-commerce.

CN118839776BActive Publication Date: 2024-12-24YUNNAN NORMAL UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411321284.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2024-12-24
Estimated Expiration
2044-09-23

AI Technical Summary

Technical Problem

The existing knowledge graph problem generation method cannot effectively capture important semantic information between nodes and edge text words when encoding nodes and edge information in the graph, and fails to make full use of the answer information and answer mark information of the knowledge graph, resulting in poor generation and Unanswerable questions.

Method used

Using a method based on key semantic information enhancement, the knowledge graph data is preprocessed, and the node answer interaction layer, the node text information encoding layer and the bidirectional gated graph neural network are used for encoding. Combining the attention mechanism, the gated mechanism and the replication mechanism, the generated Deeper and answerable questions.

Benefits of technology

Improves the quality of knowledge graph questions generation, generates smoother and answerable questions, is superior to existing methods, is widely used in Q&A, education and e-commerce, and performs superior in automatic evaluation and manual evaluation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118839776B_ABST
    Figure CN118839776B_ABST
Patent Text Reader

Abstract

The present invention proposes a knowledge graph question generation method based on key semantic information enhancement, which belongs to the technical field of question generation in natural language processing. It includes: converting the node entity and edge information of the knowledge graph into a word embedding vector to obtain the input data information required by the model; then constructing an encoder based on the key semantic information enhancement model, using the node answer interaction layer to obtain the knowledge graph node embedding that integrates the answer information in the encoding stage, and combining the node text information encoding layer to capture the important semantic information between the text words in the nodes and edges to obtain an enhanced key semantic information knowledge graph, and then inputting the enhanced key semantic information knowledge graph into a bidirectional gated graph neural network for encoding; finally, in the decoding process, combining the recurrent neural network based on the attention mechanism and the pointer copy mechanism to generate questions. Experimental results show that the method of the present invention is superior to the existing advanced methods in terms of automatic evaluation indicators.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a knowledge graph question generation method based on key semantic information enhancement, and belongs to the technical field of question generation in natural language processing. Background Art

[0002] Knowledge Graph Question Generation (KGQG) aims to generate natural language questions using structured knowledge base queries. It can not only effectively provide a large amount of labeled training data for the knowledge base question-answering system and solve the problem of consuming a lot of manpower and time, but can also be used to generate practical evaluations in the education field and complete multiple rounds of question-answering in the e-commerce field.

[0003] KGQG usually uses a set of facts extracted from the knowledge base to generate natural language questions, where each fact is specified as a triple (e1, r, e2), that is, r indicates that entity e1 is related to entity e2. In the past decade, KGQG research has relied heavily on hand-crafted question generation templates. These studies usually construct structured queries and use pre-designed templates to generate questions. However, this template-based approach not only wastes a lot of manpower and time costs, but also has problems such as poor scalability. Therefore, with the development of deep neural networks, some researchers have proposed using recurrent neural networks and Transformers to study question generation based on knowledge graphs, and to study end-to-end question generation in a data-driven manner. However, current research cannot effectively utilize the subgraph information in the knowledge graph in the process of generating questions, resulting in the inability to perform multi-hop reasoning at a deeper level, and ultimately resulting in the generation of simple questions. To this end, subsequent researchers have further studied KGQG to solve this problem. Researchers have studied how to generate deeper questions by constructing subgraphs of knowledge graphs or using pre-trained models to improve the quality of question generation. However, although the above studies can use the subgraph structure of the knowledge graph or the pre-trained model to a certain extent to mine deeper semantic information, generate more in-depth questions, and improve the quality of KGQG, they cannot capture the key semantic information between texts when encoding the text information of nodes and edges, and fail to fully utilize the answer information and answer tag information of the knowledge graph. Summary of the invention

[0004] The technical problem to be solved by the present invention is: the present invention aims to propose a knowledge graph question generation method based on key semantic information enhancement, which solves the problem that the existing knowledge graph question generation cannot effectively capture the important semantic information between the node and edge text words when encoding the node and edge information in the graph, and fails to make full use of the answer information and answer tag information of the knowledge graph, which easily leads to the generation of unsmooth and unanswerable questions. The model can effectively improve the quality of knowledge graph question generation, and further generate more fluent and answerable questions, so as to apply it to the question-answering field, education field, e-commerce field, etc.

[0005] The technical solution of the present invention is: a knowledge graph question generation method based on key semantic information enhancement, the specific steps of the method are as follows:

[0006] Step 1: Preprocess the public dataset PQ (PathQuestions) to obtain the input data required for the knowledge graph question generation model based on key semantic information enhancement.

[0007] Step 1.1: In order to obtain data information for model training, extract the knowledge graph node information, edge information, answer information, and answer tag information from the public data set PQ, preprocess the obtained knowledge graph node information, edge information, answer information, and answer tag information, and obtain the corresponding word vectors, that is, obtain the corresponding node embedding, edge embedding, answer word embedding, and answer tag embedding. The specific implementation is: first, represent the set of knowledge graphs as G=(V, E), where V is represented as the set of nodes (entities), denoted as V=( ), E is represented as a set of edges (predicates), denoted by E=( ), where mv represents the number of nodes and me represents the number of edges. In order to effectively encode the transformed knowledge graph subgraph, it is necessary to map the nodes and edges to an initial embedding space. The specific embedding formula is expressed as ), ),in and Represent the text word embedding vectors in nodes and edges respectively, vw represents the number of text words in each node, and ew represents the number of text words in each edge. In order to better align the answer with the node information, the present invention processes the text information of the answer through the pre-trained Glove embedding to obtain the embedding of the answer information ).in Represents the word embedding vector of the answer word, and aw represents the number of text words in each answer. At the same time, the position of the answer information in the node is marked, the position of the non-answer entity in the node is marked as 0, and the position of the answer entity in the node is marked as 1, and its marking information is converted into the answer mark embedding.

[0008] In Step 1.1, the dimension of node embedding is 300, the dimension of edge embedding is 300, the dimension of answer word embedding is 300, and the dimension of answer tag embedding is 32.

[0009] Step 1.2: The knowledge graph node embedding, edge embedding, answer information word embedding, and answer tag embedding obtained after preprocessing are used as the input of the model to train the knowledge graph question generation model based on key semantic information enhancement.

[0010] Step 2: Construct an encoder for the knowledge graph question generation model based on key semantic information enhancement. In the encoding stage, the data obtained in Step 1 is input into the node answer interaction layer, the node text information encoding layer, and the bidirectional gated graph neural network for encoding in sequence to obtain enhanced knowledge graph encoding information that integrates the answer information.

[0011] Step 2.1: In order to obtain the node information of the fused answer and improve the quality of knowledge graph-based question generation, the attention mechanism is used to align the contextual information from the target answer and the node words. The node embedding and answer word embedding obtained in Step 1 are input into the node-answer interaction layer. The node information and the answer information are fused using the attention mechanism to obtain the node representation of the fused answer information, that is, the node embedding of the fused answer information and the edge embedding of the unfused answer information.

[0012] Step 2.2: In order to more effectively obtain the text sequence information in the node and capture the subtle differences between text words. First, the node embedding of the fused answer information and the edge embedding of the unfused answer information obtained in Step 2.1 are respectively input into the node text information encoding layer for encoding to obtain an enhanced key semantic information knowledge graph, and two BiLSTMs (i.e., one for nodes and one for edges) are used to encode the contextual text information of nodes and edges. Then, in order to capture the subtle differences between node text words and improve the quality of question generation, the gating mechanism is used to control the output of the forward and backward hidden layer information of the text information, and then the gating information is multiplied with the forward and backward hidden layer information to obtain the key semantic information, and the obtained forward hidden layer information, gated forward hidden layer information, backward hidden layer information, and gated backward hidden layer information are spliced. Finally, the obtained text semantic information is selected using linear transformation, and finally the enhanced key semantic information node embedding and enhanced key semantic information edge embedding are obtained.

[0013] Step 2.3: Then, concatenate the answer tag information in Step 1.1 with the node embedding of the enhanced key semantic information knowledge graph obtained in Step 2.2, and concatenate the concatenated node embedding with the unfused answer information side information of the enhanced key semantic information knowledge graph obtained in Step 2.2 and input them into the bidirectional gated graph neural network for encoding. The bidirectional gated graph neural network uses gated recurrent units, message passing mechanisms, and pooling operations to enhance the model's ability to understand and represent knowledge graph data. The hidden layer dimension of the bidirectional gated graph neural network is 300, and the answer tag embedding dimension is 32.

[0014] Step 3: Construct a decoder based on the knowledge graph question generation model enhanced with key semantic information. During the decoding process, the enhanced knowledge graph encoding information obtained in Step 2 is input into the decoder, and questions are generated using a recurrent neural network and a pointer copy mechanism.

[0015] Step 3.1: Construct a decoder based on the knowledge graph question generation model enhanced with key semantic information, using a unidirectional LSTM as the decoder (the dimension of the hidden layer is 300, and the dimension of the output at each time step is the sum of the number of existing words in the current vocabulary and the replication mechanism), generating each question word step by step, and finally forming a complete question. The initial state of the decoder is to input the final global node embedding vector encoded by the graph neural network into two independent fully connected layers as the hidden state of the initial decoder and At the same time, in order to timely integrate the important information of the source text information in each decoding process, it is necessary to retain the node embedding of the graph neural network encoding , Represents a node in the graph. In each decoding step t, the attention mechanism learns to focus on the most relevant nodes in the input graph and decodes the state of the previous moment , the attention mechanism calculates the hidden vector of the context and the character embedding of the previous question word read by the decoder Calculate the new hidden state together .

[0016] Step 3.2: During the decoding process, in the prediction process of the current time step, in order to improve the problem of unknown words generated based on the knowledge graph problem, a node-level copy mechanism is introduced to generate problem words. It is allowed to copy node attributes (i.e., the text in the node) from the input graph. However, the difference from the previous copy mechanism is that the entity nodes in the transformed Levy graph are copied by using a mask copy mechanism, but the predicate nodes are not copied. That is, in each step of decoding, according to the context vector , decoder status and the character embedding of the previous question word read by the decoder Calculate the probability of generation .in It is used as a soft switch to choose whether to generate words from the vocabulary or copy node attributes from the input graph. Ultimately, this copy mechanism can dynamically maintain an extended vocabulary, enhance the model's ability to handle rare words and proper nouns, and greatly improve the effect of question generation.

[0017] The beneficial effects of the present invention are:

[0018] 1. In theory, this invention proposes a knowledge graph question generation method based on key semantic information enhancement, which can alleviate the problem that the existing knowledge graph question generation cannot effectively capture the key semantic information between words in the node when encoding the node and edge information in the graph, and fails to make full use of the answer information and answer tag information of the knowledge graph, which easily leads to the generation of unsmooth and unanswerable questions. This further improves the quality of knowledge graph question generation and provides research ideas for researchers in the field of subsequent question generation;

[0019] 2. In practice, the model of the present invention can be used in the field of question answering, where it is used for data enhancement. In the field of education, it can generate natural language questions based on the constructed knowledge graph to assist teachers in completing the question setting function. The above applications all show that the present invention has a wide range of applications. Moreover, the present invention can realize end-to-end automatic knowledge graph question generation. Experimental results show that the knowledge graph question generation method is superior to advanced knowledge graph question generation methods in both automatic evaluation and manual evaluation. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a framework model diagram of the knowledge graph question generation method based on key semantic information enhancement of the present invention;

[0021] Figure 2 is an encoder graph of the knowledge graph question generation method of the present invention;

[0022] Figure 3 is a decoder diagram of the knowledge graph question generation method of the present invention;

[0023] Figure 4 It is a process framework diagram of the present invention. DETAILED DESCRIPTION

[0024] The present invention will be further described below in conjunction with the accompanying drawings and specific implementation methods.

[0025] Example 1: Figure 1-Figure 4 As shown in Figure 1, a knowledge graph question generation method based on key semantic information enhancement is proposed. The framework of the model is as follows: Figure 1 As shown in the process framework diagram Figure 4 As shown, through Figure 4 Assist understanding Figure 1 The framework model diagram. The specific steps are:

[0026] Step 1: Preprocess the public dataset PQ (PathQuestions) to obtain the input data required for model training;

[0027] First, extract the knowledge graph node information, edge information, answer information, and answer tag information from the public dataset PQ, preprocess the obtained knowledge graph node information, edge information, answer information, and answer tag information to obtain the corresponding word embedding. The set of knowledge graphs is represented as G=(V, E), where V is represented as the set of nodes (entities) and E is represented as the set of edges (predicates), denoted as V=( ) and E=( ), where mv represents the number of nodes and me represents the number of edges. In order to effectively encode the transformed knowledge graph subgraph, it is necessary to map the nodes and edges to an initial embedding space. The specific embedding formula is expressed as ), ),in and Represent the text word embedding vectors in nodes and edges respectively, the dimension of the embedding vector is 300, vw represents the number of text words in each node, and ew represents the number of text words in each edge. In order to better align the answer with the node information, the present invention processes the text information of the answer through the pre-trained Glove embedding to obtain the embedding of the answer information ).in Represents the word embedding vector of the answer word, the dimension of the answer word embedding vector is 300, and aw represents the number of text words in each answer. At the same time, the position of the answer information in the node is marked, the position of the non-answer entity in the node is marked as 0, and the position of the answer entity in the node is marked as 1, and its marking information is converted into the answer tag embedding, and the word embedding dimension of the answer tag is 32.

[0028] Step 2: Construct an encoder for the knowledge graph question generation model based on key semantic information enhancement. In the encoding stage, the data obtained in Step 1 is sequentially input into the node answer interaction layer, the node text information encoding layer, and the bidirectional gated graph neural network to encode the input knowledge graph and answer information; Figure 2 shown.

[0029] Step 2.1: In the node-answer interaction layer, the attention mechanism is used to align the context information from the target answer and the node word to obtain the node representation of the fused answer information. That is, the node embedding and answer word embedding obtained in Step 1 are input into the node-answer interaction layer, and the node information and the answer information are fused using the attention mechanism to obtain the knowledge graph node representation of the fused answer information. The node representation expression of the fused target answer obtained using the attention mechanism is as follows:

[0030] (1)

[0031] in represents the text word embedding vector in the jth node, represents the i-th answer word embedding vector, represents the attention score of the interaction between the word embedding in the node and the target answer word embedding, and T represents the transpose of the matrix.

[0032] (2)

[0033] in, Node embeddings representing the fused target answer, Represents the total number of words in the node, Represents the attention score of the interaction between multiple word embeddings in a node and the target answer word embedding.

[0034] Step 2.2: In order to more effectively obtain the text sequence information in the node, encode the nodes and edges in the knowledge graph, and use two BiLSTMs (one for the node and one for the edge) to encode their contextual text information. The specific formula is as follows:

[0035] =BiLSTM( )(3)

[0036] in, and Respectively represent the forward hidden layer features obtained by fusing the target answer node encoding at the current and previous time steps, Hidden layer features of the node at the current time step.

[0037] =BiLSTM( )(4)

[0038] in, and Respectively represent the backward hidden layer features obtained by fusing the answer node encoding at the current and next time steps.

[0039] =BiLSTM( )(5)

[0040] in, and Represent the forward hidden layer features encoded at the current and previous time steps, respectively. Represents the hidden layer features of the answer at the current time step.

[0041] =BiLSTM( )(6)

[0042] in, and Represent the backward hidden layer features obtained by encoding the current and previous time steps respectively.

[0043] In order to capture the important semantic information of the word text in the node and improve the quality of the generated problem, the gating mechanism is first used to control the forward and backward hidden layer features of the text information in the node, and then the obtained gating information is multiplied with the forward and backward hidden layer features to determine which semantic information in the words in the captured node needs to be enhanced and which semantic information needs to be weakened, and the forward node semantic representation is obtained. and backward node semantic representation , thereby improving the importance of the semantic information of words within the node. The specific formula is as follows:

[0044] (7)

[0045] (8)

[0046] Among them, Sigmoid is the gate activation function, represents the Hadamard product, and They represent the forward and backward hidden layer features of the fused target answer node obtained by formulas (3)-(4) respectively.

[0047] Similarly, for the internal words of the node, the same operation as the above node is performed to improve the importance of the semantic information of the internal words of the edge. The specific formula is as follows:

[0048] (9)

[0049] (10)

[0050] The meaning of the superscript e is the feature of the obtained edge. They represent the forward and backward hidden layer features of the fused target answer obtained by formulas (3)-(4) respectively.

[0051] Then, the forward hidden layer information, gated forward hidden layer information, backward hidden layer information, and gated backward hidden layer information of the node representation information are concatenated, and their linear transformation is used to select the key semantic information of the node that integrates the answer information.

[0052] (11)

[0053] (12)

[0054] in It represents the embedded information of the forward hidden layer information, gated forward hidden layer information, backward hidden layer information, and gated backward hidden layer information represented by the fusion node. The embedding dimension of the hidden layer is 300 dimensions. The hidden layer embedding dimension is 1200. It means that the key semantic information of nodes that integrate answer information is embedded by using its linear transformation. The hidden layer embedding dimension of is 300.

[0055] Similarly, the forward hidden layer information, gated forward hidden layer information, backward hidden layer information, and gated backward hidden layer information of the edge representation information are concatenated, and their linear transformation is used to select the key semantic information of the edge.

[0056] (13)

[0057] (14)

[0058] Among them; represents the splicing operation, Linear is a linear transformation function, It represents the embedded information of the forward hidden layer information, gated forward hidden layer information, backward hidden layer information, and gated backward hidden layer information of the fused edge representation. The embedding dimension of the hidden layer is 300 dimensions. The hidden layer embedding dimension is 1200. Indicates that the embedding of the edge key semantic information that has been selected to integrate the answer information, The hidden layer embedding dimension of is 300.

[0059] Finally, the final hidden layer information and As the context information of global nodes and edges, =( )and =( ),in represents all node embeddings that incorporate answer information, Represents a single node embedding that incorporates answer information. Similarly, represents all edge embeddings that incorporate answer information, Represents a single edge embedding that incorporates answer information.

[0060] Step 2.3: Embed the answer tag with the node information Splice to get =( ), in order to directly apply the canonical graph neural network to the multi-relation KG subgraph, the Levi graph transformation is used to transform the original graph. Specifically, all the edges in the original graph are used as new nodes, and new edges connecting the original nodes and the new nodes are added to obtain a bipartite graph. That is, by transforming the nodes With side information Splice to get the initial knowledge graph information =( ).

[0061] The knowledge graph is then input into a bidirectional gated graph neural network for encoding. The bidirectional gated graph neural network sequentially uses gated recurrent units (GRU), message passing mechanisms, and pooling operations to enhance the model's ability to understand and represent knowledge graph data. GRU is used to integrate aggregated information to update node embeddings:

[0062] (15)

[0063] in represents the knowledge graph embedding information aggregated after the kth time step of GRU, express The embedding of each word in , Represents the knowledge graph embedding information aggregated after the k-1th time step of GRU.

[0064] After multiple iterations, the node embedding of the final state of node v is obtained. To calculate the graph embedding, the message passing mechanism is first applied to the node embeddings, and then the maximum pooling is applied to all node embeddings, and finally a d-dimensional global embedding vector is obtained. .

[0065] Step 3: Construct a decoder based on the knowledge graph question generation model enhanced with key semantic information. During the decoding process, the encoded information is input into the decoder, and the question is generated using the recurrent neural network and pointer copy mechanism. Figure 3 shown.

[0066] Step 3.1: Construct a decoder based on the knowledge graph question generation model enhanced with key semantic information, using a unidirectional LSTM as the decoder to generate each question word step by step, and finally form a complete question. The initial state of the decoder is to input the final global node embedding vector encoded by the graph neural network into two independent fully connected layers as the hidden state of the initial decoder. and The specific formula is as follows:

[0067] (16)

[0068] (17)

[0069] in and Represents the trainable parameters of the model, and Represents the bias term.

[0070] At the same time, in order to timely integrate the important information of the source text information in each decoding process, it is necessary to retain the node embedding of the graph neural network encoding , Represents a node in the graph. In each decoding step t, the attention mechanism learns to focus on the most relevant nodes in the input graph and decodes the state of the previous moment , the attention mechanism calculates the hidden vector of the context , the specific formula is as follows:

[0071] (18)

[0072] (19)

[0073] in represents the attention score calculated by the hidden layer embedding of the current time step in the knowledge graph node embedding and decoding process, represents the hidden layer embedding of the i-th question word generated during the decoding process, represents the hidden layer embedding of the j-th question word generated during the decoding process.

[0074] Combined with the decoding status of the previous moment , the hidden vector of the context and the character embedding of the previous question word read by the decoder Calculate the new hidden state together The details are as follows:

[0075] (20)

[0076] in, are trainable parameters of the model.

[0077] Step 3.2: During the decoding process, in the prediction process of the current time step, in order to improve the problem of unknown words generated based on the knowledge graph problem, a node-level copy mechanism is introduced to allow node attributes (i.e., text in the node) to be copied from the input graph. The conventional word-level copy mechanism is extended to a node-level copy mechanism, allowing node attributes (i.e., text in the node) to be copied from the input graph. That is, in each step of decoding, according to the context vector , decoder status and the character embedding of the previous question word read by the decoder Calculate the probability of generation .in and Serves as a soft switch to choose whether to generate words from the vocabulary or copy node attributes from the input graph. The specific formula is as follows:

[0078]

[0079]

[0080] in, , , is a trainable parameter of the model, b represents the bias term, and g represents whether to copy a word from the input text or generate a new word. Is a Sigmoid gating function with parameters , , is a trainable parameter, represents the word embedding generated at the current time step, Indicates that the final training is generated based on the previous t-1 time step Question word embeddings.

[0081] Ultimately, this replication mechanism can dynamically maintain an extended vocabulary, enhance the model's ability to handle rare words and proper nouns, and greatly improve the efficiency of question generation.

[0082] In order to verify the performance of the model in the present invention, a machine automatic evaluation experiment was conducted to verify it from the perspectives of precision, recall rate, fluency, etc. Therefore, the present invention uses three classic text generation evaluation indicators, BLEU, ROUGE-L and METEOR, to verify the degree of overlap and semantic similarity between the reference questions and the questions generated by the model of the present invention. Among them, the BLEU indicator mainly uses the idea of ​​n-gram, ROUGE-L mainly evaluates the generated questions from the perspective of recall rate, and METEOR can evaluate the generated questions from multiple aspects such as semantics.

[0083] Table 1 is the automatic evaluation comparison results of the model of the present invention and the baseline. Table 1 lists the results of the machine automatic evaluation of the model of the present invention and multiple classic knowledge graph question generation models (the models in the table are all reduced forms of the question generation models mentioned in the original paper): First, through experimental verification, the present invention verifies that on the PQ dataset, the questions generated by the model of the present invention are better than the existing knowledge graph question generation model in all machine automatic evaluation indicators, where the * indicates the experimental results of the present invention using the original code; Second, the model of the present invention has better experimental results than the most advanced network model. Therefore, the knowledge graph question generation model based on key semantic information can capture the key semantic information between texts and make full use of the answer information and answer tag information questions of the knowledge graph, so as to generate high-quality answerable questions.

[0084] Table 1

[0085]

[0086] The present invention proposes a knowledge graph question generation method based on key semantic information enhancement. In the encoding stage, the method first uses the attention mechanism to interact the text information of each node in the knowledge graph with the answer to obtain the node representation of the fused answer information, and uses the bidirectional long short-term memory network (BiLSTM) to encode the node representation and edge representation in the knowledge graph of the fused answer information respectively. Then, the encoded information is input into the gating mechanism to dynamically adjust the degree of attention to different parts of the information, and is integrated with the original encoded text information to improve the understanding ability of the text information. After the integrated text information and the original information are integrated, the key sentence node semantic information is selected by linear transformation to capture the important semantic information between the texts. Then, it is spliced ​​with the answer tag information to obtain the node representation of the fused answer and the answer tag information, and the encoded node representation and edge representation are spliced ​​and input into the bidirectional gated graph neural network (BiGGNN) for encoding. Finally, in the decoding stage, the copy mechanism, the attention mechanism, and the unidirectional long short-term memory network are used to complete each step of decoding and generate a complete question. Experimental results show that the model proposed by the present invention is superior to the existing advanced knowledge graph question generation model in terms of both automatic evaluation indicators and manual evaluation indicators. The evaluation indicators such as BLEU-1, BLEU-2, BLEU-3, BLEU-4, ROUGE-L, and METEOR in the PQ dataset have all been significantly improved compared to the most advanced models.

[0087] The specific implementation modes of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above implementation modes, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.

Claims

1. A knowledge graph question generation method based on key semantic information enhancement, characterized by: The specific steps include the following: Step 1: Preprocess the public dataset PQ to obtain the input data required for the knowledge graph question generation model based on key semantic information enhancement; Step 2: Construct an encoder for the knowledge graph question generation model based on key semantic information enhancement. In the encoding stage, the data obtained in Step 1 is sequentially input into the node answer interaction layer, the node text information encoding layer, and the bidirectional gated graph neural network for encoding to obtain enhanced knowledge graph encoding information that integrates the answer information. Step 3: Construct a decoder based on the knowledge graph question generation model enhanced with key semantic information. During the decoding process, the enhanced knowledge graph encoding information obtained in Step 2 is input into the decoder, and questions are generated using a recurrent neural network and a pointer copy mechanism. The specific steps of Step 1 are as follows: Step 1.1: Extract node information, edge information, answer information, and answer tag information from the knowledge graph in the public dataset PQ, preprocess the obtained node information, edge information, answer information, and answer tag information to obtain the corresponding node embedding, edge embedding, answer word embedding, and answer tag embedding; Step 1.2: Use the word embeddings obtained after preprocessing as the input of the knowledge graph question generation model based on key semantic information enhancement; The specific steps of Step 2 are as follows: Step 2.1: Input the node embedding, edge embedding, and answer word embedding obtained in Step 1 into the node-answer interaction layer to obtain the node embedding with fused answer information and the edge embedding without fused answer information; Step 2.2: Input the node embedding of the fused answer information and the edge embedding of the unfused answer information obtained in Step 2.1 into the node text information encoding layer respectively to obtain an enhanced key semantic information knowledge graph; Step 2.3: Then, concatenate the node embedding in the enhanced key semantic information knowledge graph with the answer tag embedding in Step 1.1, and concatenate the concatenated node embedding with the enhanced key semantic information edge embedding obtained in Step 2.2 and input them into the bidirectional gated graph neural network for encoding; The specific steps of Step 3 are as follows: Step 3.1: Construct a decoder based on the knowledge graph question generation model enhanced with key semantic information. The decoder generates questions one by one using a recurrent neural network, and finally combines the words generated at each time step to obtain a word sequence, which is the question generated by the decoder. Step 3.2: During the decoding process, a node-level pointer copy mechanism is introduced to generate the problem word during the prediction process of the current time step; The specific steps in the Step 2.2 are as follows: In order to obtain the text sequence information in the nodes, the nodes that integrate the answer information and the edges that do not integrate the answer information in the knowledge graph are encoded, and two BiLSTMs are used to encode the contextual text information of the nodes and edges, where one BiLSTM is used to encode the node information and one BiLSTM is used to encode the edge information. Then, the gating mechanism is used to control the forward and backward hidden layer information output of the text information, and then the gated information is multiplied with the forward and backward hidden layer information. The obtained forward hidden layer information, gated forward hidden layer information, backward hidden layer information, and gated backward hidden layer information are spliced, and finally the obtained text semantic information is selected using linear transformation to finally obtain enhanced key semantic information node embedding and enhanced key semantic information edge embedding.

2. According to claim 1, a knowledge graph question generation method based on key semantic information enhancement is characterized by: The Step 1.1 specifically includes: First, the set of knowledge graphs is represented as G=(V, E), where V is represented as the set of nodes, denoted as V=( ), E is the set of edges, denoted by E=( ), where mv represents the number of nodes and me represents the number of edges. We select the pre-trained Glove embedding based on the words that constitute the text attributes, and map the nodes and edges to an initial embedding space. The specific embedding formula is expressed as ), ),in and Represent the text information word embedding vectors of nodes and edges respectively, vw represents the number of text words in each node, and the right subscript ew represents the number of text words in each edge. The text information of the answer is processed through the pre-trained Glove embedding to obtain the answer word embedding ),in The word embedding vector represents the answer, aw represents the number of text words in each answer, and at the same time, the position of the answer information in the node is marked, and the marked answer is converted into a word embedding.

3. The method for generating knowledge graph questions based on key semantic information enhancement according to claim 1, characterized in that: The specific steps of Step 2.1 are: using the attention mechanism to align the context information from the target answer and the node words, interacting the entity information of the answer with the entity information of the node, and then obtaining the node representation of the fused answer.

4. The method for generating knowledge graph questions based on key semantic information enhancement according to claim 1, characterized in that: The Step 2.3 is specifically as follows: the answer tag embedding in Step 1.1 is concatenated with the node embedding of the key semantic information knowledge graph enhanced in Step 2.2, and the concatenated node embedding and the enhanced key semantic information edge embedding obtained in Step 2.2 are concatenated and input into the bidirectional gated graph neural network for encoding, wherein the dimension of the answer tag embedding is 32, and the edge information of the node embedding and the enhanced fused answer embedding is obtained by concatenating the last dimensional vector to fully obtain the semantic information of the nodes and edges in the knowledge graph, and the hidden layer dimension of the bidirectional gated graph neural network encoding is 300.

5. The method for generating knowledge graph questions based on key semantic information enhancement according to claim 1, characterized in that: In the Step 3.1, the recurrent neural network used by the decoder is a single-layer unidirectional LSTM, the dimension of the hidden layer is 300 dimensions, and the dimension of the output at each time step is the sum of the number of existing words in the current vocabulary and the replication mechanism.

6. The method for generating knowledge graph questions based on key semantic information enhancement according to claim 1, characterized in that: In the Step 3.2, the node-level pointer copy mechanism allows copying node attributes from the input graph, and the node-level copy mechanism uses a mask copy mechanism to copy the entity nodes in the transformed Levy graph without copying the predicate nodes.

Citation Information

Patent Citations

  • Question generation system based on knowledge graph and interrogative word driving

    CN114168749A

  • Optical fiber inertial measurement device stress acceleration stabilization method based on bidirectional LSTM neural network

    CN115962777A

  • Automatic problem generation method based on multi-stage time sequence and semantic information enhancement

    CN116681087A

  • ELM-BiLSTM-attention-based blood glucose concentration prediction method

    CN118557187A