Data generation method and device, computer equipment and storage medium
Through the target problem generation network, the Q&A pair is automatically constructed from the target knowledge graph, solving the problem of high cost of obtaining training data in the existing technology, and achieving efficient and accurate training data generation.
Patent Information
- Application Number
- CN202411560442.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-21
AI Technical Summary
In the prior art, obtaining a question-and-answer pair of questions and answers to train a neural network that is feedback-based answers based on user's questions by manually labeling questions and answers is relatively expensive and difficult to reduce.
A target problem generation network is adopted to automatically construct a question-and-answer pair by selecting sub-graphs from the target knowledge graph and generating questions. The network learns the problem that generates difficulty information representations through training data, including triples in the knowledge graph, answers and difficulty information of the annotation problem.
It realizes automatic generation of Q&A pairs, reduces the cost of obtaining training data, and improves the feedback accuracy of neural networks for different difficulty problems based on user's questions.
Smart Images

Figure CN119493845A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data generation method, device, computer equipment and storage medium. Background Art
[0002] In order to train a neural network that provides answers to user questions, such as a neural network deployed on a vehicle computer that provides answers to user questions in the vehicle, it is necessary to obtain question-answer pairs for training the neural network that provides answers to user questions. Currently, question-answer pairs are obtained by manually annotating questions and answers, and the cost of obtaining question-answer pairs is high. How to reduce the cost of obtaining question-answer pairs for training the neural network that provides answers to user questions has become a problem that needs to be solved. Summary of the invention
[0003] One of the purposes of the present invention is to provide a data generation method, apparatus, computer device and storage medium to solve the problem of how to reduce the cost of obtaining question-answer pairs for training a neural network that feeds back answers based on user questions.
[0004] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0005] A data generation method, comprising:
[0006] Select a target subgraph from the target knowledge graph, where the target subgraph involves at least one triple;
[0007] Generate a first question using a target question generation network according to the at least one triple and the first answer in the target subgraph, wherein the target question generation network is a trained neural network, and the training data of the target question generation network includes: triples involved in a subgraph for training in a knowledge graph for training, answers for training in the subgraph for training, labeled questions corresponding to the answers for training, and difficulty information of the labeled questions, wherein the difficulty information of the labeled questions indicates the difficulty of the labeled questions, and the difficulty information of the labeled questions is determined according to the credibility of the entities in the labeled questions and the number of other entities in the subgraph for training that match the entities in the labeled questions;
[0008] A first question-answer pair is generated according to the first question and the first answer.
[0009] According to the above technical means, the target question generation network is automatically used to generate questions, and question-answer pairs for training the neural network that feeds back answers based on the user's questions are automatically generated based on the questions and answers, thereby saving the cost of generating question-answer pairs for training the neural network that feeds back answers based on the user's questions. Since the labeled questions corresponding to the answers used for training have difficulty information, the target question generation network can learn how to generate questions of difficulty represented by the difficulty information. The labeled questions corresponding to multiple answers used for training can have different difficulty information, so the target question generation network can learn how to generate questions of different difficulty levels. The neural network that feeds back answers based on the user's questions is trained using relatively abundant question-answer pairs, thereby improving the ability of the neural network that feeds back answers based on the user's questions to feed back answers with higher accuracy for each difficulty level.
[0010] Furthermore, it also includes:
[0011] Randomly select sentences from a target sentence set used to establish a target knowledge graph, wherein each sentence in the target sentence set corresponds to a triple, and the triple corresponding to the sentence is obtained by extracting the triples of the sentence;
[0012] Finding a context sentence of a randomly selected sentence from the target sentence set;
[0013] Generate a prompt word for a pre-trained language model for generating questions according to a set of triples, wherein the set of triples includes: a triple corresponding to the randomly selected sentence and a triple corresponding to each context sentence of the randomly selected sentence, the prompt word instructing the pre-trained language model for generating questions to select a second answer from the set of triples and to generate a question for the second answer according to the set of triples;
[0014] Using a pre-trained language model for generating questions, generating a second question for the second answer according to the prompt word;
[0015] A second question-answer pair is generated according to the second question and the second answer.
[0016] Further, according to the target question and the target answer, generating a target question-answer pair includes:
[0017] Generate a question-answer pair including the target question and the target answer, wherein the target question is the first question or the second question, the target answer is the first answer or the second answer, and the target question-answer pair is the first question-answer pair or the second question-answer pair;
[0018] When the similarity between the question-answer pair including the target question and the target answer and any existing question-answer pair is less than a similarity threshold, the question-answer pair including the target question and the target answer is used as a target question-answer pair.
[0019] Further, when the similarity between the question-answer pair including the target question and the target answer and any existing question-answer pair is less than a similarity threshold, taking the question-answer pair including the target question and the target answer as the target question-answer pair includes:
[0020] When the similarity between the question and answer pair including the target question and the target answer and any existing question and answer pair is less than a similarity threshold and the target question is different from the questions in any existing question and answer pair, the question and answer pair including the target question and the target answer is used as the target question and answer pair.
[0021] Further, when the similarity between the question-answer pair including the target question and the target answer and any existing question-answer pair is less than a similarity threshold and the target question is different from the question in any existing question-answer pair, taking the question-answer pair including the target question and the target answer as the target question-answer pair includes:
[0022] When the similarity between the question and answer pair including the target question and the target answer and any existing question and answer pair is less than a similarity threshold and the target question is different from the questions in any existing question and answer pair and the question and answer pair including the target question and the target answer does not include preset keywords, the question and answer pair including the target question and the target answer is used as the target question and answer pair.
[0023] A data generating device, comprising:
[0024] A selection unit, used for selecting a target subgraph from a target knowledge graph, where the target subgraph involves at least one triple;
[0025] A first question generating unit is configured to generate a first question by using a target question generating network according to the at least one triple and the first answer in the target subgraph, wherein the target question generating network is a trained neural network, and the training data of the target question generating network includes: triples involved in a subgraph for training in a knowledge graph for training, answers for training in the subgraph for training, labeling questions corresponding to the answers for training, and difficulty information of the labeling questions, wherein the difficulty information of the labeling questions indicates the difficulty of the labeling questions, and the difficulty information of the labeling questions is determined according to the credibility of the entities in the labeling questions and the number of other entities in the subgraph for training that match the entities in the labeling questions;
[0026] A first question-answer pair generating unit is used to generate a first question-answer pair according to the first question and the first answer.
[0027] Furthermore, the data generating device further comprises:
[0028] A second question-answer pair generating unit is configured to randomly select a sentence from a target sentence set for establishing a target knowledge graph, wherein each sentence in the target sentence set corresponds to a triple, and the triple corresponding to the sentence is obtained by extracting the triples of the sentence; find a context sentence of the randomly selected sentence from the target sentence set; generate a prompt word of a pre-trained language model for generating questions based on a set of triples, wherein the set of triples includes: a triple corresponding to the randomly selected sentence and a triple corresponding to each context sentence of the randomly selected sentence, wherein the prompt word instructs the pre-trained language model for generating questions to select a second answer from the set of triples and to generate a question for the second answer based on the set of triples; generate a second question for the second answer based on the prompt word using the pre-trained language model for generating questions; and generate a second question-answer pair based on the second question and the second answer.
[0029] Further, according to the target question and the target answer, generating a target question-answer pair includes:
[0030] Generate a question-answer pair including the target question and the target answer, wherein the target question is the first question or the second question, the target answer is the first answer or the second answer, and the target question-answer pair is the first question-answer pair or the second question-answer pair;
[0031] When the similarity between the question-answer pair including the target question and the target answer and any existing question-answer pair is less than a similarity threshold, the question-answer pair including the target question and the target answer is used as a target question-answer pair.
[0032] Further, when the similarity between the question-answer pair including the target question and the target answer and any existing question-answer pair is less than a similarity threshold, taking the question-answer pair including the target question and the target answer as the target question-answer pair includes:
[0033] When the similarity between the question and answer pair including the target question and the target answer and any existing question and answer pair is less than a similarity threshold and the target question is different from the questions in any existing question and answer pair, the question and answer pair including the target question and the target answer is used as the target question and answer pair.
[0034] Further, when the similarity between the question-answer pair including the target question and the target answer and any existing question-answer pair is less than a similarity threshold and the target question is different from the question in any existing question-answer pair, taking the question-answer pair including the target question and the target answer as the target question-answer pair includes:
[0035] When the similarity between the question and answer pair including the target question and the target answer and any existing question and answer pair is less than a similarity threshold and the target question is different from the questions in any existing question and answer pair and the question and answer pair including the target question and the target answer does not include preset keywords, the question and answer pair including the target question and the target answer is used as the target question and answer pair.
[0036] A computer device comprising:
[0037] A memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the above method by executing the computer instructions.
[0038] A computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the above method.
[0039] A computer program product, characterized in that it includes computer instructions, wherein the computer instructions are used to enable a computer to execute the above method.
[0040] Beneficial effects of the present invention:
[0041] Automatically use the target question generation network to generate questions, automatically generate question-answer pairs based on questions and answers for training the neural network that feeds back answers based on the user's questions, and save the cost of generating question-answer pairs for training the neural network that feeds back answers based on the user's questions. Since the labeled questions corresponding to the answers used for training have difficulty information, the target question generation network can learn how to generate questions of difficulty represented by the difficulty information. The labeled questions corresponding to multiple answers used for training can have different difficulty information, so the target question generation network can learn how to generate questions of different difficulty levels. Use a relatively rich set of question-answer pairs to train the neural network that feeds back answers based on the user's questions, and improve the ability of the neural network that feeds back answers based on the user's questions to feed back answers with higher accuracy for each difficulty level. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A schematic diagram of a data generation system for implementing the data generation method provided in an embodiment of the present invention;
[0043] Figure 2A schematic diagram of a flow chart of a data generation method provided by an embodiment of the present invention;
[0044] Figure 3 A schematic diagram of an example structure of a network generated for the target problem of the present invention;
[0045] Figure 4 A schematic diagram of a flow chart of another data generation method provided by an embodiment of the present invention;
[0046] Figure 5 A schematic diagram of a process for generating a second question-answer pair;
[0047] Figure 6 A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.
[0049] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0050] refer to Figure 1 , which shows a schematic diagram of a data generation system for implementing the data generation method provided in an embodiment of the present invention.
[0051] The data generation system includes: a knowledge extraction module and a question-answering data generation module. The knowledge extraction module includes: a rule-based open domain knowledge triple extraction submodule, a deep learning model-based open domain knowledge triple extraction submodule, and a large language model knowledge extraction submodule. The question-answering data generation module includes: a target question generation network training submodule, a target question generation network, and a question-answer pair screening submodule. The target question generation network is used to generate questions. The target question generation network training submodule is used to train the target question generation network. The question-answer pair screening submodule is used to determine whether the generated questions can be combined with the corresponding answers to form a question-answer pair for training a neural network that feeds back answers based on the user's questions.
[0052] The knowledge extraction module is used to extract knowledge triples and event triples (SVO subject-verb-object) from each of the multiple articles in the target field. Knowledge triples are used to describe static knowledge such as common sense, definitions, and relationships. Knowledge triples can be expressed as: (entity, relationship, entity). The target field can be any field to which the data generation method provided by the embodiment of the present invention can be applied.
[0053] For each of the multiple articles in the target field, the article is divided into multiple sentences to obtain the target sentence set of the article. The sentence set of each of the multiple articles in the target field is the sentence set used to establish the target knowledge graph. For the multiple articles in the target field, the knowledge extraction module is used to extract the triples corresponding to each sentence in the sentence set of the article, and the target knowledge graph is established using the triples corresponding to each sentence in the sentence set of the article.
[0054] The rule-based open domain knowledge triple extraction submodule performs syntactic dependency analysis on each sentence in the article to obtain the syntactic dependency tree of the sentence, where the entities in the sentence are identified by performing named entity recognition (NER) on the article. Traverse the entire dependency syntactic tree and perform the following operations: select words with the part of speech of predicate, such as verb v, as candidates, candidate predicates; according to each candidate word, find out whether the candidate word has a "subject-predicate" or "parallel" relationship and a "verb-object" or "parallel" relationship, and retain it if it does, and obtain the final candidate predicate set; for each predicate word in the candidate predicate set, find the connecting component of its verb-object relationship as the object, and find the corresponding connecting component of the subject-predicate relationship as the subject.
[0055] The open domain knowledge triple extraction method based on deep learning model treats the extraction of triples as a whole sequence labeling problem. Among them, the entities in the sentence are obtained by named entity recognition of the sentence. The open domain triple extraction method based on the joint deep model is annotated at the sentence level, marking the subject, predicate, and object in the sentence to form an annotation sequence, and uses the annotated corpus such as Chinese Literature Text and DocRED to train using the bert+dl method.
[0056] The large language model knowledge extraction submodule uses ChatGPT for zero-shot knowledge extraction, including the first and second stages, each of which contains several rounds of QA, which refer to the dialogue with ChatGpt. In the first stage, the goal is to find the type of entity, relationship or event that appears in the sentence. Thus, the non-existent element types can be filtered out, reducing the search space and computational complexity. In the second stage, the relevant information is further extracted according to the element types extracted in the first stage and the corresponding specific task scheme. For a sample, the first stage generally includes only one round of QA. In order to find the element type in the sentence, the TypeQuesTemplate and the element type list are used to construct the question, and then the question and sentence are combined as the input of chatgpt. In order to facilitate the extraction of answers, chatgpt is required to answer in the form of a list. If the sentence does not contain any element type, chatgpt generates a reply with NONE Token. Relation extraction template = "'Given sentence: "{query}"\n\nGiven relation list: {relation list}\n\nWhat relations may be included in this sentence?\nPlease give the relations in the relation list.\nIf it does not exist, answer: None\nReply in tuple form, such as (relation 1, relation 2, ...):"'Event type extraction list = "'Given sentence: "{query}"\n\nGiven event type list: {event_lst}\n\nWhat event types may be included in this sentence?\nPlease give the event types in the event type list.\nIf it does not exist, answer: None\nReply in tuple form, such as (event type 1, event type 2, ...):"'. The second stage generally includes multiple QA rounds. According to the task plan in advance, a series of specific ChainExtractionTemplates are designed for the elements. ChainExtractionTemplate defines a chain of question templates. Multiple rounds of QA are performed according to the previously extracted element types and the order of ChainExtractionTemplates. To generate a question, a template with element types is retrieved and the corresponding slots are filled if necessary. Then, ChatGPT is accessed and a response is obtained. Finally, structured information is composed based on the elements extracted in each round. Similarly, ChatGPT is asked to reply in a tabular form to facilitate the extraction of answers. If nothing is extracted, the system generates a reply with a NONE token.Entity type extraction template = "'Given sentence: "{query}"\n\nGiven entity type list: {ent_type_list}\n\nWhat entity types may be included in this sentence?\nIf none, answer: None\nReply in tuple form, such as (entity type 1, entity type 2, ...):"'Entity value extraction list = "'According to the given sentence, the types of the two entities are ({ent_type_1}, {ent_type_2}) and the relationship between them is {relation}. Please find these two entities, such as If there are multiple groups, list them all by group. \nIf there are none, answer: None\nReply in a table format with two columns and headers ({ent_type_1}, {ent_type_2}): "'Event element extraction list = "'The argument role list corresponding to the event type "{evt_type}" is: {role}. \nIn the given sentence, extract the event arguments based on the argument roles. \nIf the argument role has no corresponding argument content, answer the argument content: None\nReply in a table format with two columns and headers (argument role, argument content): ".
[0057] refer to Figure 2 , which shows a flow chart of a data generation method provided by an embodiment of the present invention.
[0058] In step S201, a target subgraph is selected from a target knowledge graph.
[0059] The target subgraph involves at least one triple. A triple consists of two entities and the relationship between the two entities. For a triple, the node combination corresponding to the triple includes: a node representing an entity in the triple and a node representing a relationship between the entities in the triple.
[0060] For a triple, if the node combination corresponding to the triple is in the target subgraph, the triple is the triple involved in the target subgraph.
[0061] When the target subgraph involves multiple triples, for each triple in the multiple triples, the triple has at least one adjacent triple, and the adjacent triple of the triple is in the target subgraph.
[0062] In a possible implementation, a threshold value of the number of triples involved in the target subgraph may be preset, and the target subgraph may be selected from all subgraphs involving triples not less than the threshold value.
[0063] In step S202, a target question generation network is used to generate a first question according to the target subgraph involving at least one triple and the first answer in the target subgraph.
[0064] The target problem generation network is a trained neural network. That is, before the first execution of step S201, the target problem generation network is trained using the training data of the target problem generation network.
[0065] As an example, the target question generation network is trained using multi-hop question sets such as webQuestionSp, ComplexWebQuestions, and PathQuestion.
[0066] The training data of the target question generation network includes: triples involved in the subgraph for training in the knowledge graph for training, answers for training in the subgraph for training, labeled questions corresponding to the answers for training, and difficulty information of the labeled questions corresponding to the answers for training. The difficulty information of the labeled questions corresponding to the answers for training is determined based on the confidence of the entities in the labeled questions corresponding to the answers for training and the number of other entities in the subgraph for training that match the entities in the labeled questions corresponding to the answers for training. The answers for training in the subgraph for training can be entities pre-labeled as answers for training, or they can be entities randomly selected from the subgraph for training.
[0067] For a triple, if the node combination corresponding to the triple is in the subgraph used for training, the triple is the triple involved in the subgraph used for training.
[0068] Among them, the labeling problem corresponding to the answer for training can be understood as: the problem expected to be output by the target problem generation network when the triples involved in the subgraph for training, the answer for training in the subgraph for training, the labeling problem corresponding to the answer for training, and the difficulty information of the labeling problem corresponding to the answer for training are input into the target problem generation network.
[0069] The difficulty of the labeled questions corresponding to the answers used for training may specifically refer to: the difficulty of the labeled questions corresponding to the answers used for training.
[0070] In the embodiment of the present invention, since the labeled questions corresponding to the answers used for training have difficulty information, the target question generation network can learn how to generate questions of difficulty represented by the difficulty information. The labeled questions in multiple training data of the target question generation network can have different difficulty information, so the target question generation network can learn how to generate questions of different difficulty levels.
[0071] It should be noted that the entities in the labeled questions corresponding to the answers used for training are obtained through named entity recognition, and the credibility of the entities in the labeled questions corresponding to the answers used for training can be output by the named entity recognition model.
[0072] In a possible implementation, the difficulty information of the labeled problem corresponding to the answer for training is the difficulty score of the labeled problem corresponding to the answer for training. The higher the difficulty score of the labeled problem corresponding to the answer for training, the greater the difficulty of the labeled problem corresponding to the answer for training. The difficulty score of the labeled problem corresponding to the answer for training is determined according to the credibility score of the entity in the labeled problem corresponding to the answer for training and the score of the number of other entities in the subgraph for training that match the entity in the labeled problem. The higher the credibility of the entity in the labeled problem corresponding to the answer for training, the easier it is to understand the entity in the labeled problem corresponding to the answer for training, the easier the labeled problem corresponding to the answer for training, and the greater the credibility score of the entity in the labeled problem corresponding to the answer for training. The more the number of other entities in the subgraph for training that match the entity in the labeled problem corresponding to the answer for training, the less clear the labeled problem corresponding to the answer for training, the greater the score of the number of other entities in the subgraph for training that match the entity in the labeled problem, and the more difficult the labeled problem corresponding to the answer for training.
[0073] The difficulty score of the labeled question corresponding to the answer used for training can be calculated using the following formula:
[0074] Dif(G,q)=(1+Sel(G)) / (1+Con(q))
[0075] Among them, Dif(G,q) represents the difficulty score of the labeled question corresponding to the answer used for training, G and q represent the subgraph used for training and the labeled question corresponding to the answer used for training respectively, Con(q) represents the credibility score of the entity in the labeled question corresponding to the answer used for training, Sel(G) represents the score of the number of other entities in the subgraph used for training that match the entity in the labeled question, and the difficulty score of the labeled question corresponding to the answer used for training is standardized to between [0, 1].
[0076] When the number of entities in the labeled question corresponding to the answer used for training is multiple, the average value of the credibility of the entities in the labeled question corresponding to the answer used for training can be determined as the credibility score of the entities in the labeled question corresponding to the answer used for training.
[0077] In order to obtain the score corresponding to the number of other entities in the training subgraph that match the entity in the labeling problem, a one-to-one correspondence between multiple entity numbers and multiple preset scores can be preset. The greater the number of entities, the greater the preset score corresponding to the number of entities. The preset score corresponding to the number of other entities in the training subgraph that match the entity in the labeling problem is used as the score of the number of other entities in the training subgraph that match the entity in the labeling problem.
[0078] In another possible implementation, the difficulty information of the labeled questions corresponding to the answers for training is the difficulty level of the labeled questions corresponding to the answers for training. In order to determine the difficulty level of the labeled questions corresponding to the answers for training, the preset difficulty level score interval in which the difficulty score of the labeled questions corresponding to the answers for training is located is determined, and the preset difficulty level corresponding to the preset difficulty level score interval is determined as the difficulty level of the labeled questions corresponding to the answers for training. The larger the left endpoint of the preset difficulty level score interval, the higher the preset difficulty level corresponding to the preset difficulty level score interval. The higher the difficulty level of the labeled questions corresponding to the answers for training, the greater the difficulty of the labeled questions corresponding to the answers for training.
[0079] In a possible implementation, the first answer in the target subgraph is: an entity randomly selected from all entities in the target subgraph.
[0080] In one possible implementation, the target question generation network may be a Transformer network or a Transformer-like network. If the target question generation network is a Transformer network, in the inference stage of using the target question generation network to generate questions, the input embedding layer of the target question generation network receives the triples involved in the subgraph for training, embeds the triples involved in the target subgraph, obtains the encoding of the triples involved in the target subgraph, fuses the encoding of the triples involved in the target subgraph, the encoding of the position of the characters in the triples involved in the target subgraph, and the encoding of the first answer in the target subgraph, and obtains the input of the encoder of the target question generation network. The decoder of the target question generation network outputs the first question.
[0081] In a possible implementation, if the target question generation network is a Transformer network, during the training of the target question generation network, the input embedding layer of the target question generation network receives the triples involved in the subgraph for training, embeds the triples involved in the subgraph for training, obtains the encoding of the triples involved in the subgraph for training, fuses the encoding of the triples involved in the subgraph for training, the encoding of the position of the characters in the triples involved in the subgraph for training, the encoding of the answer for training, and the encoding of the difficulty information of the labeled question corresponding to the answer for training, and obtains the input of the encoder of the target question generation network. If the target question generation network is a Transformer network, during the training of the target question generation network, the output embedding layer of the Transformer network receives the labeled question corresponding to the answer for training, and outputs the encoding of the labeled question corresponding to the answer for training. The encoding of the labeled question corresponding to the answer for training, the encoding of the position of the characters in the labeled question corresponding to the answer for training, and the encoding of the difficulty information of the labeled question corresponding to the answer for training are fused to obtain the input of the decoder of the target question generation network.
[0082] refer to Figure 3 , which shows a schematic diagram of an example structure of a target question generation network.
[0083] Figure 3 The diagram shows an encoding unit 301 in an example structure of a target question generation network and a decoding unit 302 in an example structure of a target question generation network. The n encoding units in the example structure of the target question generation network are stacked, and the n decoding units in the example structure of the target question generation network are stacked.
[0084] Figure 3 The structure of the self-attention layer shown is the structure of the self-attention layer in the Transformer structure. Figure 3 The structures of the residual connection and layer normalization (Add&Normalise) layers shown are the residual connection and layer normalization layers in the Transformer structure. Figure 3 The structure of the encoder-decoder attention layer shown is the structure of the encoder-decoder attention layer in the Transformer structure. Figure 3 Also shown are the decoder (Docoder), linear (Linear Layer) layer, and Softmax Layer layer.
[0085] Figure 3The input of the first decoding unit of the target question generation network and the input of the first decoding unit of the target question generation network during the training of the target question generation network are exemplarily shown. During the training of the target question generation network, the input embedding layer receives the triples involved in the subgraph for training, embeds the triples involved in the subgraph for training, and obtains the encoding of the triples involved in the subgraph for training. The encoding of the triples involved in the subgraph for training, the encoding of the positions of the characters in the triples involved in the subgraph for training, the encoding of the answers for training, and the encoding of the difficulty information of the labeled questions corresponding to the answers for training are fused to obtain the input of the first encoding unit. During the training of the target question generation network, the output embedding layer receives the labeled questions corresponding to the answers for training, and obtains the encoding of the labeled questions corresponding to the answers for training. The encoding of the labeled questions corresponding to the answers for training, the encoding of the positions of the characters in the labeled questions corresponding to the answers for training, and the encoding of the difficulty information of the labeled questions corresponding to the answers for training are fused to obtain the input of the first decoding unit of the target question generation network.
[0086] When reasoning using the example structure of the target question generation network, the input of the first encoding unit can be obtained by fusing the encoding of the triples involved in the target subgraph, the encoding of the positions of the characters in the triples involved in the target subgraph, and the encoding of the first answer in the target subgraph.
[0087] In step S203, a first question-answer pair is generated according to the first question and the first answer.
[0088] In one possible implementation, a first question-answer pair consisting of a first question and a first answer may be generated.
[0089] The first question-answer pair is used to train a neural network for providing answers to user questions.
[0090] refer to Figure 4 , which shows a flow chart of another data generating method provided by an embodiment of the present invention.
[0091] In step S401, a target subgraph is selected from a target knowledge graph.
[0092] The process of step S401 refers to the process of step S201.
[0093] In step S402, a target question generation network is used to generate a first question according to the target subgraph involving at least one triple and the first answer in the target subgraph.
[0094] The process of step S402 refers to the process of step S202.
[0095] In step S403, a first question-answer pair is generated according to the first question and the first answer.
[0096] In one possible implementation, a first question-answer pair consisting of a first question and a first answer may be generated.
[0097] In step S404, a second question is generated using triples corresponding to sentences in a target sentence set for building a target knowledge graph and a pre-trained language model for generating questions, and a second question-answer pair is generated based on the second question and the second answer.
[0098] In one possible implementation, a second question-answer pair consisting of a second question and a second answer may be generated.
[0099] Through step S404, the strong semantic understanding and information generation capabilities of the pre-trained language model can be used to generate more accurate question-answer pairs.
[0100] refer to Figure 5 , which shows a schematic diagram of the process of generating a second question-answer pair.
[0101] In step S4041, a sentence is randomly selected from a target sentence set used to build a target knowledge graph.
[0102] The sentence set of each of the multiple articles in the target field is the target sentence set for establishing the target knowledge graph. For multiple articles in the target field, the target knowledge graph is established using the triples corresponding to each sentence in the sentence set of the article.
[0103] The target sentence set can be any sentence set used to build the target knowledge graph.
[0104] Each sentence in the target sentence set corresponds to a triple. For a sentence in the target sentence set, the triple corresponding to the sentence is obtained by extracting the triples of the sentence. The target knowledge graph is established based on the triples corresponding to each sentence in the target sentence set.
[0105] In step S4042, the context sentences of the randomly selected sentence are found from the target sentence set used to build the target knowledge graph.
[0106] The front-to-back position relationship of two sentences in the target sentence set is: the front-to-back position relationship of the two sentences in the article to which the target sentence set belongs.
[0107] In step S4042, if the number of sentences before a randomly sampled sentence in the target sentence set is greater than or equal to N, a sentence and the first N sentences of the randomly sampled sentence are randomly sampled. If the number of sentences after a randomly sampled sentence in the target sentence set is greater than or equal to N, the last N sentences of a randomly sampled sentence are randomly sampled, where N is preset. If the number of sentences before a randomly sampled sentence in the target sentence set is less than N, each sentence before a randomly sampled sentence in the target sentence set is used as a context sentence of the randomly sampled sentence. If the number of sentences after a randomly sampled sentence in the target sentence set is less than N, each sentence after a randomly sampled sentence in the target sentence set is used as a context sentence of the randomly sampled sentence.
[0108] In step S4043, prompt words (prom pt) of a pre-trained language model for generating questions are generated according to the triple set, where the triple set includes: a triple corresponding to the randomly selected sentence and a triple corresponding to each context sentence of the randomly selected sentence.
[0109] The prompt word of the pre-trained language model for generating questions instructs the pre-trained language model for generating questions to select a second answer from the set of triples and to generate a question for the second answer according to the set of triples.
[0110] The number of second answers selected by the pre-trained language model for generating the question can be one or more. For each second answer selected by the pre-trained language model for generating the question, the pre-trained language model for generating the question generates a second question for the second answer.
[0111] As an example, the prompt words include "You are an experienced conversation data annotator. Your goal is to generate as diverse question-answering data as possible based on the triples provided below. A triplet consists of two entities and the relationship between them. You can treat one of the entities or the relationship as an unknown value to generate questions, and then use the entity or relationship treated as an unknown value as the answer. Pay attention to describe the answer in spoken form as much as possible, and do not directly return the original content of the answer."
[0112] In step S4044, a second question is generated using the pre-trained language model used to generate questions according to the prompt words of the pre-trained language model used to generate questions.
[0113] In step S4045, a second question-answer pair is generated based on the second question and the second answer.
[0114] In one possible implementation, a second question-answer pair consisting of a second question and a second answer may be generated.
[0115] In one possible implementation, generating a first question-answer pair based on a first question and a first answer includes: generating a question-answer pair including the first question and the first answer; when the similarity between the question-answer pair including the first question and the first answer and any existing question-answer pair is less than a similarity threshold, taking the question-answer pair including the first question and the first answer as the first question-answer pair.
[0116] It should be noted that the existing question-answer pairs may specifically refer to: question-answer pairs that have been determined before executing step S401 and are used to train a neural network that feeds back answers based on user questions.
[0117] For an existing question-answer pair, the similarity between the question-answer pair including the first question and the first answer and the existing question-answer pair may be the ROUGE-L similarity.
[0118] In one possible implementation, generating a second question-answer pair based on the second question and the second answer includes: generating a question-answer pair including the second question and the second answer; when the similarity between the question-answer pair including the second question and the second answer and any existing question-answer pair is less than a similarity threshold, using the question-answer pair including the second question and the second answer as the second question-answer pair.
[0119] For an existing question-answer pair, the similarity between the question-answer pair including the second question and the second answer and the existing question-answer pair may be the ROUGE-L similarity.
[0120] In the disclosed embodiment, the question-answer pair including the first question and the first answer is used as the first question-answer pair only when the similarity between the question-answer pair including the first question and the first answer and any existing question-answer pair is less than a similarity threshold. The question-answer pair including the second question and the second answer is used as the second question-answer pair only when the similarity between the question-answer pair including the second question and the second answer and any existing question-answer pair is less than a similarity threshold. The difference between the generated question-answer pairs can be improved, the diversity of the question-answer pairs used to train the neural network that feeds back answers based on the user's questions can be improved, and the training effect of the neural network that feeds back answers based on the user's questions can be improved.
[0121] In one possible implementation, when the similarity between a question-and-answer pair including a first question and a first answer and any existing question-and-answer pair is less than a similarity threshold, the question-and-answer pair including the first question and the first answer is taken as the first question-and-answer pair. When the similarity between a question-and-answer pair including a first question and a first answer and any existing question-and-answer pair is less than a similarity threshold and the first question is different from the question in any existing question-and-answer pair, the question-and-answer pair including the first question and the first answer is taken as the first question-and-answer pair.
[0122] In an embodiment of the present disclosure, when the similarity between a question-and-answer pair including a first question and a first answer and any existing question-and-answer pair is less than a similarity threshold and the first question is different from the question in any existing question-and-answer pair, the question-and-answer pair including the first question and the first answer is taken as the first question-and-answer pair, which not only includes that the question-and-answer pair including the first question and the first answer is significantly different from the existing question-and-answer pairs, but also that the first question is different from the question in any existing question-and-answer pairs, thereby improving the difference between the generated question-and-answer pairs, improving the diversity of question-and-answer pairs used to train a neural network that feeds back answers based on users' questions, and improving the training effect of the neural network that feeds back answers based on users' questions.
[0123] In one possible implementation, when the similarity between a question-and-answer pair including the second question and the second answer and any existing question-and-answer pair is less than a similarity threshold, the question-and-answer pair including the second question and the second answer is taken as the second question-and-answer pair. When the similarity between a question-and-answer pair including the second question and the second answer and any existing question-and-answer pair is less than a similarity threshold and the second question is different from the question in any existing question-and-answer pair, the question-and-answer pair including the second question and the second answer is taken as the second question-and-answer pair.
[0124] In an embodiment of the present disclosure, when the similarity between a question-and-answer pair including a second question and a second answer and any existing question-and-answer pair is less than a similarity threshold and the second question is different from the question in any existing question-and-answer pair, the question-and-answer pair including the second question and the second answer is used as the second question-and-answer pair. Not only is the question-and-answer pair including the second question and the second answer significantly different from the existing question-and-answer pairs, but the second question is different from the question in any existing question-and-answer pairs. This improves the difference between question-and-answer pairs, improves the diversity of question-and-answer pairs used to train a neural network that feeds back answers based on users' questions, and improves the training effect of the neural network that feeds back answers based on users' questions.
[0125] In one possible implementation, when the similarity between a question-and-answer pair including a first question and a first answer and any existing question-and-answer pair is less than a similarity threshold and the first question is different from the question in any existing question-and-answer pair, the question-and-answer pair including the first question and the first answer is taken as the first question-and-answer pair. When the similarity between a question-and-answer pair including a first question and a first answer and any existing question-and-answer pair is less than a similarity threshold and the first question is different from the question in any existing question-and-answer pair and the question-and-answer pair including the first question and the first answer does not include preset keywords, the question-and-answer pair including the first question and the first answer is taken as the first question-and-answer pair.
[0126] The question-and-answer pair including the first question and the first answer not including the preset keyword may specifically mean that: the first question does not include the preset keyword and the first answer does not include the preset keyword.
[0127] In one possible implementation, when the similarity between a question-and-answer pair including the second question and the second answer and any existing question-and-answer pair is less than a similarity threshold and the second question is different from the question in any existing question-and-answer pair, the question-and-answer pair including the second question and the second answer is taken as the first question-and-answer pair including: when the similarity between a question-and-answer pair including the second question and the second answer and any existing question-and-answer pair is less than a similarity threshold and the second question is different from the question in any existing question-and-answer pair and the question-and-answer pair including the second question and the second answer does not include preset keywords, the question-and-answer pair including the second question and the second answer is taken as the second question-and-answer pair.
[0128] The question-and-answer pair including the second question and the second answer not including the preset keyword may specifically mean that: the second question does not include the preset keyword and the second answer does not include the preset keyword.
[0129] In the disclosed embodiment, the preset keyword may be a sensitive word. When the similarity between the question-answer pair including the first question and the first answer and any existing question-answer pair is less than the similarity threshold and the first question is different from the question in any existing question-answer pair and the question-answer pair including the first question and the first answer does not include the preset keyword, the question-answer pair including the first question and the first answer is used as the first question-answer pair, which can avoid generating the first question-answer pair including the preset keyword, and using the first question-answer pair including the preset keyword to train the neural network that feeds back the answer according to the user's question to produce an adverse effect. When the similarity between the question-answer pair including the second question and the second answer and any existing question-answer pair is less than the similarity threshold and the second question is different from the question in any existing question-answer pair and the question-answer pair including the second question and the second answer does not include the preset keyword, the question-answer pair including the second question and the second answer is used as the second question-answer pair, which can avoid generating the second question-answer pair including the preset keyword, and using the second question-answer pair including the preset keyword to train the neural network that feeds back the answer according to the user's question to produce an adverse effect.
[0130] A data generating device is also provided in an embodiment of the present invention, and the device is used to implement the above-mentioned method embodiment and preferred implementation mode, which have been described and will not be repeated here. As used below, the term "unit" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived. The device in the embodiment of the present invention is presented in the form of a functional unit, where the functional unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions.
[0131] The data generating device comprises:
[0132] A selection unit, used for selecting a target subgraph from a target knowledge graph, where the target subgraph involves at least one triple;
[0133] A first question generating unit is configured to generate a first question by using a target question generating network according to the at least one triple and the first answer in the target subgraph, wherein the target question generating network is a trained neural network, and the training data of the target question generating network includes: triples involved in a subgraph for training in a knowledge graph for training, answers for training in the subgraph for training, labeling questions corresponding to the answers for training, and difficulty information of the labeling questions, wherein the difficulty information of the labeling questions indicates the difficulty of the labeling questions, and the difficulty information of the labeling questions is determined according to the credibility of the entities in the labeling questions and the number of other entities in the subgraph for training that match the entities in the labeling questions;
[0134] A first question-answer pair generating unit is used to generate a first question-answer pair according to the first question and the first answer.
[0135] Furthermore, the data generating device further comprises:
[0136] A second question-answer pair generating unit is configured to randomly select a sentence from a target sentence set for establishing a target knowledge graph, wherein each sentence in the target sentence set corresponds to a triple, and the triple corresponding to the sentence is obtained by extracting the triples of the sentence; find a context sentence of the randomly selected sentence from the target sentence set; generate a prompt word of a pre-trained language model for generating questions based on a set of triples, wherein the set of triples includes: a triple corresponding to the randomly selected sentence and a triple corresponding to each context sentence of the randomly selected sentence, wherein the prompt word instructs the pre-trained language model for generating questions to select a second answer from the set of triples and to generate a question for the second answer based on the set of triples; generate a second question for the second answer based on the prompt word using the pre-trained language model for generating questions; and generate a second question-answer pair based on the second question and the second answer.
[0137] Further, according to the target question and the target answer, generating a target question-answer pair includes:
[0138] Generate a question-answer pair including the target question and the target answer, wherein the target question is the first question or the second question, the target answer is the first answer or the second answer, and the target question-answer pair is the first question-answer pair or the second question-answer pair;
[0139] When the similarity between the question-answer pair including the target question and the target answer and any existing question-answer pair is less than a similarity threshold, the question-answer pair including the target question and the target answer is used as a target question-answer pair.
[0140] Further, when the similarity between the question-answer pair including the target question and the target answer and any existing question-answer pair is less than a similarity threshold, taking the question-answer pair including the target question and the target answer as the target question-answer pair includes:
[0141] When the similarity between the question and answer pair including the target question and the target answer and any existing question and answer pair is less than a similarity threshold and the target question is different from the questions in any existing question and answer pair, the question and answer pair including the target question and the target answer is used as the target question and answer pair.
[0142] Further, when the similarity between the question-answer pair including the target question and the target answer and any existing question-answer pair is less than a similarity threshold and the target question is different from the question in any existing question-answer pair, taking the question-answer pair including the target question and the target answer as the target question-answer pair includes:
[0143] When the similarity between the question and answer pair including the target question and the target answer and any existing question and answer pair is less than a similarity threshold and the target question is different from the questions in any existing question and answer pair and the question and answer pair including the target question and the target answer does not include preset keywords, the question and answer pair including the target question and the target answer is used as the target question and answer pair.
[0144] refer to Figure 6 , Figure 61 is a schematic diagram of the hardware structure of a computer device provided by an embodiment of the present invention, and the computer device can be a terminal device provided by an embodiment of the present invention or a server provided by an embodiment of the present invention. The computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components communicate with each other using different buses, and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple vehicles can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). The processor 10 can be a central processing unit, a network processor, or a combination thereof. Among them, the processor 10 can further include a hardware chip. The above-mentioned hardware chip can be a dedicated integrated circuit, a programmable logic device, or a combination thereof. The above-mentioned programmable logic device can be a complex programmable logic device, a field programmable logic gate array, a general array logic, or any combination thereof. The memory 20 stores instructions executable by at least one processor 10 so that the at least one processor 10 executes the method shown in the above embodiment. The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created according to the use of the vehicle, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage devices. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof. The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state hard disk; the memory 20 may also include a combination of the above-mentioned types of memory. The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30, and the output device 40 may be connected via a bus or in other ways. The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touch pad, an indicator stick, one or more mouse buttons, a trackball, a joystick, etc.The output device 40 may include a display device, an auxiliary lighting device (e.g., LED), a tactile feedback device (e.g., a vibration motor), etc. The above display device includes but is not limited to a liquid crystal display, a light emitting diode, a display, and a plasma display. In some optional embodiments, the display device may be a touch screen.
[0145] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0146] A portion of the embodiments of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in a computer-readable medium includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which the computer program instructions are executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0147] The above embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Any equivalent substitution or change made by a person skilled in the art based on the present invention is within the protection scope of the present invention.
Claims
1. A data generation method, characterized in that: The method comprises: Select a target subgraph from the target knowledge graph, where the target subgraph involves at least one triple; Generate a first question using a target question generation network according to the at least one triple and the first answer in the target subgraph, wherein the target question generation network is a trained neural network, and the training data of the target question generation network includes: triples involved in a subgraph for training in a knowledge graph for training, answers for training in the subgraph for training, labeled questions corresponding to the answers for training, and difficulty information of the labeled questions, wherein the difficulty information of the labeled questions indicates the difficulty of the labeled questions, and the difficulty information of the labeled questions is determined according to the credibility of the entities in the labeled questions and the number of other entities in the subgraph for training that match the entities in the labeled questions; A first question-answer pair is generated according to the first question and the first answer.
2. The method according to claim 1, characterized in that: The method further comprises: Randomly select sentences from a target sentence set used to establish a target knowledge graph, wherein each sentence in the target sentence set corresponds to a triple, and the triple corresponding to the sentence is obtained by extracting the triples of the sentence; Finding a context sentence of a randomly selected sentence from the target sentence set; Generate a prompt word for a pre-trained language model for generating questions according to a set of triples, wherein the set of triples includes: a triple corresponding to the randomly selected sentence and a triple corresponding to each context sentence of the randomly selected sentence, the prompt word instructing the pre-trained language model for generating questions to select a second answer from the set of triples and to generate a question for the second answer according to the set of triples; Using a pre-trained language model for generating questions, generating a second question for the second answer according to the prompt word; A second question-answer pair is generated according to the second question and the second answer.
3. The method according to claim 2, characterized in that: According to the target question and the target answer, generating the target question-answer pair includes: Generate a question-answer pair including the target question and the target answer, wherein the target question is the first question or the second question, the target answer is the first answer or the second answer, and the target question-answer pair is the first question-answer pair or the second question-answer pair; When the similarity between the question-answer pair including the target question and the target answer and any existing question-answer pair is less than a similarity threshold, the question-answer pair including the target question and the target answer is used as a target question-answer pair.
4. The method according to claim 3, characterized in that: When the similarity between the question-answer pair including the target question and the target answer and any existing question-answer pair is less than a similarity threshold, taking the question-answer pair including the target question and the target answer as a target question-answer pair includes: When the similarity between the question-answer pair including the target question and the target answer and any existing question-answer pair is less than a similarity threshold and the target question is different from the questions in any existing question-answer pair, the question-answer pair including the target question and the target answer is taken as the target question-answer pair.
5. The method according to claim 4, characterized in that: When the similarity between the question-answer pair including the target question and the target answer and any existing question-answer pair is less than a similarity threshold and the target question is different from any question in the existing question-answer pair, taking the question-answer pair including the target question and the target answer as the target question-answer pair includes: When the similarity between the question and answer pair including the target question and the target answer and any existing question and answer pair is less than a similarity threshold and the target question is different from the questions in any existing question and answer pair and the question and answer pair including the target question and the target answer does not include preset keywords, the question and answer pair including the target question and the target answer is taken as the target question and answer pair.
6. A data generation device, characterized in that: The device comprises: A selection unit, used for selecting a target subgraph from a target knowledge graph, where the target subgraph involves at least one triple; A first question generating unit is configured to generate a first question by using a target question generating network according to the at least one triple and the first answer in the target subgraph, wherein the target question generating network is a trained neural network, and the training data of the target question generating network includes: triples involved in a subgraph for training in a knowledge graph for training, answers for training in the subgraph for training, labeling questions corresponding to the answers for training, and difficulty information of the labeling questions, wherein the difficulty information of the labeling questions indicates the difficulty of the labeling questions, and the difficulty information of the labeling questions is determined according to the credibility of the entities in the labeling questions and the number of other entities in the subgraph for training that match the entities in the labeling questions; A first question-answer pair generating unit is used to generate a first question-answer pair according to the first question and the first answer.
7. The device according to claim 6, characterized in that: The device also includes: A second question-answer pair generating unit is configured to randomly select a sentence from a target sentence set for establishing a target knowledge graph, wherein each sentence in the target sentence set corresponds to a triple, and the triple corresponding to the sentence is obtained by extracting the triples of the sentence; find a context sentence of the randomly selected sentence from the target sentence set; generate a prompt word of a pre-trained language model for generating questions based on a set of triples, wherein the set of triples includes: a triple corresponding to the randomly selected sentence and a triple corresponding to each context sentence of the randomly selected sentence, wherein the prompt word instructs the pre-trained language model for generating questions to select a second answer from the set of triples and to generate a question for the second answer based on the set of triples; generate a second question for the second answer based on the prompt word using the pre-trained language model for generating questions; and generate a second question-answer pair based on the second question and the second answer.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 5 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 5.
10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method according to any one of claims 1 to 5.