CN115374296B - Question-answering method based on time sequence knowledge graph, entity representation method and related device - Google Patents

Question-answering method based on time sequence knowledge graph, entity representation method and related device Download PDF

Info

Publication number
CN115374296B
CN115374296B CN202211308301.1A CN202211308301A CN115374296B CN 115374296 B CN115374296 B CN 115374296B CN 202211308301 A CN202211308301 A CN 202211308301A CN 115374296 B CN115374296 B CN 115374296B
Authority
CN
China
Prior art keywords
knowledge
representation
entity
time
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211308301.1A
Other languages
Chinese (zh)
Other versions
CN115374296A (en
Inventor
张汀依
李直旭
支洪平
刘加新
吴瑞萦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Iflytek Suzhou Technology Co Ltd
Original Assignee
Iflytek Suzhou Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Iflytek Suzhou Technology Co Ltd filed Critical Iflytek Suzhou Technology Co Ltd
Priority to CN202211308301.1A priority Critical patent/CN115374296B/en
Publication of CN115374296A publication Critical patent/CN115374296A/en
Application granted granted Critical
Publication of CN115374296B publication Critical patent/CN115374296B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • G06F40/35Discourse or dialogue representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/02Knowledge representation; Symbolic representation

Abstract

The application discloses a question-answering method, an entity representation method and a related device based on a time sequence knowledge graph, wherein the method comprises the following steps: acquiring a target problem; searching a knowledge entity related to a target entity in a target problem by using semantic representation of each knowledge entity in the time sequence knowledge graph as an associated entity; and obtaining an answer to the target question based on at least one piece of knowledge of the associated entity contained in the time-sequence knowledge graph, wherein the semantic representation of the knowledge entity is obtained by fusing graph representation and text representation of the knowledge based on the knowledge, and the knowledge contains the knowledge entity and time. According to the method, the semantic representation of the entity is obtained by fusing the text representation and the map representation, the text representation and the map representation are fused in the semantic representation, and the entity can be more comprehensively represented, so that the target entity in the target problem can be more accurately understood, and the accuracy of the time-series knowledge map question-answer result is improved.

Description

Question-answering method based on time sequence knowledge graph, entity representation method and related device
Technical Field
The present application relates to the field of knowledge graph technology, and in particular, to a question-answering method, an entity representation method, and a related device based on a time-series knowledge graph.
Background
The core of the knowledge graph is a large-scale semantic network, and the semantic network is a knowledge representation form based on a directed graph structure, wherein nodes represent entities and concepts, and edges represent various semantic relationships. Because the effective time of Knowledge is different, in order to better describe entities and relations and provide more accurate Knowledge information, a Temporal Knowledge Graph (TKG) represents Knowledge as a quadruple of shapes (head entity, relation, tail entity, effective time).
The question-answering task flow of the time sequence knowledge graph comprises the steps of giving a time sequence knowledge graph and a question, and searching answers from the time sequence knowledge graph based on the question. In a long-term research and development process, the applicant of the application finds that in the prior art, entities in a target question cannot be accurately understood in question and answer, and the answer search is not accurate due to deviation of the entity understanding.
Disclosure of Invention
The technical problem mainly solved by the application is to provide a question-answering method, an entity representation method and a related device based on a time sequence knowledge graph, and the accuracy of question-answering of the time sequence knowledge graph can be improved.
In order to solve the technical problem, the application adopts a technical scheme that: a question-answering method based on a time sequence knowledge graph is provided, and the method comprises the following steps: acquiring a target problem; searching a knowledge entity related to a target entity in a target problem by using semantic representation of each knowledge entity in the time sequence knowledge graph as an associated entity; and obtaining an answer to the target question based on at least one piece of knowledge of the associated entity contained in the time sequence knowledge graph, wherein the semantic representation of the knowledge entity is obtained by utilizing knowledge representation of at least one piece of knowledge containing the knowledge entity, the knowledge representation of the knowledge is obtained by fusing graph representation and text representation of the knowledge, and the knowledge contains the knowledge entity and time.
Before the semantic representation of each knowledge entity in the time-series knowledge graph is utilized to find the knowledge entity related to the target entity in the target problem as the associated entity, the method further comprises the following steps: acquiring text representation and map representation of each knowledge in a time sequence knowledge map; the map representation and the text representation of each knowledge are fused to obtain the knowledge representation of each knowledge; and for each knowledge entity in the time sequence knowledge graph, obtaining semantic representation of the knowledge entity based on knowledge representation of a plurality of pieces of knowledge containing the knowledge entity.
Acquiring text representation of each knowledge in the time sequence knowledge graph, wherein the acquiring comprises the following steps: and respectively coding each knowledge in the time sequence knowledge graph by using the first language model to obtain the text representation of each knowledge.
Obtaining the map representation of each knowledge in the time sequence knowledge map comprises the following steps: and representing the time sequence knowledge graph by using a time sequence knowledge graph representation learning method to obtain graph representation of each knowledge in the time sequence knowledge graph.
The method for obtaining the semantic representation of the knowledge entity based on the knowledge representation of a plurality of pieces of knowledge including the knowledge entity comprises the following steps: and averaging the knowledge representations of all knowledge containing the knowledge entity to obtain the semantic representation of the knowledge entity.
The knowledge representation method comprises the following steps of: for each piece of knowledge, respectively fusing a first element representation and a second element representation of each element contained in the knowledge to obtain a fused representation of the knowledge; and obtaining a knowledge representation of the knowledge based on the fusion representation of the knowledge.
Wherein the knowledge contains elements including time, and before the knowledge representation is obtained based on the fused representation of the knowledge, the method further comprises: and fusing the fusion representation of the knowledge with the cosine coding of the time of the knowledge to obtain a new fusion representation, wherein the new fusion representation is used for obtaining the knowledge representation of the knowledge.
The knowledge fusion representation comprises a representation of each element contained in the knowledge and a representation of a knowledge mark representing the whole knowledge, and the knowledge representation of the knowledge is obtained based on the knowledge fusion representation, and comprises the following steps: and taking the representation of the knowledge mark in the fused representation of the knowledge as the knowledge representation of the knowledge.
Before searching the knowledge entity related to the target entity in the target problem by using the semantic representation of each knowledge entity in the time-series knowledge graph, the method further comprises the following steps: processing the target problem by using a second language model to obtain a plurality of problem element information in the target problem, wherein the plurality of problem element information comprises problem head entity information, problem relation information and problem tail entity information; the method for searching the knowledge entities related to the target entities in the target problem by utilizing the semantic representation of each knowledge entity in the time sequence knowledge graph as the associated entities comprises the following steps: at least one of the question head entity information and the question tail entity information is used as a target entity, and for each target entity, a knowledge entity with semantic representation matched with the target entity is searched from a time sequence knowledge graph and used as a related entity of the target entity; obtaining an answer to the target question based on at least one knowledge of the associated entity contained in the time-series knowledge graph, comprising: and acquiring at least one piece of knowledge of the associated entity containing the target entity from the time sequence knowledge graph to serve as target knowledge of the target entity, and acquiring an answer of the target question by using the target knowledge and the question relation information of each target entity.
Before acquiring at least one piece of knowledge of an associated entity containing a target entity from a time-series knowledge graph as target knowledge of the target entity, the method further comprises the following steps: based on the information of the plurality of problem elements, determining the probability that the relation related to the target problem is a multi-hop relation; acquiring at least one piece of knowledge of an associated entity containing a target entity from a time-series knowledge graph as target knowledge of the target entity, wherein the method comprises the following steps: selecting at least one piece of target knowledge as the target entity from knowledge of associated entities including the target entity based on the probability and the relationship graph representation of each relationship in the time-series knowledge graph.
Wherein, the elements included in the knowledge in the time sequence knowledge graph include time, and before finding the knowledge entity related to the target entity in the target problem by using the semantic representation of each knowledge entity in the time sequence knowledge graph, the method further comprises: processing the target problem by using a second language model to obtain time-related information in the target problem; determining question time information in the target question based on the time-related information; obtaining an answer to the target question by using the target knowledge and the question relation information of each target entity, wherein the answer comprises the following steps: and obtaining the answer of the target question by using the target knowledge, the question relation information and the question time information of each target entity.
Wherein the time-related information comprises time-related entities related to time; determining question time information in the target question based on the time-related information, including: classifying the time-related information to obtain inference time logic; searching a knowledge entity with semantic representation matched with the time-related entity in the time sequence knowledge graph to serve as a time reference entity; problem time information is determined based on time and inference time logic in the knowledge containing the time reference entity.
Wherein determining problem time information based on time and inference time logic in knowledge comprising a time reference entity comprises: obtaining a time representation of each time in a time series knowledge graph, wherein the time representation of the time comprises at least one of a time graph representation of the time and a cosine representation of the time; problem time information is determined based on the time in the knowledge containing the time reference entity, the inference time logic, and the time representation of each time.
In order to solve the technical problem, the other technical scheme adopted by the application is as follows: a method for representing an entity of a time-series knowledge graph is provided, and the method comprises the following steps: acquiring text representation and map representation of each knowledge in a time sequence knowledge map; the method comprises the steps of fusing map representation and text representation of each knowledge to obtain knowledge representation of each knowledge, wherein the knowledge comprises knowledge entities and time; and for each knowledge entity in the time sequence knowledge graph, obtaining semantic representation of the knowledge entity based on knowledge representation of a plurality of pieces of knowledge comprising the knowledge entity.
In order to solve the technical problem, the other technical scheme adopted by the application is as follows: provided is a question answering device based on a time sequence knowledge graph, comprising: the system comprises an acquisition module, a search module and an answer module, wherein the acquisition module is used for acquiring a target question; the searching module is used for searching the knowledge entities related to the target entities in the target problem as associated entities by utilizing the semantic representation of each knowledge entity in the time sequence knowledge graph; the semantic representation of the knowledge entity is obtained by utilizing knowledge representation of at least one piece of knowledge containing the knowledge entity, the knowledge representation of the knowledge is obtained by fusing atlas representation and text representation of the knowledge, and the knowledge contains the knowledge entity and time; the answer module is used for obtaining an answer of the target question based on the fact that the time sequence knowledge graph comprises at least one piece of knowledge of the associated entity.
In order to solve the above technical problem, another technical solution adopted by the present application is: an entity representation apparatus of a time-series knowledge-graph is provided, including: the system comprises an acquisition module, a fusion module and a representation module, wherein the acquisition module is used for acquiring text representation and map representation of each knowledge in a time sequence knowledge map; the fusion module is used for fusing the map representation and the text representation of each knowledge to obtain the knowledge representation of each knowledge, and the knowledge comprises knowledge entities and time; the representation module is used for obtaining semantic representation of the knowledge entities based on knowledge representation of a plurality of pieces of knowledge containing the knowledge entities for each knowledge entity in the time sequence knowledge graph.
In order to solve the above technical problem, another technical solution adopted by the present application is: there is provided an electronic device comprising a memory and a processor coupled to each other, the processor being configured to execute program instructions stored in the memory to implement the method of any of the above.
In order to solve the above technical problem, another technical solution adopted by the present application is: there is provided a computer readable storage medium having stored thereon program instructions which, when executed by a processor, implement the method of any of the above.
In the scheme, the semantic representation of the entity is obtained by fusing the text representation and the map representation, the text representation and the map representation are fused in the semantic representation, the entity can be represented more comprehensively, the entity semantic representation is used in the process of determining the associated entity with the target entity, the target entity can be associated with the knowledge entity in the time sequence knowledge map more accurately, the accurate associated entity is obtained, and the accuracy of the time sequence knowledge map question-answer result obtained by searching through the associated entity is improved.
Drawings
FIG. 1 is a schematic flow chart diagram illustrating an embodiment of a time-series knowledge-graph-based question answering method according to the present application;
FIG. 2 is a schematic flow chart diagram illustrating another embodiment of the time-series knowledge-graph-based question answering method of the present application;
FIG. 3 is a schematic flow chart diagram illustrating another embodiment of step S220;
FIG. 4 is a schematic flow chart diagram illustrating yet another embodiment of the time-series knowledge-graph-based question answering method of the present application;
FIG. 5 is a schematic flow chart diagram illustrating a method for question answering based on a time-series knowledge graph according to another embodiment of the present application;
FIG. 6 is a schematic flow chart diagram illustrating another embodiment of step S540 of the present application;
FIG. 7 is a flowchart illustrating an embodiment of a method for representing entities in a time-series knowledge-graph of the present application;
FIG. 8 is a block diagram of an embodiment of the present application for a time-series knowledge-graph based question answering apparatus;
FIG. 9 is a block diagram of an embodiment of an entity representation apparatus of the time-series knowledgegraph of the present application;
FIG. 10 is a block diagram of an embodiment of an electronic device of the present application;
FIG. 11 is a block diagram of an embodiment of a computer-readable storage medium of the present application.
Detailed Description
In order to make the objects, technical solutions and effects of the present application clearer and clearer, the present application is further described in detail below with reference to the accompanying drawings and examples.
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, interfaces, techniques, etc. in order to provide a thorough understanding of the present application.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship. Further, the term "plurality" herein means two or more than two. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of a, B, and C, and may mean including any one or more elements selected from the group consisting of a, B, and C.
It is understood that the time-series knowledge graph-based question-answering method in the present application can be executed by an electronic device, which can be any device with processing capability, such as a computer, a mobile phone, a tablet computer, and the like. It should be noted that the time-series knowledge graph may also be referred to as a knowledge graph.
Referring to fig. 1, fig. 1 is a schematic flow chart of an embodiment of a time-series knowledge-graph-based question answering method according to the present application. Specifically, the method may comprise:
step S110: and acquiring a target problem.
The time sequence knowledge graph question-answering is an intelligent question-answering method based on a time sequence knowledge graph, a natural language question is given, and an answer corresponding to the question is searched or inferred from the time sequence knowledge graph, wherein a target question is the question needing to be answered. In a specific application scenario, the target problem may be that a is several years old this year, or that a is several years old when held at the beijing olympic conference.
It should be noted that the answer to the target question may be directed to one or more knowledge entities in the time-series knowledge graph, or may be obtained according to one or more knowledge entities in the time-series knowledge graph.
In some embodiments, the answer to the target question may also point to one or more times in the time-series knowledge graph, or may be derived from one or more times in the time-series knowledge graph.
In some embodiments, the answer to the target question may also point to, or may be derived from, one or more relationships in the time-series knowledge-graph.
Step S120: and searching the knowledge entities related to the target entities in the target problems by using the semantic representation of each knowledge entity in the time sequence knowledge graph as associated entities.
The target problem comprises a target entity, one or more of the knowledge entities in the time sequence knowledge graph can be related to the target entity, the correlation can be that the knowledge entities are consistent with the target entity, and/or other correlation relations exist between the knowledge entities and the target entity, and the knowledge entities related to the target entity are searched from the time sequence knowledge graph, namely the knowledge entities are used as correlation entities. Specifically, for example, the target entity is "doctor", and the knowledge entities "doctor", "medical doctor" and "philosophy" included in the time sequence knowledge graph are all used as associated entities.
The semantic representation of the knowledge entity is obtained by using a knowledge representation containing at least one piece of knowledge of the knowledge entity, and the knowledge representation of the knowledge is obtained by fusing a map representation and a text representation of the knowledge.
Step S130: and obtaining an answer to the target question based on at least one piece of knowledge of the associated entity contained in the time sequence knowledge graph.
It is understood that there is a correlation between the answer to the target question and the associated entity, so that at least one piece of knowledge of the associated entity included in the time-series knowledge graph can be used to determine the answer to the target question.
According to the scheme, the semantic representation of the entity is obtained by fusing the text representation and the map representation, the text representation and the map representation are fused in the semantic representation, the entity can be represented more comprehensively, the entity semantic representation is used in the process of determining the associated entity with the target entity, the target entity can be associated with the knowledge entity in the time sequence knowledge map more accurately to obtain the accurate associated entity, the accuracy of the time sequence knowledge map question-answer result obtained by searching through the associated entity is improved, the target question is more accurately understood by the semantic representation, and the accuracy of the time sequence knowledge map question-answer result is improved.
Referring to fig. 2, fig. 2 is a schematic flow chart of another embodiment of the time-series knowledge-graph-based question answering method according to the present application. Specifically, the method may comprise:
step S210: and acquiring text representation and map representation of each piece of knowledge in the time sequence knowledge map.
The text representation and the map representation are obtained by representing knowledge by adopting a text representation method and a map representation method respectively, and the two representation modes are different.
Specifically, obtaining the text representation of each knowledge in the time-series knowledge graph can be achieved through the following steps: the first language model may be any model that processes natural language and is used for understanding meaning of natural language, and may include, but is not limited to, BERT model (Bidirectional Encoder reporting from transforms). The knowledge, and entities therein, can be accurately understood by processing of the first language model.
Specifically, obtaining the map representation of each knowledge in the knowledge map can be realized by the following steps: and respectively representing each knowledge in the knowledge graph by using a knowledge graph representation learning method to obtain graph representation of each knowledge in the knowledge graph. The knowledge graph representation learning method may include, but is not limited to, tensor decomposition based algorithms and the like.
It should be noted that, elements included in a piece of knowledge may include a head entity, a relationship, a tail entity, and a time, and a text representation and a graph representation of a piece of knowledge may include a text representation and a graph representation corresponding to each element in the piece of knowledge.
In some embodiments, since the granularity of the entities in the question is not consistent with the granularity of the entities in the knowledge graph, for example, the question includes "doctor", and the knowledge graph includes "doctor", "medical doctor" and "philosophy", if the names of the entities in the question are simply mapped to the names of the entities in the knowledge graph for the answer lookup, the answer lookup may not be accurate due to the granularity difference. In the above example, "doctor medical" and "philosophy" could not be associated with "doctor" in the question, and the answers obtained were not accurate enough.
The text representation of knowledge is obtained by processing through the first language model, and the knowledge and the entities therein can be fully understood based on the context understanding of the knowledge through the first language model, and specifically, the semantic representation of the knowledge entities obtained by combining the text representation and the graph representation can show the incidence relation among the entities with different granularities, so that the entity granularity in the target problem can be accurately understood.
Step S220: and fusing the map representation and the text representation of each knowledge to obtain the knowledge representation of each knowledge.
The spectral representation and the textual representation are fused such that the knowledge representation is able to fuse the information contained in both representations, resulting in a representation of each piece of knowledge. The semantic representation of the entity can contain the incidence relation among the entities with different granularities, so that the target entity granularity in the problem can be accurately understood, and the incidence entity of the target entity can be accurately determined.
Step S230: the semantic representation of the knowledge entity is obtained based on a knowledge representation of a number of pieces of knowledge comprising the knowledge entity.
It should be noted that a knowledge entity is included in the knowledge items, and in order to obtain the semantic representation of the knowledge entity, the knowledge items need to be obtained by integrating the knowledge items, so that the semantic representation of the knowledge entity can be obtained by processing the knowledge representation of the knowledge items.
A knowledge entity is contained in a piece of knowledge and can be represented as a head entity or a tail entity in the knowledge and the knowledge entity are consistent. In a particular application scenario, knowledge entities "Suzhou", (Suzhou museum, established in, suzhou, 1960) and (Suzhou university, established in, suzhou, 1900) may be considered to contain two pieces of knowledge of the knowledge entity.
Specifically, obtaining the semantic representation of the knowledge entity based on the knowledge representation of several pieces of knowledge including the knowledge entity can be achieved by the following steps: and averaging all knowledge representations containing the knowledge entity to obtain the semantic representation of the knowledge entity.
In a specific application scenario, the corresponding knowledge representations of (Suzhou museum, rev., suzhou, 1960) and (Suzhou university, rev., suzhou, 1900) are averaged to obtain a semantic representation of the knowledge entity "Suzhou".
In some embodiments, the processing of the knowledge representations of the several pieces of knowledge may also be implemented by performing other processing such as weighted averaging on the knowledge representations of the several pieces of knowledge.
Step S240: and acquiring a target problem.
Step S250: and searching the knowledge entities related to the target entities in the target problem by utilizing the semantic representation of each knowledge entity in the time sequence knowledge graph to serve as the related entities.
Step S260: and obtaining an answer to the target question based on at least one piece of knowledge of the associated entity contained in the time sequence knowledge graph.
The relevant description of steps S240 to S260 may refer to the relevant content in the foregoing embodiments, and is not described herein again.
According to the scheme, the semantic representation can be used for comprehensively and accurately representing the knowledge entities, and can be represented as the incidence relation between entities with different granularities, so that the granularity of the target entity in the target problem can be accurately understood, the incidence entities relevant to the target problem can be further determined, and the accuracy of the time sequence knowledge map question-answer result is improved.
Referring to fig. 3, fig. 3 is a schematic flowchart illustrating another embodiment of step S220 of the present application. Specifically, step S220 may include:
step S321: and respectively fusing the first element representation and the second element representation of each element contained in the knowledge to obtain a fused representation of the knowledge.
It should be noted that each piece of knowledge is processed separately. A piece of knowledge may include a number of elements, which may include head entities, relationships, tail entities, and time.
The knowledge graph representation can be obtained by representing the knowledge through a knowledge graph representation learning method, and the knowledge graph representation is represented by a first element comprising each element in the knowledge. The first element representation is a representation of the element learned using the knowledge graph representation.
The text representation of the knowledge can be obtained by representing the knowledge through a text representation method, the text representation of the knowledge comprises second element representations of elements contained in the knowledge, and the second element representations are representations of the elements obtained based on the text representation mode.
For the representation of the knowledge entity, the first element representations of different entities are different and cannot embody the association between different granular entities, and the second element representations of different entities are different but can embody the association between different granular entities. For example, the first elements of the knowledge entities "doctor", "medical doctor" and "philosophy doctor" are different from each other, the second elements are different from each other, the first elements do not represent the inclusion relationship between the three, and the second elements represent the inclusion relationship between the three. The method comprises the steps of obtaining fusion representation by fusing atlas representation and text representation of knowledge, and obtaining semantic representation of knowledge entities, so that the semantic representation of the knowledge entities can reflect incidence relations among the knowledge entities with different granularities, the target entity granularity in a question can be accurately understood, the correlation entities of the target entities can be accurately determined, and the accuracy of question-answering answers is improved.
In some embodiments, between step S321 and step S322, the method may further include: and fusing the fused representation of the knowledge with the cosine coding of the time of the knowledge to obtain a new fused representation, wherein the new fused representation is used for obtaining the knowledge representation of the knowledge. The information of the time of the knowledge is contained in the new fusion representation through fusion with the cosine coding of the time, so that the semantic representation of the entity can also contain time related information.
Step S322: and obtaining a knowledge representation of the knowledge based on the fusion representation of the knowledge.
Wherein the fused representation of knowledge comprises a representation of elements comprised by the knowledge, which can be used to represent the piece of knowledge.
In particular, the fused representation of knowledge may also include a representation of a knowledge tag representing the entire knowledge, which may be used as a representation of knowledge directly as a representation of the entire knowledge.
In a specific application scenario, take an entity h as an exampleIt is noted that n knowledge groups include an entity h, and each knowledge group is processed separately. Each knowledge X is according to [ CLS ]]Head entity, relationship, tail entity, time ", where [ CLS](CLS token) is a knowledge mark, and the jointed knowledge is input into a BERT model to obtain a text representation X 1 The text represents X 1 Comprises [ CLS]Head entity, relation, tail entity, time, and length respectively with the input [ CLS]The head entity, the relation, the tail entity and the time are the same correspondingly. Learning the representation of entities, relations and time in the time sequence knowledge graph by adopting an algorithm based on tensor decomposition to obtain a graph representation X of knowledge 2 . Expressing the map of the knowledge in the knowledge map by X 2 And text representation X 1 Fusing to obtain a fused representation X 3 More specifically, the graph representations of entities, relationships, and times are each associated with X 1 And correspondingly adding the coding results of the intermediate entities, the relationships and the time. Mixing X 3 Splicing with cosine coding of time, coding the spliced representation by adopting a Transformer to obtain a knowledge representation X of the knowledge 4 。X 4 Special token [ CLS ] in]Is coded by
Figure 175674DEST_PATH_IMAGE001
A knowledge representation representing the entire piece of knowledge. Finally, averaging the knowledge representation of the n pieces of knowledge to obtain the semantic representation e of the entity h h The following formula shows:
Figure 773008DEST_PATH_IMAGE002
(1)
Figure 528475DEST_PATH_IMAGE003
(2)
Figure 511343DEST_PATH_IMAGE004
(3)
Figure 326852DEST_PATH_IMAGE005
(4)
Figure 411483DEST_PATH_IMAGE006
(5)
Figure 862318DEST_PATH_IMAGE007
(6)
referring to fig. 4, fig. 4 is a schematic flow chart of a question-answering method based on a time-series knowledge graph according to another embodiment of the present application. In particular, the method may comprise the steps of:
step S410: and acquiring a target problem.
The related description of step S410 may refer to the related content related to step S110, which is not described herein again.
Step S420: and processing the target problem by utilizing the second language model to obtain a plurality of problem element information in the target problem.
The second language model may be any model for processing natural language for understanding meaning of natural language, and may include, but is not limited to, BERT model (Bidirectional Encoder reproduction from transforms). The plurality of question element information may include question header entity information, question relation information, and question trailer entity information. The second language model may be the same as or different from the first language model.
Specifically, step S420 may be implemented by: and processing the target problem by using the second language model to obtain a processing result, and distinguishing problem element information in the processing result to obtain a plurality of problem element information.
In a specific application scenario, a projection function is used for projecting the processing result to distinguish information related to the question and answer target in the target question, and then a projection function corresponding to each question element information is used for carrying out re-projection, so that corresponding question element information is obtained. Specifically, for example, the target question is Q, the process result Q is obtained by reading the question Q by using a BERT model, and the projection is usedFunction(s)
Figure 575059DEST_PATH_IMAGE008
Q is obtained by distinguishing information related to question-answering targets in target questions a Using a projection function f h 、f r 、f t Are respectively to Q a Performing projection to obtain problem head entity information Q in problem h Question tail entity information Q t And problem relation information Q r . As shown in the following equation:
Figure 436836DEST_PATH_IMAGE009
(7)
Figure 992451DEST_PATH_IMAGE010
(8)
Figure 89720DEST_PATH_IMAGE011
(9)
Figure 797913DEST_PATH_IMAGE012
(10)
Figure 955225DEST_PATH_IMAGE013
(11)
in some embodiments, other ways of distinguishing the question element information from the processing results may also be employed.
Step S430: and taking at least one of the question head entity information and the question tail entity information as a target entity, and finding out a knowledge entity with semantic representation matched with the target entity from the time sequence knowledge graph as an associated entity of the target entity.
The relevant description of step S430 may refer to the relevant content mentioned above with respect to step S120.
It should be noted that the answer to the target question may be directed to a knowledge entity, and the target question may include a target entity, for example, the target question is "who acts as the company a chief manager", the target entity may be "the company a chief manager", and the answer to the target question is directed to an answer entity, which may be a person name. The question head entity information, the question relation information, and the question tail entity information may be determined based on the target question through step S420, in some cases, the target entity may be distinguished as the question head entity information, and then the question tail entity information is used to point to the answer entity, in other cases, the target entity may also be distinguished as the question tail entity information, and then the question head entity information is used to point to the answer entity. Continuing with the above example, "company A chief manager" is distinguished as the question head entity information, and the question tail entity information is used to point to the answer entity; alternatively, "a company chief manager" is distinguished as the question end entity information, and the question head entity information is used to point to the answer entity.
It should be noted that, when the answer of the target question points to the answer entity, the question head entity information/question tail entity information points to the answer entity, and the question head entity information/question tail entity information may be used to indicate the nature of the answer entity, for example, "a company chief manager" is distinguished as the question head entity information, and the question tail entity information is used to point to the answer entity and may be used to indicate the nature that the answer entity belongs to the character type.
Therefore, under the condition that the target entity possibly exists as question head entity information or question tail entity information, in the process of one question answering, after one of the question head entity information and the question tail entity information is determined to be the target entity, a knowledge entity with semantic representation matched with the target entity is searched from the time sequence knowledge graph to serve as a correlation entity, so that the answer is searched. Or, the information of the question head entity is used as a target entity, the information of the question tail entity is used as a target entity, the subsequent steps of searching for the associated entity and searching for the answer are respectively carried out, and the results of the two times of answer searching are integrated to obtain the final answer.
Step S440: and obtaining an answer to the target question based on at least one piece of knowledge of the associated entity contained in the time sequence knowledge graph.
It can be understood that there is a relation between the answer of the target question and the associated entity, when searching for the answer, at least one piece of knowledge including the associated entity may be first acquired from the time sequence knowledge graph based on the associated entity, and used as the target knowledge of the target entity, and the target knowledge may be used as the knowledge range of the search answer, and then the answer of the target question is searched and obtained by using the target knowledge and question relation information of each target entity.
It should be noted that there is a direct association or an indirect association between the answer of the target question and the associated entity, the direct association may be expressed as an association between the answer entity and the associated entity through a certain relationship, and the indirect association may be expressed as an association between the answer entity and the associated entity through a multi-hop relationship. In some embodiments, in view of the indirect association described above, before obtaining the target knowledge based on the associated entity, the method further comprises: determining the probability that the relation related to the target problem is a multi-hop relation based on the information of the plurality of problem elements; then, when obtaining the target knowledge of the target entity, at least one piece of target knowledge may be selected from the knowledge including the associated entity as the target knowledge of the target entity based on the probability of the existence of the multi-hop relationship and the relationship included in the knowledge graph, at this time, due to the existence of the multi-hop relationship, the target knowledge may include not only the triplet, but also the multi-tuple including the target entity, and the multi-tuple includes several triplets that are sequentially connected end to end.
In a specific application scenario, the probability s of the multi-hop relationship is based on the problem header entity information Q h Question tail entity information Q t And question relation information Q r Specifically, the calculation may be performed by the following formula:
Figure 514250DEST_PATH_IMAGE014
(12)
according to the scheme, in the process of searching answers, the target problem is understood based on semantic representation of the entity, the associated entity matched with the target entity is determined, then target knowledge is determined based on the associated entity, answers are further searched from the target knowledge by using the problem element information, the target problem can be accurately understood based on the semantic representation, the entity granularity of the target entity can be accurately understood, and the accuracy of searching the answers is improved. Furthermore, the condition that a multi-hop relation exists is considered, in the process of searching the answer, the answer is searched based on the probability of a plurality of relations, and the accuracy of searching the answer is further improved.
Referring to fig. 5, fig. 5 is a schematic flow chart of a question-answering method based on a time-series knowledge graph according to another embodiment of the present application. In particular, the method may comprise the steps of:
step S510: and acquiring a target problem.
In this embodiment, the target question includes time-related content for temporally limiting the answer.
Step S520: and processing the target problem by utilizing the second language model to obtain a plurality of problem element information in the target problem.
For the related description of step S520, reference may be made to the related contents related to step S420, which are not described herein again.
Step S530: and processing the target problem by utilizing the second language model to obtain time-related information in the target problem.
In some cases, the target question may include time-related content, for example, the target question is "who acts as a corporate chief manager before 2008", "who acts as a corporate chief manager before beijing olympic games", where "before 2008" and "before beijing olympic games" are time-related content included in the target question, and represent temporal limitations of the answer to the target question, which need to be taken into consideration when searching for the answer.
Specifically, step S530 may be implemented by the following steps: and processing the target question by using the second language model to obtain a processing result, and distinguishing the processing result to obtain time-related information, wherein the time-related information is used for representing time limitation of the answer in the target question and is used for obtaining question time information to help determine the answer of the target question.
In a specific application scenario, the processing result is projected by using a projection function corresponding to the time-related information, so that the time-related information can be distinguished from the processing result. Specifically, for example, Q is the result of the BERT model processing, and is determined by the projection function f 1 Distinguishing information related to time range in question to obtain time related information
Figure 556155DEST_PATH_IMAGE015
As shown in the following equation:
Figure 977909DEST_PATH_IMAGE016
(13)
step S540: problem time information in the target problem is determined based on the time-related information.
Specifically, the time in the time-series knowledge graph, which corresponds to the time-related information, may be determined as the question time information by comparing the time-related information with the time included in the time-series knowledge graph.
Further, by comparing the time determined according to the time-related information with the time included in the time-series knowledge graph, the time in the time-series knowledge graph, which corresponds to the time-related information, can be determined as the problem time information.
It should be noted that the time-related information may directly include a specific time to time-limit the answer, for example, "before 2008", or may include a time-related entity to time-limit the answer, for example, "before beijing olympic games". For the latter, it is necessary to determine a specific time from the time-dependent entity included in the time-dependent information and then determine the problem time information.
The time determined according to the time-related information may be a time directly included in the time-related information, or a time determined according to a time-related entity in the time-related information and including knowledge of a time reference entity.
Referring to fig. 6, fig. 6 is a schematic flowchart illustrating another embodiment of step S540 of the present application. Specifically, step S540 may include the steps of:
step S641: and classifying the time related information to obtain inference time logic.
In this embodiment, the time-related information may include two parts of content to temporally limit the answer, one is specific time, and the other is temporal inference logic, which may be used to determine the valid time period based on time, specifically for example, the temporal limit of the answer to the target question may be expressed as "before 2008", "after 2022", and the like. Where inference time logic may be used to determine valid time periods based on time, such as "before 8230;," "after 8230;," "when 8230; and" between 8230; etc.
In a specific application scenario, the classifier is used for time-related information
Figure 430756DEST_PATH_IMAGE015
Temporal reasoning logic for categorizing deterministic problems
Figure 570750DEST_PATH_IMAGE017
The following formula shows:
Figure 416347DEST_PATH_IMAGE018
(14)
step S642: and searching knowledge entities with semantic representations matched with the time-related entities in the time sequence knowledge graph to serve as time reference entities.
In this embodiment, the time-related information includes a time-related entity related to time to perform time limitation on the answer, the time-related entity is a knowledge entity included in the question and used for determining the time limitation on the answer, and the time-related entity alone cannot determine the time limitation on the answer and needs the time corresponding to the time-related entity. For example, "before the beijing olympic games" cannot be directly used to determine the time limit of the answer to the target question, and the time corresponding to the time-related entity needs to be determined first.
The time-related entities have corresponding knowledge entities in the time sequence knowledge graph, the knowledge entities in the time sequence knowledge graph are used as time reference entities, the knowledge of the time reference entities comprises time, and the time is logically combined with the reasoning time to determine the time limit of the answer.
Step S643: problem time information is determined based on time and inference time logic in the knowledge containing the time reference entity.
The knowledge containing the time reference entity can be a plurality of pieces, and all the time in the knowledge containing the time reference entity can be used for determining the problem time information.
Specifically, the time in the knowledge containing the time reference entity determined according to the time-related entity in the time-related information is compared with the time included in the time sequence knowledge graph, so that the time meeting the time-related information in the time sequence knowledge graph can be determined as the problem time information.
Step S643 may be implemented by: and acquiring time representation of each time in the knowledge graph, and determining problem time information based on the time in the knowledge containing the time reference entity, the inference time logic and the time representation of each time.
Wherein the time representation of each time in the knowledge-graph includes at least one of a time-graph representation of each time and a cosine representation of the time. The cosine representation of the time may be used to determine the order of precedence between times. And comparing the time in the knowledge containing the time reference entity with the time in the known sequence contained in the knowledge map spectrum to determine a plurality of times in the knowledge map which accord with the time in the knowledge containing the time reference entity and the inference time logic as the effective time of the answer. Specifically, for example, the time and time inference logic in the knowledge including the time reference entity, which is determined according to the time content in the target question "before 2008", is compared with the times of the known precedence order included in the knowledge graph, and the effective time of the answer at the time before 2008 in the knowledge graph is determined.
In a specific application scenario, the question time information is obtained through step S642 and step S643
Figure 849864DEST_PATH_IMAGE019
This can be achieved by the following equation:
Figure 348979DEST_PATH_IMAGE020
(15)
wherein the content of the first and second substances,
Figure 117215DEST_PATH_IMAGE021
,(i=1…E n ,E n is the number of entities), E is the semantic representation of all entities in the knowledge-graph; q τ Is time-related information;
Figure 359977DEST_PATH_IMAGE022
,(τ=1…T n ,T n is the number of timestamps), TKGE (T) is a temporal representation of all times of the temporal knowledge map;
Figure 880957DEST_PATH_IMAGE023
,(τ=1…T n ,T n is the number of time stamps), cos (T) is the cosine representation of all times;
Figure 691918DEST_PATH_IMAGE024
is a temporal inference logic.
Step S550: and taking at least one of the question head entity information and the question tail entity information as a target entity, and finding out a knowledge entity with semantic representation matched with the target entity from the time sequence knowledge graph as an associated entity of the target entity.
Step S560: and acquiring at least one piece of knowledge of the associated entity containing the target entity from the time-sequence knowledge graph to serve as the target knowledge of the target entity.
Step S570: and obtaining the answer of the target question by using the target knowledge, the question relation information and the question time information of each target entity.
It should be noted that steps S550-S570 can be implemented by using a neural network model. In a specific application scenario, the input of the neural network includes the question header entity information Q h Question tail entity information Q t All entities semantic representation E, question relation information Q r Question time information
Figure 806505DEST_PATH_IMAGE019
A multi-hop relation probability s and all relation maps in the map represent R, wherein the problem head entity information Q h And question tail entity information Q t One of which serves as a target entity. The answer of the target question is that the question head entity information Q is respectively integrated h And question end entity information Q t Obtained as a result of the target entity. The following formula:
Figure 476127DEST_PATH_IMAGE025
(16)
Figure 726980DEST_PATH_IMAGE026
(17)
Figure 443263DEST_PATH_IMAGE027
(18)
in some embodiments, the answer may be looked up without taking into account the multi-hop relationship.
In some embodiments, the answer to the target question may also point to time, e.g., the target question may be "before 2008, in which year a acted as company a head manager". In this case, the question head entity information and the question tail entity information both represent a certain entity, and when searching for an answer, only the question head entity information and the question tail entity information need to be simultaneously used as target entities for searching for once, respectively searching for associated entities corresponding to the two, determining target knowledge based on the associated entities respectively, and then searching for an answer from the target knowledge based on the question relationship information and the question time information.
In some embodiments, the answer to the target question may also point to a relationship that is processed in a manner similar to when the answer to the target question points to time.
In some embodiments, the answer to the target question may be a plurality of entities/times/relationships, or may be counted or sorted based on a plurality of entities/times/relationships, in addition to one entity/time/relationship. The method can also comprise the steps of predetermining the number of answers of the target question, and searching the answers according to the number of the answers when searching the answers. For the counting and sorting type questions, a plurality of answers conforming to the questions are searched first, sorting and counting are carried out on the basis of obtaining the plurality of answers, and a final answer is obtained.
According to the scheme, the number of answers can be determined based on the type of the target problem, after the range of the target knowledge is determined, the answers with the corresponding number can be found, the target problem with the only answer can be solved, the target problems with a plurality of answers can also be solved, furthermore, counting and sequencing can be carried out on the basis of the plurality of answers, and the problems of counting and sequencing types can be solved; and the accuracy of answers to various types of questions, including the counting and sorting type of questions, can be further improved based on the semantic representation.
Referring to FIG. 7, FIG. 7 is a flowchart illustrating an embodiment of a method for representing entities in a time-series knowledge-graph according to the present application. In particular, the method may comprise the steps of:
step S710: and acquiring text representation and map representation of each piece of knowledge in the time sequence knowledge map.
Step S720: and fusing the map representation and the text representation of each knowledge to obtain the knowledge representation of each knowledge.
Step S730: and for each knowledge entity in the time sequence knowledge graph, obtaining semantic representation of the knowledge entity based on knowledge representation of a plurality of pieces of knowledge comprising the knowledge entity.
The relevant description of step S710 to step S730 can refer to the relevant content in the foregoing embodiments, and is not repeated herein.
According to the scheme, the text representation and the map representation are fused to obtain the semantic representation of the entity, the entity semantic representation can more comprehensively reflect the knowledge entity and accurately represent the knowledge entity so as to accurately understand the target problem, determine the associated entity associated with the target problem and improve the accuracy of the question-answering result of the time-sequence knowledge map.
Referring to fig. 8, fig. 8 is a schematic diagram of a framework of an embodiment of a time-series knowledge-graph-based question answering device according to the present application.
In this example, the question-answering device 80 based on the time-series knowledge graph includes an obtaining module 81, a searching module 82 and an answering module 83, wherein the obtaining module 81 is used for obtaining the target question; the searching module 82 is configured to search, as an associated entity, a knowledge entity related to a target entity in the target problem by using semantic representations of the knowledge entities in the time-series knowledge graph; the semantic representation of the knowledge entity is obtained by utilizing knowledge representation of at least one piece of knowledge containing the knowledge entity, the knowledge representation of the knowledge is obtained by fusing atlas representation and text representation of the knowledge, and the knowledge contains the knowledge entity and time; the answer module 83 is configured to obtain an answer to the target question based on at least one knowledge of the associated entity included in the time-series knowledge graph.
Referring to FIG. 9, FIG. 9 is a block diagram of an embodiment of an entity representation apparatus of the time-series knowledgegraph of the present application.
In this embodiment, the entity representation apparatus 90 of the time sequence knowledge graph includes an acquisition module 91, a fusion module 92, and a representation module 93, where the acquisition module 91 is configured to acquire text representations and graph representations of each knowledge in the time sequence knowledge graph; the fusion module 92 is configured to fuse the map representation and the text representation of each piece of knowledge to obtain a knowledge representation of each piece of knowledge, where the knowledge includes knowledge entities and time; the representation module 93 is configured to, for each knowledge entity in the time-series knowledge graph, obtain a semantic representation of the knowledge entity based on a knowledge representation of a plurality of pieces of knowledge including the knowledge entity.
Referring to fig. 10, fig. 10 is a schematic frame diagram of an embodiment of an electronic device of the present application.
In this embodiment, the electronic device 100 includes a memory 101 and a processor 102, wherein the memory 101 is coupled to the processor 102. Specifically, various components of the electronic device 100 may be coupled together by a bus, or the processor 102 of the electronic device 100 may be connected with other components one by one, respectively. The electronic device 100 may be any device with processing capabilities, such as a computer, a tablet, a cell phone, etc.
The memory 101 is used for storing program data executed by the processor 102, data of the processor 102 during processing, and the like. Such as question header entity information, time related information, etc. The memory 101 includes a nonvolatile storage portion for storing the program data.
The processor 102 controls the operation of the electronic device 100, and the processor 102 can also be referred to as a Central Processing Unit (CPU). The processor 102 may be an integrated circuit chip having signal processing capabilities. The processor 102 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. In addition, the processor 102 may be implemented collectively by a plurality of circuit forming chips.
Processor 102, by invoking program data stored in memory 101, is configured to execute instructions to implement any of the above-described sequential-knowledge-graph-based question-answering methods or sequential-knowledgegraph-based entity representation methods.
Referring to fig. 11, fig. 11 is a block diagram illustrating an embodiment of a computer readable storage medium according to the present application.
In this embodiment, the computer readable storage medium 110 stores processor executable program data 111 that can be executed to implement any of the above-described time series knowledge graph based question-answering methods or time series knowledge graph entity representation methods.
The computer-readable storage medium 110 may be a medium that can store program data, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, or may be a server that stores the program data, and the server may send the stored program data to other devices for operation or may self-operate the stored program data.
In some embodiments, computer-readable storage medium 110 may also be a memory as shown in FIG. 10.
The above description is only an embodiment of the present application, and is not intended to limit the scope of the present application, and all equivalent structures or equivalent processes performed by the present application and the contents of the attached drawings, which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (10)

