Question and answer method and device, electronic equipment and storage medium

By using dynamic temporal embedding and generative adversarial network techniques, the problem of insufficient generalization ability of prediction models in scenarios with sparse data or no known relationships is solved, thereby improving the accuracy and timeliness of the question answering system.

CN121542383APending Publication Date: 2026-02-17AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511724241.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-23
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing prediction models have limited generalization ability and low prediction performance and accuracy when faced with scenarios where data is sparse or unrelated.

Method used

By employing a dynamic temporal embedding method, the entities and relationships of the problem to be addressed are projected onto a specific temporal hyperplane. Through generative adversarial network-driven temporal knowledge graph completion technology, it is deeply integrated into the intelligent question answering process to determine candidate structural data.

Benefits of technology

It improves the accuracy and timeliness of answers in time-sensitive questions, questions involving new knowledge/relationships, and data-sparse scenarios, significantly enhancing the performance of the question-answering system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121542383A_ABST
    Figure CN121542383A_ABST
Patent Text Reader

Abstract

The invention provides a question and answer method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining a to-be-processed question; processing the to-be-processed problem to obtain target structure data; determining a target data set from the preset knowledge graph based on the target structure data; inputting the target data set and a preset knowledge graph into a preset recognition model, so that the preset recognition model processes the target data set and the preset knowledge graph, and outputting candidate structure data; candidate structure data as an answer is determined from the candidate structure data. According to the method, a dynamic time embedding method is adopted, entities, relations and the like of a to-be-processed problem are projected to corresponding specific time hyperplanes to obtain structured representation, and therefore time sequence evolution of the entity relations is captured. Therefore, the problems that the prediction performance is low and the accuracy of the predicted answer is low are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a question-and-answer method, apparatus, electronic device, and storage medium. Background Technology

[0002] Currently, long-term prediction models are trained using a large amount of labeled data, so that the trained prediction models can be used to directly predict the questions and obtain the corresponding answers.

[0003] Because existing prediction models rely on a large amount of labeled data for training, their generalization ability is limited when faced with scenarios where the data is sparse or unrelated, and their prediction performance will drop significantly; moreover, the accuracy of the predicted answers is low. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a question-answering method, apparatus, electronic device, and storage medium to solve the problems of low predictive performance of existing models and low accuracy of predicted answers.

[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0006] The first aspect illustrates a question-and-answer method, the method comprising:

[0007] Get the issues to be processed;

[0008] The problem to be addressed is processed to obtain the target structure data;

[0009] The target dataset is determined from the preset knowledge graph based on the target structure data;

[0010] The target dataset and the preset knowledge graph are input into the preset recognition model so that the preset recognition model processes the target dataset and the preset knowledge graph and outputs candidate structure data. The number of candidate structure data is multiple. The preset recognition model is trained based on the preset knowledge graph.

[0011] Candidate structure data for the answer are determined from the candidate structure data.

[0012] Optionally, the problem to be processed is processed to obtain target structure data, including:

[0013] Based on the problem to be processed, the corresponding problem data is obtained;

[0014] The elements in the problem data are mapped onto a preset time hyperplane to generate target structure data.

[0015] Optionally, determining the target dataset from the preset knowledge graph based on the target structure data includes:

[0016] Based on the target structure data, extract the corresponding neighbor information from the preset knowledge graph;

[0017] The first dataset is determined based on the neighbor information;

[0018] The entities in the structured data of the preset knowledge graph are combined with the entities in the target structured data to obtain initial local features;

[0019] The initial local features are processed to obtain the target local features;

[0020] The initial local features are processed to obtain the global features of entities in the target structure data;

[0021] The second dataset, obtained by combining the target local features and global features, is combined with the first dataset to obtain the target dataset.

[0022] Optionally, the preset recognition model includes a word embedding model, a generator, and a discriminator; the target dataset and the preset knowledge graph are input into the preset recognition model so that the preset recognition model processes the target dataset and the preset knowledge graph and outputs candidate structure data, including:

[0023] The word embedding model is invoked to perform a textual description of the relationships in the target structured data;

