Question answering method and apparatus based on temporal knowledge graph

By introducing time sequence knowledge graph and time logical reasoning into the knowledge graph question and answer system, the problems of low accuracy of question and answer and difficult positioning in the existing technology are solved, and higher accuracy of question and answer and more effective multi-question processing are achieved.

WO2025123849A1PCT designated stage expired Publication Date: 2025-06-19CHINA TELECOM CORP LTD

Patent Information

Application Number
PCT/CN2024/120758
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-12
Filing Date
2024-09-24
Publication Date
2025-06-19

AI Technical Summary

Technical Problem

The existing knowledge graph-based Q&A methods are prone to problems of positioning difficulties and error propagation when dealing with multiple problem tasks, and the accuracy of knowledge Q&A is low, making it difficult to meet user needs.

Method used

The question-and-answer method based on the timing knowledge graph is adopted to obtain target questions, determine entity and semantic role information, retrieve relevant knowledge from the timing knowledge graph, and perform temporal logical reasoning to obtain answers.

Benefits of technology

It improves the accuracy of the knowledge graph question and answer system, can handle multiple problem tasks more effectively, reduce error propagation, and meet users' high accuracy needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024120758_19062025_PF_FP_ABST
    Figure CN2024120758_19062025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a question answering method and apparatus based on a temporal knowledge graph. The method comprises: acquiring a target question; determining a plurality of first entities in the target question, and determining first semantic role information in the target question, wherein the first semantic role information at least comprises a subject, a predicate, an object and time information; determining from a target temporal knowledge graph a plurality of pieces of first knowledge associated with the plurality of first entities, and determining a first entity relationship between second entities in each piece of first knowledge; determining a piece of first knowledge among the plurality of pieces of first knowledge as target knowledge, which piece of first knowledge corresponds to the first entity relationship matching the first semantic role information; and performing temporal logic reasoning on the basis of the time information and the target knowledge, so as to obtain an answer to the target question.
Need to check novelty before this filing date? Find Prior Art

Description

Question answering method and device based on temporal knowledge graph

[0001] Related applications

[0002] This application claims priority to Chinese patent application number 202311707927.4, filed on December 12, 2023, entitled “Question-answering method and device based on temporal knowledge graph,” the entire text of which is hereby incorporated by reference. Technical Field

[0003] The present application relates to the field of big data technology, and in particular to a question-answering method and device based on a temporal knowledge graph. Background Art

[0004] In recent years, as the concept of knowledge graphs has penetrated various fields, intelligent question answering based on knowledge graphs has gradually become a focus, and can be applied in various fields such as finance, healthcare, tourism, agriculture, and e-commerce. Currently, knowledge graph-based question answering methods mainly use the knowledge data in the knowledge graph combined with deep learning to provide approximate answers, or use the reasoning ability of the knowledge graph to understand the question and provide approximate answers, or integrate the information of the question and the triple (subject, predicate, object) into a vector space, and complete the similarity calculation task related to the question in the vector space to provide the approximate answer required by the user.

[0005] However, when there are multiple question tasks at the same time, the above method will have positioning difficulties and easily lead to error propagation problems, and the accuracy of knowledge question answering is low, which is difficult to meet user needs.

[0006] To address the above-mentioned problems, no effective solutions have been proposed so far.

[0007] Summary of the Invention

[0008] The embodiments of the present application provide a question-answering method and device based on a temporal knowledge graph, so as to at least solve the technical problem of low answer accuracy of the knowledge graph question-answering system in the related art.

[0009] According to one aspect of an embodiment of the present application, a question-answering method based on a temporal knowledge graph is provided, including: obtaining a target question; determining multiple first entities in the target question, and determining first semantic role information in the target question, the first semantic role information including at least: subject, predicate, object and time information; determining multiple first knowledge associated with the multiple first entities from the target temporal knowledge graph, and determining the first entity relationship between each second entity in each first knowledge; determining the first knowledge corresponding to the first entity relationship matching the first semantic role information in the multiple first knowledge as the target knowledge; performing temporal logical reasoning based on the time information and the target knowledge to obtain an answer to the target question.

[0010] In some embodiments, determining multiple first entities in a target question and determining first semantic role information in the target question include: using a pre-trained named entity recognition model to determine multiple first entities in the target question; and using a pre-trained natural language processing model to parse the first semantic role information in the target question.