1. A question-answering method based on a time-series knowledge graph is characterized by comprising the following steps:
acquiring a target problem;
searching the knowledge entities related to the target entities in the target problem by using the semantic representation of each knowledge entity in the time sequence knowledge graph as associated entities; wherein the semantic representation of the knowledge entity is obtained by using a knowledge representation containing at least one piece of knowledge of the knowledge entity, the knowledge representation of the knowledge is obtained by fusing a new fusion representation based on a fusion representation of the knowledge and a cosine code of time of the knowledge, the fusion representation of the knowledge is obtained by fusing a graph representation and a text representation of the knowledge, and the knowledge contains the knowledge entity and time;
and obtaining an answer to the target question based on at least one piece of knowledge of the associated entity contained in the time sequence knowledge graph.
2. The method of claim 1, wherein before the finding the knowledge entity associated with the target entity in the target problem as the associated entity using the semantic representation of each knowledge entity in the time-series knowledge graph, the method further comprises:
acquiring text representation and map representation of each knowledge in the time sequence knowledge map;
fusing the atlas representation and the text representation of each piece of knowledge to obtain the knowledge representation of each piece of knowledge;
for each knowledge entity in the time-series knowledge graph, obtaining a semantic representation of the knowledge entity based on the knowledge representation of the plurality of pieces of knowledge including the knowledge entity.
3. The method of claim 2, wherein fusing the graph representation and the text representation of each piece of knowledge to obtain a knowledge representation of each piece of knowledge comprises:
fusing the atlas representation and the text representation of each piece of knowledge to obtain a fused representation of the knowledge;
fusing the fused representation of the knowledge with the cosine coding of the time of the knowledge to obtain the new fused representation;
deriving a knowledge representation of the knowledge based on the new fused representation;
and/or the new fused representation comprises a representation of each element contained by the knowledge and a representation of a knowledge tag representing the knowledge as a whole, and the obtaining of the knowledge representation of the knowledge based on the new fused representation comprises:
and taking the representation of the knowledge marker in the new fusion representation as the knowledge representation of the knowledge.
4. The method of claim 1, wherein prior to finding the knowledge entity associated with the target entity in the target problem using the semantic representation of each knowledge entity in the time-series knowledge-graph, the method further comprises:
processing the target question by using a preset language model to obtain a plurality of question element information in the target question, wherein the plurality of question element information comprises question head entity information, question relation information and question tail entity information; and (c) a second step of,
processing the target problem by using the preset language model to obtain time-related information in the target problem, and determining problem time information in the target problem based on the time-related information;
the finding the knowledge entities related to the target entities in the target problem by using the semantic representation of each knowledge entity in the time sequence knowledge graph as associated entities includes:
taking at least one of the question head entity information and the question tail entity information as the target entity, and for each target entity, finding out a knowledge entity of which the semantic representation is matched with the target entity from the time sequence knowledge graph as a related entity of the target entity;
the obtaining an answer to the target question based on at least one piece of knowledge of the associated entity included in the time-series knowledge graph comprises:
and acquiring at least one piece of knowledge of an associated entity containing the target entity from the time sequence knowledge graph to serve as target knowledge of the target entity, and acquiring an answer to the target question by using the target knowledge of each target entity, the question relation information and the question time information.
5. The method of claim 4, wherein prior to said obtaining at least one piece of knowledge of an associated entity containing the target entity from the temporal knowledge-graph as the target knowledge of the target entity, the method further comprises:
determining the probability that the relation related to the target problem is a multi-hop relation based on the information of the plurality of problem elements;
the acquiring at least one piece of knowledge of an associated entity containing the target entity from the time-series knowledge graph as target knowledge of the target entity comprises:
selecting at least one piece of knowledge of an associated entity containing the target entity as target knowledge of the target entity based on the probability and a relationship graph representation of each relationship in the time-series knowledge graph;
and/or, the time-related information comprises a time-related entity related to the time; the determining of the question time information in the target question based on the time-related information includes:
classifying the time-related information to obtain inference time logic;
searching a knowledge entity of which the semantic representation is matched with the time-related entity in the time-sequence knowledge graph to serve as a time reference entity;
determining the problem time information based on the time in the knowledge containing the time reference entity and the inference time logic.
6. A method for representing entities in a time-series knowledge graph, comprising:
acquiring text representation and map representation of each knowledge in the time sequence knowledge map;
fusing the atlas representation and the text representation of each piece of knowledge to obtain a fused representation of the knowledge;
fusing the fused representation of the knowledge with the cosine coding of the time of the knowledge to obtain a new fused representation;
deriving a knowledge representation of the knowledge based on the new fused representation;
for each knowledge entity in the time-series knowledge graph, obtaining a semantic representation of the knowledge entity based on the knowledge representation of the plurality of pieces of knowledge comprising the knowledge entity, the knowledge comprising the knowledge entity and time.
7. A question-answering device based on a time-series knowledge graph, comprising:
the acquisition module is used for acquiring a target problem;
the searching module is used for searching the knowledge entities related to the target entities in the target problems by utilizing the semantic representation of each knowledge entity in the time sequence knowledge graph as associated entities; wherein the semantic representation of the knowledge entity is obtained by using a knowledge representation containing at least one piece of knowledge of the knowledge entity, the knowledge representation of the knowledge is obtained by fusing a new fusion representation based on a fusion representation of the knowledge and a cosine code of time of the knowledge, the fusion representation of the knowledge is obtained by fusing a graph representation and a text representation of the knowledge, and the knowledge contains the knowledge entity and time;
and the answer module is used for obtaining an answer of the target question based on at least one piece of knowledge of the associated entity contained in the time sequence knowledge graph.
8. An entity representation apparatus of a time-series knowledge graph, comprising:
the acquisition module is used for acquiring the text representation and the map representation of each piece of knowledge in the time sequence knowledge map;
the fusion module is used for fusing the map representation and the text representation of each piece of knowledge to obtain a fusion representation of the knowledge; fusing the fused representation of the knowledge with the cosine coding of the time of the knowledge to obtain a new fused representation; deriving a knowledge representation of the knowledge based on the new fused representation;
a representation module, configured to, for each knowledge entity in the time-series knowledge graph, obtain a semantic representation of the knowledge entity based on the knowledge representation of a plurality of pieces of knowledge including the knowledge entity, where the knowledge includes the knowledge entity and time.
9. An electronic device comprising a memory and a processor coupled to each other, the processor being configured to execute program instructions stored in the memory to implement the method of any one of claims 1 to 5 or claim 6.
10. A computer readable storage medium having stored thereon program instructions, characterized in that the program instructions, when executed by a processor, implement the method as claimed in any one of claims 1 to 5 or claim 6.
CN202211308301.1A 2022-10-25 2022-10-25 Question-answering method based on time sequence knowledge graph, entity representation method and related device Active CN115374296B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211308301.1A CN115374296B (en) 2022-10-25 2022-10-25 Question-answering method based on time sequence knowledge graph, entity representation method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211308301.1A CN115374296B (en) 2022-10-25 2022-10-25 Question-answering method based on time sequence knowledge graph, entity representation method and related device