[0024] The generator is invoked to process the text description and preset Gaussian noise, and the initial candidate structure data is output.

[0025] The discriminator is invoked to identify the initial candidate structure data and the target data, and the candidate structure data is output.

[0026] Optionally, determining candidate structure data as the answer from the candidate structure data includes:

[0027] For each candidate structure data, a score is given based on the problem to be addressed;

[0028] The answer is generated based on the candidate structure data with the highest score.

[0029] The second aspect illustrates a question-and-answer device, the device comprising:

[0030] The acquisition unit is used to acquire the issues to be processed.

[0031] The processing unit is used to process the problem to be processed and obtain the target structure data;

[0032] The first determining unit is used to determine the target dataset from the preset knowledge graph based on the target structure data;

[0033] A preset recognition model is used to input the target dataset and the preset knowledge graph into the preset recognition model so that the preset recognition model processes the target dataset and the preset knowledge graph and outputs candidate structure data. The number of candidate structure data is multiple. The preset recognition model is trained based on the preset knowledge graph.

[0034] The second determining unit is used to determine candidate structure data as the answer from the candidate structure data.

[0035] Optionally, the processing unit is specifically used for:

[0036] Based on the problem to be processed, the corresponding problem data is obtained;

[0037] The elements in the problem data are mapped onto a preset time hyperplane to generate target structure data.

[0038] Optionally, the first determining unit is specifically used for:

[0039] Based on the target structure data, extract the corresponding neighbor information from the preset knowledge graph;

[0040] The first dataset is determined based on the neighbor information;

[0041] The entities in the structured data of the preset knowledge graph are combined with the entities in the target structured data to obtain initial local features;

[0042] The initial local features are processed to obtain the target local features;

[0043] The initial local features are processed to obtain the global features of entities in the target structure data;

[0044] The second dataset, obtained by combining the target local features and global features, is combined with the first dataset to obtain the target dataset.

[0045] The third aspect discloses an electronic device including a processor and a memory, the memory being used to store program code and data for data generation, and the processor being used to invoke program instructions in the memory to execute a question-and-answer method as described in any of the first aspects.

[0046] The fourth aspect discloses a storage medium including a stored program, wherein, when the program is executed, it controls the device on which the storage medium resides to perform a question-and-answer method as described in any of the first aspects.

[0047] Based on the above embodiments of the present invention, a question-answering method, apparatus, electronic device, and storage medium are provided. The method includes: acquiring a question to be processed; processing the question to be processed to obtain target structure data; determining a target dataset from a preset knowledge graph based on the target structure data; inputting the target dataset and the preset knowledge graph into a preset recognition model, so that the preset recognition model processes the target dataset and the preset knowledge graph and outputs candidate structure data, wherein the number of candidate structure data is multiple, and the preset recognition model is trained based on the preset knowledge graph; and determining candidate structure data as the answer from the candidate structure data. The present invention employs a dynamic temporal embedding method, projecting entities and relationships of the question to be processed onto a corresponding specific temporal hyperplane to obtain a structured representation, i.e., target structure data, thereby capturing the temporal evolution of entity relationships and improving the timeliness modeling capability. Then, by deeply integrating generative adversarial network-driven temporal knowledge graph completion technology into the intelligent question-answering process, candidate structure data is determined. This avoids the problems of low prediction performance and low accuracy of the predicted answers. Attached Figure Description

[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0049] Figure 1 This is a flowchart illustrating a question-and-answer method according to an embodiment of the present invention;

[0050] Figure 2 This is a schematic diagram illustrating the structured representation of a knowledge graph according to an embodiment of the present invention;

[0051] Figure 3 This is a schematic diagram illustrating the processing of a neighbor encoder and a physical encoder according to an embodiment of the present invention;

[0052] Figure 4 This is a schematic diagram of the generator and discriminator processes in an embodiment of the present invention;

[0053] Figure 5 This is a schematic diagram of the structure of a question-and-answer device according to an embodiment of the present invention. Detailed Implementation

[0054] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0055] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0056] It should be noted that the descriptions involving "first," "second," etc., in this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.

[0057] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0058] This application first projects the entities and relations of the knowledge graph onto a corresponding temporal hyperplane to obtain a structured representation; then, a feature encoder encodes the entities and adjacent nodes, and then fuses them to obtain a true representation of the relations; next, a generator encodes the observed relation samples to generate simulated relation vectors, and a discriminator distinguishes between real relation vectors and simulated relation vectors, accurately assigning them the correct relation types. In other words, this application solves the technical challenges of insufficient accuracy and timeliness in existing intelligent question-answering systems when facing time-sensitive issues, problems involving newly emerging entities or relations (zero samples), and problems of missing or incorrect answers due to the sparsity of knowledge graph data. The method runs on a computing device or server that includes a processor, memory, a knowledge graph database, and a question-answering interface. Its core technical flow is as follows.

[0059] See Figure 1 The diagram below illustrates a question-and-answer method according to an embodiment of the present invention. The method includes:

[0060] Step S101: Obtain the problem to be processed.

[0061] In the specific implementation step S101, the user uploads the problem to be processed through the client.

[0062] It should be noted that the issues to be addressed include time-sensitive issues or issues involving new entities / relationships.

[0063] Step S102: Process the problem to be processed to obtain the target structure data;

[0064] It should be noted that the specific implementation of step S102 includes the following steps.

[0065] Step S11: Analyze the problem to be processed to obtain the problem data corresponding to the problem to be processed.

[0066] The problematic data refers to quadruples with missing items.

[0067] In the specific implementation step S11, the problem to be processed is parsed to extract the key features. Then, the key features are converted into quadruples to obtain the problem data; that is, the key features are converted into quadruples to be completed.

[0068] Key features include entities, their relationships to entities, time ranges, and missing items.

[0069] For example, regarding the question "What position did someone hold at a certain time?";

[0070] Problem Analysis: The problem to be processed is analyzed to obtain key information, including entity s as "someone", relation r as "holding a position", time range as "a certain time" corresponding to timestamp t, and missing item as "position" corresponding to target entity o; the key features are formed into partial quadruplets: the problem is transformed into a quadruplet to be completed (s,r,?,t).

[0071] The question mark (?) indicates that the item is missing.

[0072] It should be noted that, generally speaking, the input problem to be processed has a missing term, which may be entity s or entity o. Then its corresponding quadruple is (s,r,?,t) or (?,r,o,t).

[0073] Step S12: Map the elements in the problem data onto a preset time hyperplane to generate target structure data;

[0074] In the specific implementation of step S12, if the missing item in the problem data is entity 'o', then time is divided into hyperplanes, and the normal vector of each hyperplane is used to... Projecting each element onto the corresponding temporal hyperplane, the relationship between the elements can then be shown in Equations (1) and (2), resulting in a structured embedding representation. and And use it as the target structure data; if the missing item in the problem data is entity s, then divide time into hyperplanes, and use the normal vector of each hyperplane... Projecting each element onto the corresponding temporal hyperplane, the relationship between the elements can then be shown in equations (2) and (3), resulting in a structured embedding representation. and And use it as the target structure data.

[0075] Formula (1):

[0076]

[0077] Formula (2):

[0078]

[0079] Formula (3):

[0080]

[0081] Step S103: Determine the target dataset from the preset knowledge graph based on the target structure data;

[0082] It should be noted that the specific implementation of step S103 includes the following steps.

[0083] Step S21: Extract the corresponding neighbor information from the preset knowledge graph based on the target structure data;

[0084] In the specific implementation step S21, the first encoder is called to extract the one-hop neighbor information of the target entity involved in the question (such as the entity mentioned in the question) from the preset knowledge graph database. That is, the neighbor encoder is called to search the structured embedding representation of the preset knowledge graph database, i.e., the structure data, to determine the graph entity that has a greater semantic similarity than the first similarity or is structurally the same as the entity, and the quadruple corresponding to the graph entity is used as the neighbor information.

[0085] Neighbor information refers to a set of samples in a text or dataset that are structurally or semantically similar to the target sample, and is often used to capture local contextual features.

[0086] One-hop neighbor information typically refers to the neighbor node information that a node can obtain through a single hop (i.e., direct connection) in a delay-tolerant network or wireless sensor network.

[0087] Step S22: Determine the first dataset based on the neighbor information;

[0088] Next, the first neighbor encoder is called to encode the neighbor information, output the neighbor feature vector, and use it as the first dataset;

[0089] Among them, the neighbor feature vector is a preset fixed-dimensional neighbor feature vector.

[0090] The preset fixed dimension is set in advance based on multiple experiments.

[0091] This allows for the aggregation of local structural information of the target entity within a specific timeframe, enriching its contextual representation and mitigating the difficulty in question answering caused by the lack of direct relationships. The neighbor encoder uses a simple method to extract features and assists the entity encoder in providing more discriminative entity features.

[0092] It should be noted that the process of training the first encoder based on data from a pre-defined knowledge graph includes:

[0093] A1: For each node in the preset knowledge graph, the historical data of the node in the preset knowledge graph is converted into a graph quadruple through time.

[0094] In the specific implementation, the target time-series knowledge graph data of the historical problem is read, that is, the historical data, and the target time-series knowledge graph data is represented as a graph quadruple (entity s, relation r, entity o, time t);

[0095] For example: (Company A, CEO, Person B, 2010-2015), (Medicine C, Treatment, Disease D, 2023).

[0096] A2: For each graph quadruple, the graph quadruple is converted into a graph structure embedding representation according to time.

[0097] Specifically, time is divided into hyperplanes, and entities and relations are projected onto the hyperplanes through the normal vector of each hyperplane. The entities and relations are represented as shown in Equations (1) to (3).

[0098] Among them, the graph embedding representation includes the first graph embedding. Second map embedding and third-level graph embedding Belongs to R d .

[0099] like Figure 2 As shown, the background knowledge graph in the preset knowledge graph is converted into entity embedding through step A2, and then divided into visible samples and invisible samples, so that the visible samples can be used to power the neighbor encoder and entity encoder in the future.

[0100] A3: Train based on the nodes in the preset knowledge graph to determine the trained neighbor encoder.

[0101] In a specific implementation, firstly, the neighbor encoder divides the nodes in the preset knowledge graph into subject neighbor nodes and object neighbor nodes whose similarity to entities in the subject neighbor nodes is greater than a preset threshold.

[0102] Specifically, one or more nodes are first designated as subject neighbor nodes in the preset knowledge graph. Then, nodes in the preset knowledge graph whose similarity to the graph structure embedding representation of the subject neighbor node is higher than a preset threshold are found and designated as object neighbor nodes.

[0103] The main neighbor node can be represented as Where i is the identifier corresponding to the i-th node, and G is the knowledge graph; the object neighbor node can be represented as ;

[0104] Next, the subject neighbor nodes and object neighbor nodes are trained using the tanh activation function and a learnable matrix, so that the neighbor encoder outputs the neighbor feature vectors corresponding to the entities in the subject neighbor nodes.

[0105] The neighbor feature vector includes the neighbor subject node vector and the object neighbor node vector.

[0106] Object neighbor node vectors are generated by using graph representation learning techniques to transform the neighbor relationships of nodes in a graph into a low-dimensional vector representation.

[0107] Step S23: Combine the entities in the structure data of the preset knowledge graph with the entities in the target structure data to obtain initial local features;

[0108] In the specific implementation of step S23, firstly, the second encoder is invoked to combine the entities of the target structural data with the entities in the structural data of each preset knowledge graph using a scaling dot product attention mechanism to obtain initial local features. As shown in formula (4).

[0109] Formula (4):

[0110]

[0111] Wherein, S is an entity in the target structure data. The entity is the i-th structural data in the preset knowledge graph.

[0112] It should be noted that the second encoder combines convolutional operations with an attention mechanism to mine deep-level interaction information between entity pairs; specifically, it is trained using entity pairs in a pre-defined knowledge graph.

[0113] Among them, an entity pair refers to the combination of an entity in the subject neighbor node and an entity in the object neighbor node;

[0114] For each entity pair, a second encoder is trained using the following steps S23 to S25, so that the trained encoder can determine the second dataset from the preset knowledge graph based on the question data corresponding to the processing question.

[0115] Step S24: Process the initial local features to obtain the target local features;

[0116] In the specific implementation step S24, the second encoder is called to substitute the initial local features into formula (5) in order to understand the intrinsic characteristics of entities in the target structure data and their interrelationships.

[0117] Formula (5):

[0118]

[0119] Where w belongs to This represents the dimension corresponding to the second encoder, softmax() is the normalization function for the normalized attention values, and g is the ReLU activation function.

[0120] Step S25: Process the initial local features to obtain the global features of entities in the target structure data;

[0121] In the specific implementation step S25, the second encoder is invoked to generate the initial local features and the vectors of each temporal hyperplane in the preset knowledge graph. Calculate the global features of entities in the target structure data. As shown in formula (6).

[0122] Formula (6):

[0123]

[0124] Step S26: Combine the second dataset obtained by combining the target local features and global features with the first dataset to obtain the target dataset;

[0125] In the specific implementation step S26, the target local features and global features are combined to represent the second dataset of entities in the target structure data; then, the first dataset and the second dataset are substituted into formula (6) to obtain the target dataset.

[0126]

[0127] To better understand the output process of the target dataset, i.e., the real data, let's take the following example. Figure 3 Provide an explanation;

[0128] like Figure 3 As shown, the visible samples are input into the neighbor encoder (i.e., the first encoder) and the entity encoder (i.e., the second encoder) to obtain the first dataset and the second dataset; then the first dataset and the second dataset are combined by the feature encoder to obtain the real data.

[0129] Step S104: Input the target dataset and the preset knowledge graph into the preset recognition model so that the preset recognition model can process the target dataset and the preset knowledge graph and output candidate structure data;

[0130] The number of candidate structure data is multiple, and the preset recognition model is trained based on a preset knowledge graph;

[0131] The pre-defined recognition model includes a word embedding model, a generator, and a discriminator;

[0132] It should be noted that the specific implementation of step S104 includes the following steps.

[0133] Step S31: Call the word embedding model to perform a textual description of the relationships in the target structure data.

[0134] In the specific implementation step S31, a pre-trained word embedding model is used to transform the relations in the target structure data into a text representation based on description, i.e., text description.

[0135] It should be noted that the word embedding model learns word embeddings by pre-collecting and analyzing large-scale text data. After the word embeddings are constructed, these embedding vectors are fed into a convolutional neural network encoder to further extract text features.

[0136] Convolutional neural networks (CNNs) excel at processing the internal structure of text data, effectively capturing key information from text sequences. The CNN model described in this section receives word embeddings as input in its first layer, while the last layer outputs a description-based text representation. During convolution, kernels of different shapes are used to scan the input data. In this way, the convolutional layers can compute the output vector. , i.e., text description, the specific calculation is shown in formula (7).

[0137] Formula (7):

[0138]

[0139] in, It is the convolution kernel of all inputs. It's a deviation. This is the activation function. For the first pooling layer, this section uses max pooling to select the most meaningful features from the input feature vectors. For the last layer, this section uses mean pooling. In the last layer, all input vectors contain some local information, which helps with the final entity embedding.

[0140] Step S32: Call the generator to process the text description and preset Gaussian noise, and output the initial candidate structure data;

[0141] The generator consists of multiple Long Short-Term Memory (BiLSTM) networks, fully connected layers, and layer normalization modules.

[0142] In the specific implementation step S32, the text description and preset Gaussian noise are input into the generator so that the Long Short-Term Memory (BiLSTM) network in the generator can pass through the LSTM layer to obtain structure-enhanced relational features; then, the structure-enhanced relational features are further enhanced using a fully connected layer to obtain the relational representation. And through normalization processing, it obtains relation representations from the pre-set knowledge graph. The corresponding structural data is used as the initial candidate structural data.

[0143] The initial candidate structure data consists of quadruples.

[0144] It should be noted that the generator is based on the text description T of the historical text description. r The training process using Gaussian noise z includes:

[0145] To capture long-term dependencies between different keywords, a bidirectional long short-term memory (BiLSTM) network is also incorporated into the model. Text descriptions are passed through LSTM layers, enabling the model to understand long-range dependencies between relational descriptions and ultimately obtain structurally enhanced relational features.

[0146] The relation features are then processed through a fully connected layer for structural enhancement, resulting in the final relation representation. .

[0147] The role of the fully connected layer is to integrate and map features, making the final relational representation richer and more meaningful, thereby achieving better performance in various tasks.

[0148] Finally, the final relationship will be represented. After normalization by the layer normalization module, the potential quadruple (e) is generated. s ,r gen ,e o ,t), covering scenarios where data is sparse or relationships are not yet visible;

[0149] This application provides a rich and effective method for modeling relationships in generative adversarial networks by combining Gaussian noise, bidirectional LSTM layers, and processing through fully connected layers.

[0150] To ensure the stability of the model and improve its performance, the scheme adopts Wasserstein loss and combines it with Margin Ranking Loss to effectively classify the synthesized features, as shown in Equation (8).

[0151] Formula (8):

[0152]

[0153] in It is a fraction representing a real relation. It is a fraction represented by a generative relation. These are boundary values, and they are preset.

[0154] The corresponding loss function is shown in formula (9).

[0155] Formula (9):

[0156]

[0157] in, It is the generated relation vector. It is the Wasserstein loss, calculated using formula (8). It is pivot regularization.

[0158] In other words, by continuously adjusting the generator's model parameters through formulas (8) and (9), when L... D When the loss function is minimized, the generator's model parameters are adjusted based on the loss function at that point, and then the generator is constructed.

[0159] Step S33: Call the discriminator to identify the initial candidate structure data and the target data, and output the candidate structure data.

[0160] It should be noted that the network consists of a Long Short-Term Memory (LSTM) network and fully connected layers;

[0161] During the training phase: The discriminator distinguishes between real quadruplets obtained from the first encoder and the second encoder, as well as the initial candidate structure data generated during generator training, through LSTM and fully connected layers, and accurately identifies the relation vector generated by the generator, that is, accurately identifies the real quadruplets.

[0162] The discriminator uses a Long Short-Term Memory (LSTM) network with fully connected layers to identify the labels on the data. Additionally, another fully connected layer acts as a classifier to determine whether the input data is real or fake data generated by the generator. To prevent mode collapse, a gradient penalty term is introduced to enforce constraints and ensure the training stability of the discriminator. The loss function of the discriminator is shown in Equation (10).

[0163] Formula (10):

[0164]

[0165] in, , Loss to Wasserstein , It is classification loss;

[0166] The generator is optimized using Wasserstein loss and gradient penalty to ensure that the generated quadruples are semantically and temporally reasonable.

[0167] In the specific implementation step S33, the discriminator in the pre-built generator is called to identify the initial candidate structural data and target data, so as to determine the structural data that is semantically and temporally related to the problem to be processed from the preset knowledge graph, and use it as candidate structural data.

[0168] It should be noted that there are multiple candidate structure data.

[0169] The process of increasing the number of generators and discriminators can be described as follows: Figure 4 As shown.

[0170] Step S105: Determine candidate structure data as the answer from the candidate structure data;

[0171] It should be noted that the specific implementation of step S105 includes the following steps.

[0172] Step S41: For each candidate structure data, score the candidate structure data based on the problem to be processed;

[0173] In the specific implementation step S106, for each candidate structural data, a pre-constructed scoring function is called to calculate the score of the relationship between the entity in the candidate structural data and the target structural data corresponding to the problem to be processed, and the score of the candidate structural data is calculated.

[0174] It should be noted that the pre-built scoring function is trained based on historical candidate structure data and historical unresolved problems.

[0175] Step S42: Generate an answer based on the candidate structure data with the highest score.

[0176] In the specific implementation step S107, the candidate structure data are sorted in descending order of score, and the candidate structure data with the highest score is taken as the answer to the question.

[0177] Optional, also includes:

[0178] The entities and time information in the top-ranked candidate structure data are integrated to generate a natural language response.

[0179] In this embodiment of the invention, a dynamic temporal embedding method is employed to project entities and relationships of the problem to be processed onto a corresponding specific temporal hyperplane to obtain a structured representation, i.e., target structural data, thereby capturing the temporal evolution of entity relationships and improving timeliness modeling capabilities. Then, by deeply integrating generative adversarial network-driven temporal knowledge graph completion technology into the intelligent question-answering process, candidate structural data is determined. This significantly improves the accuracy and reliability of the system's responses to time-sensitive questions (timeliness), questions involving new knowledge / relationships (zero-shot generalization), and questions with knowledge gaps due to data sparsity. Experimental verification shows that in open-ended temporal knowledge graph question-answering benchmark tests, the accuracy of this method in answering complex questions involving temporal evolution and new entities is higher than existing question-answering baseline methods based on static knowledge graphs or simple temporal embedding.

[0180] Based on the question-and-answer method shown in the above embodiments of the present invention, correspondingly, the present invention also shows a question-and-answer device, such as... Figure 5 As shown, the device includes:

[0181] Acquisition unit 501 is used to acquire the problem to be processed;

[0182] Processing unit 502 is used to process the problem to be processed and obtain target structure data;

[0183] The first determining unit 503 is used to determine the target dataset from the preset knowledge graph based on the target structure data;

[0184] A preset recognition model 504 is used to input the target dataset and the preset knowledge graph into the preset recognition model so that the preset recognition model processes the target dataset and the preset knowledge graph and outputs candidate structure data. The number of candidate structure data is multiple. The preset recognition model is trained based on the preset knowledge graph.

[0185] The second determining unit 505 is used to determine candidate structure data as the answer from the candidate structure data.

[0186] The specific principles and execution processes of each unit in the question-and-answer device disclosed in the above embodiments of the present invention are the same as the corresponding contents in the question-and-answer method provided in the above embodiments of the present invention. Please refer to the corresponding parts in the question-and-answer method disclosed in the above embodiments of the present invention, and they will not be repeated here.

[0187] In this embodiment of the invention, a dynamic temporal embedding method is employed to project the entities and relationships of the problem to be processed onto a corresponding specific temporal hyperplane to obtain a structured representation, i.e., target structural data, thereby capturing the temporal evolution of entity relationships and improving the timeliness modeling capability. Then, by deeply integrating generative adversarial network-driven temporal knowledge graph completion technology into the intelligent question-answering process, candidate structural data is determined. This avoids the problems of low prediction performance and low accuracy of the predicted answers.

[0188] Optionally, based on the question-answering device shown in the above embodiments of the present invention, the processing unit 502 is specifically used for:

[0189] Based on the problem to be processed, the corresponding problem data is obtained;

[0190] The elements in the problem data are mapped onto a preset time hyperplane to generate target structure data.

[0191] Optionally, based on the question-and-answer device shown in the above embodiments of the present invention, the first determining unit 503 is specifically used for:

[0192] Based on the target structure data, extract the corresponding neighbor information from the preset knowledge graph;

[0193] The first dataset is determined based on the neighbor information;

[0194] The entities in the structured data of the preset knowledge graph are combined with the entities in the target structured data to obtain initial local features;

[0195] The initial local features are processed to obtain the target local features;

[0196] The initial local features are processed to obtain the global features of entities in the target structure data;

[0197] The second dataset, obtained by combining the target local features and global features, is combined with the first dataset to obtain the target dataset.

[0198] Optionally, based on the question-answering device shown in the above embodiments of the present invention, the preset recognition model 504 includes a word embedding model, a generator, and a discriminator;

[0199] The word embedding model is used to describe the relationships in the target structure data using text.

[0200] The generator is used to process the text description and preset Gaussian noise to output initial candidate structure data.

[0201] The discriminator is used to identify the initial candidate structure data and the target data, and output candidate structure data.

[0202] Optionally, based on the question-and-answer device shown in the above embodiments of the present invention, the second determining unit 505 is specifically used for:

[0203] For each candidate structure data, a score is given based on the problem to be addressed;

[0204] The answer is generated based on the candidate structure data with the highest score.

[0205] This application provides an electronic device, which includes a processor and a memory. The memory is used to store question-and-answer program code and data, and the processor is used to call program instructions in the memory to execute the steps shown in the question-and-answer method in the above embodiments.

[0206] This invention provides a storage medium, namely a computer-readable storage medium, which includes the electronic device provided in the above-described embodiments of this application. The electronic device is used to execute the question-and-answer method disclosed in the embodiments of this application.

[0207] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0208] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0209] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A question-and-answer method, characterized in that, The method includes: Get the issues to be processed; The problem to be addressed is processed to obtain the target structure data; The target dataset is determined from the preset knowledge graph based on the target structure data; The target dataset and the preset knowledge graph are input into the preset recognition model so that the preset recognition model processes the target dataset and the preset knowledge graph and outputs candidate structure data. The number of candidate structure data is multiple. The preset recognition model is trained based on the preset knowledge graph. Candidate structure data for the answer are determined from the candidate structure data.

2. The method according to claim 1, characterized in that, The problem to be addressed is processed to obtain target structure data, including: Based on the problem to be processed, the corresponding problem data is obtained; The elements in the problem data are mapped onto a preset time hyperplane to generate target structure data.

3. The method according to claim 1, characterized in that, Determining the target dataset from the preset knowledge graph based on the target structure data includes: Based on the target structure data, extract the corresponding neighbor information from the preset knowledge graph; The first dataset is determined based on the neighbor information; The entities in the structured data of the preset knowledge graph are combined with the entities in the target structured data to obtain initial local features; The initial local features are processed to obtain the target local features; The initial local features are processed to obtain the global features of entities in the target structure data; The second dataset, obtained by combining the target local features and global features, is combined with the first dataset to obtain the target dataset.

4. The method according to claim 1, characterized in that, The preset recognition model includes a word embedding model, a generator, and a discriminator. The target dataset and the preset knowledge graph are input into the preset recognition model so that the preset recognition model processes the target dataset and the preset knowledge graph, outputting candidate structure data, including: The word embedding model is invoked to perform a textual description of the relationships in the target structured data; The generator is invoked to process the text description and preset Gaussian noise, and the initial candidate structure data is output. The discriminator is invoked to identify the initial candidate structure data and the target data, and the candidate structure data is output.

5. The method according to claim 1, characterized in that, Determining candidate structure data as the answer from the candidate structure data includes: For each candidate structure data, a score is given based on the problem to be addressed; The answer is generated based on the candidate structure data with the highest score.

6. A question-and-answer device, characterized in that, The device includes: The acquisition unit is used to acquire the issues to be processed. The processing unit is used to process the problem to be processed and obtain the target structure data; The first determining unit is used to determine the target dataset from the preset knowledge graph based on the target structure data; A preset recognition model is used to input the target dataset and the preset knowledge graph into the preset recognition model so that the preset recognition model processes the target dataset and the preset knowledge graph and outputs candidate structure data. The number of candidate structure data is multiple. The preset recognition model is trained based on the preset knowledge graph. The second determining unit is used to determine candidate structure data as the answer from the candidate structure data.

7. The apparatus according to claim 6, characterized in that, The processing unit is specifically used for: Based on the problem to be processed, the corresponding problem data is obtained; The elements in the problem data are mapped onto a preset time hyperplane to generate target structure data.

8. The apparatus according to claim 6, characterized in that, The first determining unit is specifically used for: Based on the target structure data, extract the corresponding neighbor information from the preset knowledge graph; The first dataset is determined based on the neighbor information; The entities in the structured data of the preset knowledge graph are combined with the entities in the target structured data to obtain initial local features; The initial local features are processed to obtain the target local features; The initial local features are processed to obtain the global features of entities in the target structure data; The second dataset, obtained by combining the target local features and global features, is combined with the first dataset to obtain the target dataset.

9. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory being used to store program code and data for data generation, and the processor being used to call program instructions in the memory to execute the question-and-answer method as described in any one of claims 1-5.

10. A storage medium, characterized in that, The storage medium includes a stored program, wherein, when the program is executed, it controls the device where the storage medium is located to perform the question-and-answer method as described in any one of claims 1-5.