[0011] In some embodiments, before obtaining the target problem, the above method also includes: collecting corpus data in multiple technical fields, wherein the types of corpus data include: text data and image data; using optical character recognition technology to determine the text data corresponding to the image data, and preprocessing all the obtained text data, wherein the preprocessing includes at least one of the following: data cleaning, normalization; performing entity recognition, entity relationship extraction and time series information extraction on all the preprocessed text data to obtain a first processing result; and constructing a target time series knowledge graph based on the first processing result.

[0012] In some embodiments, multiple first knowledge items associated with multiple first entities are determined from a target temporal knowledge graph, and first entity relationships between each second entity in each first knowledge item are determined, including: determining second knowledge items including multiple second entities corresponding to multiple first entities from the target temporal knowledge graph, and taking all second knowledge items as first knowledge items, wherein the similarity between each pair of corresponding first entities and second entities is greater than a preset threshold; and determining first entity relationships between each second entity in the first knowledge items based on the edges corresponding to the first knowledge items in the target temporal knowledge graph.

[0013] In some embodiments, the first semantic role information also includes: clauses and qualifiers. After determining the second knowledge including multiple second entities corresponding to multiple first entities from the target temporal knowledge graph, the above method also includes: filtering all second knowledge based on clauses, and / or qualifiers, and / or time information, and using the second knowledge retained after filtering as the first knowledge.

[0014] In some embodiments, the first knowledge corresponding to the first entity relationship that matches the first semantic role information in multiple first knowledge pieces is determined as the target knowledge, including: using a pre-trained target similarity scoring model to determine the similarity score between the first semantic role information and the first entity relationship in each first knowledge piece; and determining the first knowledge corresponding to the first entity relationship with the highest similarity score to the first semantic role information as the target knowledge.

[0015] In some embodiments, the training process of the target similarity scoring model includes: constructing an initial similarity scoring model, and obtaining third knowledge in the target time series knowledge graph corresponding to multiple historical questions and the answers to each historical question; for each historical question, determining the second semantic role information in the historical question, and determining the second entity relationship between each third entity in the third knowledge corresponding to the historical question, and forming the second semantic role information and the second entity relationship into a training sample; using multiple training samples to iteratively train the initial similarity scoring model to obtain the target similarity scoring model.

[0016] In some embodiments, temporal logical reasoning is performed based on time information and target knowledge to obtain an answer to a target question, including: determining a time series type corresponding to the time information, the time series type including at least one of the following: within a target time period, before a target time, after a target time, at the same time as a target event occurs, before a target event occurs, or after a target event occurs; performing temporal logical reasoning based on the time series type and target knowledge to obtain an answer to the target question.

[0017] According to another aspect of an embodiment of the present application, a question-answering device based on a temporal knowledge graph is also provided, including: an acquisition module for acquiring a target question; a parsing module for determining multiple first entities in the target question, and determining first semantic role information in the target question, wherein the first semantic role information includes at least: subject, predicate, object and time information; a retrieval module for determining multiple first knowledge associated with multiple first entities from the target temporal knowledge graph, and determining the first entity relationship between each second entity in each first knowledge; a determination module for determining the first knowledge corresponding to the first entity relationship matching the first semantic role information in the multiple first knowledge as the target knowledge; and a response module for performing temporal logical reasoning based on the time information and the target knowledge to obtain an answer to the target question.

[0018] In some embodiments, the retrieval module is also used to: determine second knowledge including multiple second entities corresponding to multiple first entities from the target time series knowledge graph, and take all second knowledge as first knowledge, and the similarity between each pair of corresponding first entities and second entities is greater than a preset threshold; determine the first entity relationship between each second entity in the first knowledge based on the edge corresponding to the first knowledge in the target time series knowledge graph.

[0019] In some embodiments, the first semantic role information also includes: clauses and qualifiers; the retrieval module is also used to: filter all second knowledge based on the clauses, and / or qualifiers, and / or time information, and use the second knowledge retained after filtering as the first knowledge.

[0020] In some embodiments, the determination module is also used to: use a pre-trained target similarity scoring model to determine the similarity score between the first semantic role information and the first entity relationship in each first knowledge; and determine that the first knowledge corresponding to the first entity relationship with the highest similarity score to the first semantic role information is the target knowledge.

[0021] In some embodiments, the response module is also used to: determine the time series type corresponding to the time information, the time series type including at least one of the following: within the target time period, before the target time, after the target time, at the same time as the target event occurs, before the target event occurs, or after the target event occurs; perform time logic reasoning based on the time series type and the target knowledge to obtain the answer to the target question.

[0022] According to another aspect of an embodiment of the present application, a non-volatile computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor, the question-answering method based on the temporal knowledge graph in the above-mentioned embodiments is implemented.

[0023] According to the technical solution provided in the embodiment of the present application, a target question is obtained; multiple first entities in the target question are determined, and the first semantic role information in the target question is determined, the first semantic role information at least including: subject, predicate, object and time information; multiple first knowledge associated with multiple first entities are determined from the target temporal knowledge graph, and the first entity relationship between each second entity in each first knowledge is determined; the first knowledge corresponding to the first entity relationship matching the first semantic role information in the multiple first knowledge is determined as the target knowledge; temporal logic reasoning is performed based on the time information and the target knowledge to obtain the answer to the target question. Thus, more knowledge information related to the entities in the target question can be obtained by using the temporal knowledge graph, and more accurate answers to questions can be obtained by using temporal logic reasoning using time information, which effectively solves the technical problem of low answer accuracy of the knowledge graph question-answering system in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technology descriptions. Obviously, the drawings described below are only some embodiments of this application. For those of ordinary skill in the art, other drawings can be derived from these drawings without inventive effort.

[0025] FIG1 is a schematic structural diagram of a computer device according to an embodiment of the present application.

[0026] Figure 2 is a flow chart of a question-answering method based on a temporal knowledge graph according to an embodiment of the present application.

[0027] FIG3 is a structural diagram of a question-answering device based on a temporal knowledge graph according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0029] It should be noted that the terms "first", "second", etc. in the specification, claims, and drawings of the present application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0030] In order to better understand the embodiments of the present application, some nouns or terms that appear in the description of the embodiments of the present application are first translated and explained as follows:

[0031] Knowledge Graph: In the library and information science community, it is also known as knowledge domain visualization or knowledge domain mapping map. It is a series of different graphs that show the development process and structural relationship of knowledge.

[0032] Example 1

[0033] An embodiment of the present application provides a question-answering method based on a temporal knowledge graph. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed by a computer system through, for example, a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0034] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer device or a similar computing device. Figure 1 shows a hardware structure block diagram of a computer device (or mobile terminal) for implementing a question-answering method based on a temporal knowledge graph. As shown in Figure 1, the computer device 10 (or mobile terminal) may include one or more (as shown in 102a, 102b, ..., 102n in the figure) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be used as a port of a bus (BUS)), a network interface, a power supply and / or a camera. It will be understood by those skilled in the art that the structure shown in Figure 1 is only schematic and does not limit the structure of the above-mentioned electronic device. For example, the computer device 10 may also include more or fewer components than shown in Figure 1, or have a configuration different from that shown in Figure 1.

[0035] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components of the computer device 10 (or mobile terminal). As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0036] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the question-answering method based on the time series knowledge graph in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the vulnerability detection method of the above-mentioned application. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories can be connected to the computer device 10 via a network. Examples of the above-mentioned network include but are not limited to the Internet, corporate intranet, local area network, mobile communication network and combinations thereof.

[0037] Transmission device 106 is configured to receive or transmit data via a network. A specific embodiment of the aforementioned network may include a wireless network provided by the communications provider of computer device 10. In one embodiment, transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In one embodiment, transmission device 106 may be a radio frequency (RF) module configured to communicate with the Internet wirelessly.

[0038] The display may be, for example, a touch screen liquid crystal display (LCD), which may enable a user to interact with a user interface of the computer device 10 (or mobile terminal).

[0039] In the above operating environment, an embodiment of the present application provides a question-answering method based on a temporal knowledge graph, as shown in FIG2 , and the method includes the following steps S202 to S210 .

[0040] Step S202: Obtain the target question.

[0041] Step S204 : determining a plurality of first entities in the target question, and determining first semantic role information in the target question, where the first semantic role information at least includes: a subject, a predicate, an object, and time information.

[0042] Step S206: determine multiple first knowledge items associated with multiple first entities from the target temporal knowledge graph, and determine the first entity relationship between each second entity in each first knowledge item.

[0043] Step S208 : determining the first knowledge corresponding to the first entity relationship matching the first semantic role information among the plurality of first knowledge pieces as the target knowledge.

[0044] Step S210: Perform temporal logical reasoning based on the time information and target knowledge to obtain an answer to the target question.

[0045] The following describes the various steps of the question-answering method based on the temporal knowledge graph in combination with the specific implementation process.

[0046] Before obtaining the target problem, it is first necessary to construct a time series knowledge graph. The specific method of constructing the time series knowledge graph is as follows: collect corpus data from multiple technical fields, where the types of corpus data include: text data and image data; use optical character recognition technology to determine the text data corresponding to the image data, and preprocess all the obtained text data, where the preprocessing includes at least one of the following: data cleaning and normalization; perform entity recognition, entity relationship extraction and time series information extraction on all the preprocessed text data to obtain a first processing result; and construct the target time series knowledge graph based on the first processing result.

[0047] It should be noted that we first use the entities identified in a large amount of corpus data, the extracted entity relationships and time series information to construct the initial time series knowledge graph. Then we need to fuse the initial time series knowledge graph, eliminate duplicate information and obtain the final target time series knowledge graph.

[0048] In order to facilitate the subsequent search for the answer to the target question in the constructed knowledge graph, after obtaining the target question, it is necessary to determine the multiple first entities and first semantic role information in the target question. Specifically, use the pre-trained named entity recognition model to determine the multiple first entities in the target question; use the pre-trained natural language processing model to parse the first semantic role information in the target question.

[0049] Among them, the named entity model can be used to perform entity recognition on the preprocessed text data. The named entity model can use conditional random fields, hidden Markov models, maximum entropy models, etc., and then use natural language processing models such as bag-of-words models, word embedding models, convolutional neural networks, etc. to perform semantic analysis on the target problem to obtain its corresponding semantic role information such as subject, predicate, and object.

[0050] Afterwards, multiple first knowledge associated with multiple first entities and the first entity relationship between each second entity in each first knowledge can be determined from the target time series knowledge graph in the following manner: second knowledge including multiple second entities corresponding to multiple first entities is determined from the target time series knowledge graph, and all second knowledge is used as first knowledge, wherein the similarity between each pair of corresponding first entities and second entities is greater than a preset threshold; the first entity relationship between each second entity in the first knowledge is determined based on the edge corresponding to the first knowledge in the target time series knowledge graph.

[0051] For example, three second entities associated with the first entity are identified in the target time series knowledge graph. First, the knowledge of the first second entity is used to determine the first part of knowledge. Then, the knowledge of the second second entity is used to filter the first part of knowledge to obtain the second part of knowledge. Finally, the knowledge of the third second entity is used to filter the second part of knowledge to obtain the final second knowledge, which is the first knowledge. It can be understood that the multiple second entities are a process of sequentially filtering and filtering knowledge one level at a time.

[0052] In some embodiments, the first semantic role information further includes: a clause and a qualifier.

[0053] Taking into account that in some application scenarios, it is impossible to accurately find the second knowledge and thus give an accurate answer to the question by relying solely on the subject, predicate and object information, after determining the second knowledge including multiple second entities corresponding to multiple first entities from the target temporal knowledge graph, all second knowledge can be further filtered based on clauses, and / or qualifiers, and / or time information, and the second knowledge retained after filtering can be used as the first knowledge.

[0054] After determining the first knowledge corresponding to the target problem, the first knowledge corresponding to the first entity relationship that matches the first semantic role information in multiple first knowledge pieces can be determined as the target knowledge in the following way: using a pre-trained target similarity scoring model to determine the similarity score between the first semantic role information and the first entity relationship in each first knowledge piece; determining the first knowledge corresponding to the first entity relationship with the highest similarity score to the first semantic role information as the target knowledge.

[0055] The target similarity scoring model may be an ESIM (Enhanced Sequential Inference Model) model, a weighted model based on cosine similarity, or the like.

[0056] Specifically, the training process of the target similarity scoring model includes: constructing an initial similarity scoring model, and obtaining multiple historical questions and the third knowledge in the target time series knowledge graph corresponding to the answers to each historical question; for each historical question, determining the second semantic role information in the historical question, and determining the second entity relationship between each third entity in the third knowledge corresponding to the historical question, and combining the second semantic role information and the second entity relationship into a training sample; using multiple training samples to iteratively train the initial similarity scoring model to obtain the target similarity scoring model.

[0057] It should be noted that multiple training samples can be divided into training sets, validation sets and test sets. The training set is used to iteratively train the similarity scoring model, and the validation set is used to verify the training results. The model parameters, such as accuracy and recall rate, are continuously adjusted according to the verification results, and the best model is selected. The final similarity scoring model is then evaluated using the test set to obtain the target similarity scoring model. After giving the answer to the target question, the process data of this question and answer (question, subject, predicate, object, time information, clauses, qualifiers, answers, etc.) is provided to the similarity scoring model for iterative training, thereby continuously adjusting and optimizing the model.

[0058] In application scenarios where the target question includes time information, after using the pre-trained target similarity scoring model to determine the first knowledge corresponding to the first entity relationship that matches the first semantic role information in multiple first pieces of knowledge as the target knowledge, it is necessary to perform temporal logical reasoning on the target question. Specifically, the time series type corresponding to the time information is determined, where the time series type includes at least one of the following: within the target time period, before the target time, after the target time, at the same time as the target event, before the target event, or after the target event. Temporal logical reasoning is performed based on the time series type and the target knowledge to obtain the answer to the target question.

[0059] By determining the time series type corresponding to the time information, we can more accurately perform temporal logical reasoning on the target knowledge, thereby obtaining more accurate answers. At the same time, it is more intelligent when processing problems containing time information, and can be applied to more application scenarios that consider time factors, such as querying historical events and deducing timelines.

[0060] In an embodiment of the present application, a target question is obtained; multiple first entities in the target question are determined, and first semantic role information in the target question is determined, wherein the first semantic role information includes at least: subject, predicate, object, and time information; multiple first knowledge items associated with multiple first entities are determined from the target temporal knowledge graph, and the first entity relationship between each second entity in each first knowledge item is determined; target knowledge whose first entity relationship matches the first semantic role information is determined from multiple first knowledge items; temporal logic reasoning is performed based on the time information and the target knowledge to obtain an answer to the target question. Among them, the use of the temporal knowledge graph can obtain more knowledge information related to the entities in the target question, and the use of time information for temporal logic reasoning can obtain more accurate answers to questions, which effectively solves the technical problem of low answer accuracy of the knowledge graph question-answering system in the related art.

[0061] Example 2

[0062] According to an embodiment of the present application, a question-answering device based on a time-series knowledge graph is provided for implementing the question-answering method based on a time-series knowledge graph in Example 1. As shown in FIG3 , the question-answering device based on a time-series knowledge graph includes at least: an acquisition module 31, a parsing module 32, a retrieval module 33, a determination module 34, and a response module 35. Among them:

[0063] The acquisition module 31 is used to obtain the target question;

[0064] The parsing module 32 is used to determine multiple first entities in the target question and determine first semantic role information in the target question, wherein the first semantic role information at least includes: subject, predicate, object and time information;

[0065] The retrieval module 33 is used to determine a plurality of first knowledge items associated with a plurality of first entities from the target temporal knowledge graph, and to determine a first entity relationship between each second entity in each first knowledge item;

[0066] The determination module 34 is configured to determine the first knowledge corresponding to the first entity relationship matching the first semantic role information among the plurality of first knowledge as the target knowledge;

[0067] The answering module 35 is used to perform temporal logical reasoning based on time information and target knowledge to obtain an answer to the target question.

[0068] The following describes the functions of each module of the question-answering device based on the temporal knowledge graph in combination with the specific implementation process.

[0069] Before obtaining the target problem, it is first necessary to construct a time series knowledge graph. The specific method of constructing the time series knowledge graph is as follows: collect corpus data from multiple technical fields, where the types of corpus data include: text data and image data; use optical character recognition technology to determine the text data corresponding to the image data, and preprocess all the obtained text data, where the preprocessing includes at least one of the following: data cleaning and normalization; perform entity recognition, entity relationship extraction and time series information extraction on all the preprocessed text data to obtain a first processing result; and construct the target time series knowledge graph based on the first processing result.

[0070] It should be noted that we first use the entities identified in a large amount of corpus data, the extracted entity relationships and time series information to construct the initial time series knowledge graph. Then we need to fuse the initial time series knowledge graph, eliminate duplicate information and obtain the final target time series knowledge graph.

[0071] In order to facilitate the subsequent search for the answer to the target question in the constructed knowledge graph, after obtaining the target question, the parsing module needs to determine the multiple first entities and first semantic role information in the target question. Specifically, the pre-trained named entity recognition model is used to determine the multiple first entities in the target question; and the pre-trained natural language processing model is used to parse the first semantic role information in the target question.

[0072] Among them, the named entity model can be used to perform entity recognition on the preprocessed text data. The named entity model can use conditional random fields, hidden Markov models, maximum entropy models, etc., and then use natural language processing models such as bag-of-words models, word embedding models, convolutional neural networks, etc. to perform semantic analysis on the target problem to obtain its corresponding semantic role information such as subject, predicate, and object.

[0073] In some embodiments, the retrieval module can determine multiple first knowledge associated with multiple first entities and the first entity relationship between each second entity in each first knowledge from the target temporal knowledge graph in the following manner: determine the second knowledge including multiple second entities corresponding to the multiple first entities from the target temporal knowledge graph, and take all the second knowledge as the first knowledge, wherein the similarity between each pair of corresponding first entities and the second entity is greater than a preset threshold; determine the first entity relationship between each second entity in the first knowledge based on the edge corresponding to the first knowledge in the target temporal knowledge graph.

[0074] For example, in the target time series knowledge graph, three second entities associated with the first entity are identified. First, the knowledge of the first second entity is used to determine the first part of knowledge. Then, the knowledge of the second second entity is used to filter the first part of knowledge to obtain the second part of knowledge. Finally, the knowledge of the third second entity is used to filter the second part of knowledge to obtain the final second knowledge, which is the first knowledge. It can be understood that the multiple second entities are a process of filtering knowledge in sequence one level at a time.

[0075] In some embodiments, the first semantic role information further includes: a clause and a qualifier.

[0076] Taking into account that in some application scenarios, it is impossible to accurately find the second knowledge and thus give an accurate answer to the question by relying solely on the subject, predicate and object information, after determining the second knowledge including multiple second entities corresponding to multiple first entities from the target temporal knowledge graph, all second knowledge can be further filtered based on clauses, and / or qualifiers, and / or time information, and the second knowledge retained after filtering can be used as the first knowledge.

[0077] After determining the first knowledge corresponding to the target problem, the determination module can determine the target knowledge that matches the first entity relationship and the first semantic role information from multiple first knowledge in the following way: use a pre-trained target similarity scoring model to determine the similarity score between the first semantic role information and the first entity relationship in each first knowledge; determine the first knowledge corresponding to the first entity relationship with the highest similarity score to the first semantic role information as the target knowledge.

[0078] The target similarity scoring model may be an ESIM (Enhanced Sequential Inference Model) model, a weighted model based on cosine similarity, or the like.

[0079] Specifically, the training process of the target similarity scoring model includes: constructing an initial similarity scoring model, and obtaining multiple historical questions and the third knowledge in the target time series knowledge graph corresponding to the answers to each historical question; for each historical question, determining the second semantic role information in the historical question, and determining the second entity relationship between each third entity in the third knowledge corresponding to the historical question, and combining the second semantic role information and the second entity relationship into a training sample; using multiple training samples to iteratively train the initial similarity scoring model to obtain the target similarity scoring model.

[0080] It should be noted that multiple training samples can be divided into training sets, validation sets and test sets. The training set is used to iteratively train the similarity scoring model, and the validation set is used to verify the training results. The model parameters, such as accuracy and recall rate, are continuously adjusted according to the verification results, and the best model is selected. The final similarity scoring model is then evaluated using the test set to obtain the target similarity scoring model. After giving the answer to the target question, the process data of this question and answer (question, subject, predicate, object, time information, clauses, qualifiers, answers, etc.) is provided to the similarity scoring model for iterative training, thereby continuously adjusting and optimizing the model.

[0081] In an application scenario where the target question contains time information, after using the pre-trained target similarity scoring model to determine the first knowledge corresponding to the first entity relationship that matches the first semantic role information in multiple first knowledge as the target knowledge, the response module also needs to perform time logic reasoning on the target question. Specifically, the time series type corresponding to the time information is determined, and the time series type includes at least one of the following: within the target time period, before the target time, after the target time, at the same time as the target event occurs, before the target event occurs, or after the target event occurs; based on the time series type and the target knowledge, time logic reasoning is performed to obtain the answer to the target question.

[0082] According to the question-answering device in this embodiment based on the time series knowledge graph, by determining the time series type corresponding to the time information, it can more accurately perform time logical reasoning on the target knowledge, thereby obtaining more accurate answers. At the same time, it is more intelligent when processing questions containing time information, and can be applied to more application scenarios that consider time factors, such as querying historical events, deducing timelines, etc.

[0083] It should be noted that the steps executed by each module in the question-answering device based on the temporal knowledge graph in the embodiment of the present application correspond one-to-one to the implementation steps of the question-answering method based on the temporal knowledge graph in Example 1. Since a detailed description has been given in Example 1, some details not reflected in this embodiment can be referred to Example 1 and will not be elaborated here.

[0084] Example 3

[0085] According to an embodiment of the present application, a non-volatile computer-readable storage medium is further provided, on which a computer program is stored. The device containing the non-volatile storage medium executes the computer program through a processor to perform the question-answering method based on the time-series knowledge graph in Example 1.

[0086] Specifically, the device where the non-volatile computer-readable storage medium is located executes the computer program through a processor to implement the following steps: obtaining a target question; determining multiple first entities in the target question, and determining first semantic role information in the target question, wherein the first semantic role information includes at least: subject, predicate, object and time information; determining multiple first knowledge associated with the multiple first entities from the target temporal knowledge graph, and determining the first entity relationship between each second entity in each first knowledge; determining the first knowledge corresponding to the first entity relationship matching the first semantic role information in the multiple first knowledge as the target knowledge; performing temporal logical reasoning based on the time information and the target knowledge to obtain the answer to the target question.

[0087] According to an embodiment of the present application, a processor is further provided, the processor being configured to run a computer program. When the processor runs the computer program, the question-answering method based on the temporal knowledge graph in Example 1 is executed.

[0088] Specifically, when the processor runs the computer program, it executes the following steps: obtaining a target question; determining multiple first entities in the target question, and determining first semantic role information in the target question, wherein the first semantic role information includes at least: subject, predicate, object and time information; determining multiple first knowledge associated with the multiple first entities from the target temporal knowledge graph, and determining the first entity relationship between each second entity in each first knowledge; determining the first knowledge corresponding to the first entity relationship matching the first semantic role information in the multiple first knowledge as the target knowledge; performing temporal logical reasoning based on the time information and the target knowledge to obtain the answer to the target question.

[0089] According to an embodiment of the present application, an electronic device is also provided, which includes: a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to implement the question-answering method based on the temporal knowledge graph in Example 1 by executing the computer program.

[0090] Specifically, when the processor runs the computer program, it implements the following steps: obtaining a target question; determining multiple first entities in the target question, and determining first semantic role information in the target question, wherein the first semantic role information includes at least: subject, predicate, object and time information; determining multiple first knowledge associated with the multiple first entities from the target temporal knowledge graph, and determining the first entity relationship between each second entity in each first knowledge; determining the first knowledge corresponding to the first entity relationship matching the first semantic role information in the multiple first knowledge as the target knowledge; performing temporal logical reasoning based on the time information and the target knowledge to obtain the answer to the target question.

[0091] The serial numbers of the above embodiments are for description only and do not represent the advantages or disadvantages of the embodiments.

[0092] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0093] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0094] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected to achieve the purpose of the present embodiment according to actual needs.

[0095] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0096] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code.

[0097] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0098] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0099] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A question-answering method based on a temporal knowledge graph, comprising: Get the target question; Determine a plurality of first entities in the target question, and determine first semantic role information in the target question, wherein the first semantic role information at least includes: a subject, a predicate, an object, and time information; Determine a plurality of first knowledge items associated with a plurality of the first entities from the target temporal knowledge graph, and determine a first entity relationship between each second entity in each of the first knowledge items; Determine the first knowledge corresponding to the first entity relationship matching the first semantic role information among the plurality of first knowledge as target knowledge; Perform temporal logical reasoning based on the time information and the target knowledge to obtain an answer to the target question.

2. The method according to claim 1, wherein determining a plurality of first entities in the target question and determining first semantic role information in the target question comprises: Determine a plurality of first entities in the target question using a pre-trained named entity recognition model; The first semantic role information in the target question is parsed using a pre-trained natural language processing model.

3. The method according to claim 1, wherein before obtaining the target question, the method further comprises: Collecting corpus data in multiple technical fields, the types of the corpus data include: text data and image data; Determine the text data corresponding to the image data using optical character recognition technology, and preprocess all the obtained text data, wherein the preprocessing includes at least one of the following: data cleaning and normalization; Performing entity recognition, entity relationship extraction and time series information extraction on all preprocessed text data to obtain a first processing result; Construct the target time series knowledge graph based on the first processing result.

4. The method according to claim 1, wherein determining a plurality of first knowledge associated with a plurality of the first entities from the target temporal knowledge graph, and determining a first entity relationship between each second entity in each of the first knowledge comprises: Determine, from the target time-series knowledge graph, second knowledge including a plurality of second entities corresponding to a plurality of first entities, and use all of the second knowledge as the first knowledge, wherein the similarity between each pair of corresponding first entities and second entities is greater than a preset threshold; Determine the first entity relationship between each of the second entities in the first knowledge based on the edge corresponding to the first knowledge in the target time-series knowledge graph.

5. The method according to claim 4, wherein the first semantic role information further comprises: clauses and determiners; After determining, from the target temporal knowledge graph, second knowledge including a plurality of second entities corresponding to a plurality of first entities, the method further includes: All the second knowledge are filtered according to the clauses, and / or the qualifiers, and / or the time information, and each piece of the second knowledge retained after filtering is used as the first knowledge.

6. The method according to claim 1, wherein determining the first knowledge corresponding to the first entity relationship matching the first semantic role information among the plurality of first knowledge as the target knowledge comprises: Determine a similarity score between the first semantic role information and the first entity relationship in each piece of the first knowledge using a pre-trained target similarity scoring model; The first knowledge corresponding to the first entity relationship having the highest similarity score with the first semantic role information is determined as the target knowledge.

7. The method according to claim 6, wherein the training process of the target similarity scoring model comprises: Constructing an initial similarity scoring model, and obtaining third knowledge in the target time series knowledge graph corresponding to multiple historical questions and answers to each historical question; For each historical question, determine the second semantic role information in the historical question, and determine the second entity relationship between each third entity in the third knowledge corresponding to the historical question, and form the second semantic role information and the second entity relationship into a training sample; The initial similarity scoring model is iteratively trained using a plurality of training samples to obtain the target similarity scoring model.

8. The method according to claim 1, wherein performing temporal logic reasoning based on the time information and the target knowledge to obtain an answer to the target question comprises: Determine a time series type corresponding to the time information, the time series type including at least one of the following: within a target time period, before a target time, after a target time, at the same time when a target event occurs, before a target event occurs, or after a target event occurs; Perform temporal logic reasoning based on the time series type and the target knowledge to obtain an answer to the target question.

9. A question-answering device based on a temporal knowledge graph, comprising: An acquisition module is used to obtain the target problem; A parsing module, used to determine a plurality of first entities in the target question and determine first semantic role information in the target question, wherein the first semantic role information at least includes: a subject, a predicate, an object and time information; A retrieval module, used to determine a plurality of first knowledge items associated with a plurality of the first entities from a target temporal knowledge graph, and to determine a first entity relationship between each second entity in each of the first knowledge items; A determination module, configured to determine the first knowledge corresponding to the first entity relationship matching the first semantic role information among the plurality of first knowledge as target knowledge; The answering module is used to perform time logic reasoning based on the time information and the target knowledge to obtain an answer to the target question.

10. The apparatus according to claim 9, wherein the parsing module is further configured to: Determine multiple first entities in the target question using a pre-trained named entity recognition model; The first semantic role information in the target question is parsed using a pre-trained natural language processing model.

11. The device according to claim 9, wherein the retrieval module is further used for: Determine from the target time series knowledge graph second knowledge including a plurality of second entities corresponding to a plurality of first entities, and use all the second knowledge as first knowledge, wherein the similarity between each pair of corresponding first entities and second entities is greater than a preset threshold; The first entity relationship between each second entity in the first knowledge is determined according to the edge corresponding to the first knowledge in the target temporal knowledge graph.

12. The apparatus according to claim 11, wherein the first semantic role information further comprises: Clauses and qualifiers, the retrieval module is also used to: All second knowledge is filtered according to the clauses, and / or qualifiers, and / or time information, and each piece of second knowledge retained after filtering is used as the first knowledge.

13. The apparatus according to claim 9, wherein the determining module is further configured to: Determine a similarity score between the first semantic role information and the first entity relationship in each first knowledge using a pre-trained target similarity scoring model; The first knowledge corresponding to the first entity relationship having the highest similarity score with the first semantic role information is determined as the target knowledge.

14. The device according to claim 9, wherein the response module is further configured to: Determine a time series type corresponding to the time information, the time series type including at least one of the following: within a target time period, before a target time, after a target time, at the same time when a target event occurs, before a target event occurs, or after a target event occurs; Perform temporal logic reasoning based on the time series type and the target knowledge to obtain an answer to the target question.

15. A non-volatile computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1 to 8 when executed by a processor.

Citation Information

Patent Citations

  • Question answering method based on time sequence knowledge graph, entity representation method and related device

    CN115374296A

  • Typhoon time sequence knowledge graph construction method and terminal

    CN116501895A

  • Question answering method and device based on time sequence knowledge graph

    CN117648423A

  • Complex question-and-answer query method and device based on time sequence knowledge graph

    WO2023155287A1

Cited By

  • Dynamic AI knowledge graph system

    CN120892581A

  • Construction method and device of multilevel power field knowledge base

    CN120893549A

  • Athletic fatigue state non-contact detection method based on artificial intelligence

    CN121330738A

  • Artificial intelligence-based non-contact detection method for motion fatigue state

    CN121330738B

  • Large model question and answer generation system and method, computer equipment and storage medium

    CN121787538A