Publications (2)

Publication Number Publication Date
CN115374296A CN115374296A (en) 2022-11-22
CN115374296B true CN115374296B (en) 2023-04-04

Family

ID=84073497

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211308301.1A Active CN115374296B (en) 2022-10-25 2022-10-25 Question-answering method based on time sequence knowledge graph, entity representation method and related device

Country Status (1)

Country Link
CN (1) CN115374296B (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112949312A (en) * 2021-03-26 2021-06-11 中国美术学院 Product knowledge fusion method and system
CN113822494B (en) * 2021-10-19 2022-07-22 平安科技(深圳)有限公司 Risk prediction method, device, equipment and storage medium
CN114706951A (en) * 2022-04-01 2022-07-05 中国人民解放军国防科技大学 Temporal knowledge graph question-answering method based on subgraph

Also Published As

Publication number Publication date
CN115374296A (en) 2022-11-22

Similar Documents

Publication Publication Date Title
CN109960810B (en) Entity alignment method and device
CN110472090B (en) Image retrieval method based on semantic tags, related device and storage medium
CN110597962B (en) Search result display method and device, medium and electronic equipment
CN109902301B (en) Deep neural network-based relationship reasoning method, device and equipment
CN110390363A (en) A kind of Image Description Methods
CN101369281A (en) Retrieval method based on video abstract metadata
CN116186359B (en) Integrated management method, system and storage medium for multi-source heterogeneous data of universities
CN111538825B (en) Knowledge question-answering method, device, system, equipment and storage medium
CN117149989A (en) Training method for large language model, text processing method and device
CN116881429B (en) Multi-tenant-based dialogue model interaction method, device and storage medium
CN111814759A (en) Method and device for acquiring face quality label value, server and storage medium
CN115238688A (en) Electronic information data association relation analysis method, device, equipment and storage medium
US20220114644A1 (en) Recommendation system with sparse feature encoding
CN111046213A (en) Knowledge base construction method based on image recognition
CN110209772A (en) A kind of text handling method, device, equipment and readable storage medium storing program for executing
CN115374296B (en) Question-answering method based on time sequence knowledge graph, entity representation method and related device
CN116595026A (en) Information inquiry method
CN113220737B (en) Data recommendation method and device, electronic equipment and storage medium
CN116049434A (en) Construction method and device of power construction safety knowledge graph and electronic equipment
CN108460475A (en) Poor student's prediction technique and device based on network playing by students behavior
CN115129849A (en) Method and device for acquiring topic representation and computer readable storage medium
CN114580533A (en) Method, apparatus, device, medium, and program product for training feature extraction model
CN112906367A (en) Information extraction structure, labeling method and identification method of consumer text
CN113822521A (en) Method and device for detecting quality of question library questions and storage medium
Li et al. Semantic prior-driven fused contextual transformation network for image inpainting

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant