[go: up one dir, main page]

CN111753094B - Method and device for constructing event knowledge graph and method and device for determining event - Google Patents

Method and device for constructing event knowledge graph and method and device for determining event Download PDF

Info

Publication number
CN111753094B
CN111753094B CN201910236491.2A CN201910236491A CN111753094B CN 111753094 B CN111753094 B CN 111753094B CN 201910236491 A CN201910236491 A CN 201910236491A CN 111753094 B CN111753094 B CN 111753094B
Authority
CN
China
Prior art keywords
event
target
node
events
represented
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
CN201910236491.2A
Other languages
Chinese (zh)
Other versions
CN111753094A (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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201910236491.2A priority Critical patent/CN111753094B/en
Publication of CN111753094A publication Critical patent/CN111753094A/en
Application granted granted Critical
Publication of CN111753094B publication Critical patent/CN111753094B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a method and a device for constructing an event knowledge graph and electronic equipment. The construction method comprises the following steps: acquiring a plurality of event information groups from a target information source; determining a plurality of target events of a map to be constructed from a plurality of sub events and father events; for each target event, searching a parent target event and a child target event of the target event from a plurality of target events based on father-son relations of each pair of the child event and the parent event, and obtaining a searching result corresponding to the target event; constructing an event knowledge graph about each target event based on the search result corresponding to each target event; each node of the event knowledge graph represents a target event, and a connecting line with a single arrow is arranged between any two nodes with father-son relations of the represented target event. Compared with the prior art, the method for constructing the event knowledge graph can construct the event knowledge graph capable of reflecting the relation of each event.

Description

Method and device for constructing event knowledge graph and method and device for determining event
Technical Field
The invention relates to the technical field of big data storage and calculation, in particular to a method and a device for constructing an event knowledge graph and a method and a device for determining an event.
Background
Currently, with the continuous development of artificial intelligence algorithms and big data technologies, it is expected that these technologies will bring more and more convenient experiences for human production and life. To achieve this goal, knowledge maps have been created that are based on massive amounts of data, giving the data a graph organization structure.
In many new application scenarios, such as event prediction and personalized recommendation in the financial domain as well as the consumer domain, users want to be able to obtain father-son relationships between events through knowledge maps to provide theoretical support for decisions. The event refers to an action that an object can take, or a state that an object can be in. And, the events are orderly happening, each event happening has a certain logic relationship with the last event, such as a compliance relationship, a causality relationship and the like. Thus, from one event, the events of interest to the user comprise two categories: a parent event (an event that triggers the event to occur, i.e., an upstream event) and a child event (an event that the event triggers, i.e., a downstream event) of the event. The interest of the parent event is "finding a clue of event occurrence", and the interest of the child event is "finding a result of event occurrence".
Therefore, how to construct an event knowledge graph capable of reflecting the relation of each event is a problem to be solved urgently.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for constructing an event knowledge graph, electronic equipment, and a method and a device for determining an event, and electronic equipment, so as to construct the event knowledge graph capable of reflecting the relation of each event. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for constructing an event knowledge graph, where the method includes:
obtaining a plurality of event information sets from a target information source, wherein each event information set comprises a pair of child events and a parent event;
determining a plurality of target events of a map to be constructed from the sub-events and the parent events included in the plurality of event information groups; wherein, the event content of different target event characterization is different;
for each target event, searching a parent target event and a child target event of the target event from a plurality of target events based on father-son relations of each pair of the child events and the parent event included in the plurality of event information groups, and obtaining a searching result corresponding to the target event;
Constructing an event knowledge graph about each target event based on the search result corresponding to each target event; the event knowledge graph comprises a plurality of nodes, each node is used for representing a target event, a connecting line with a single arrow is arranged between any two nodes with father-son relations of the represented target event, the single arrow of each connecting line points to the same target point, and the target points to: pointing from a parent target event to a child target event or pointing from a child target event to a parent target event.
In a second aspect, an embodiment of the present invention provides an event determining method, including:
acquiring first event content of a specified event;
searching a node with the event content of the represented target event as the first event content in the constructed event knowledge graph as a designated node; the event knowledge graph is constructed according to the knowledge graph construction method provided by the first aspect;
and determining a father target event and/or a son target event of the specified event based on a target connecting line in the event knowledge graph, wherein the target connecting line is a connecting line connected with the specified node.
In a third aspect, an embodiment of the present invention provides a device for constructing an event knowledge graph, where the device includes:
an event acquisition module for acquiring a plurality of event information groups from a target information source, wherein each event information group comprises a pair of sub events and a parent event;
the event determining module is used for determining a plurality of target events of the map to be constructed from the child events and the father events included in the event information groups; wherein, the event content of different target event characterization is different;
the result searching module is used for searching the father target event and the child target event of the target event from the plurality of target events based on the father-son relationship between each pair of the event and the father event included in the plurality of event information groups, and obtaining a searching result corresponding to the target event;
the map construction module is used for constructing an event knowledge map about each target event based on the search result corresponding to each target event; the event knowledge graph comprises a plurality of nodes, each node is used for representing a target event, a connecting line with a single arrow is arranged between any two nodes with father-son relations of the represented target event, the single arrow of each connecting line points to the same target point, and the target points to: pointing from a parent target event to a child target event or pointing from a child target event to a parent target event.
In a fourth aspect, an embodiment of the present invention provides an event determining apparatus, including:
the content acquisition module is used for acquiring the first event content of the specified event;
the node searching module is used for searching the node with the event content of the represented target event as the first event content in the constructed event knowledge graph as a designated node; the event knowledge graph is constructed according to the method for constructing the event knowledge graph provided by the first aspect;
and the target event determining module is used for determining a father target event and/or a child target event of the specified event based on target connecting lines in the event knowledge graph, wherein the target connecting lines are connecting lines connected with the specified node.
In a fifth aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any one of the method steps in the method for constructing the event knowledge graph provided in the first aspect when executing the program stored in the memory.
In a sixth aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor, configured to implement any of the method steps of the event determination method provided in the second aspect when executing a program stored in a memory.
In a seventh aspect, an embodiment of the present invention provides a computer readable storage medium, where a computer program is stored, where the computer program when executed by a processor implements any one of the method steps in the method for constructing an event knowledge graph provided in the first aspect.
In an eighth aspect, an embodiment of the present invention provides a computer readable storage medium having stored therein a computer program which, when executed by a processor, implements any of the method steps of an event determination method provided in the second aspect.
In the above, by applying the method for constructing the event knowledge graph provided by the embodiment of the invention, each target event can be represented by a node in the constructed event knowledge graph, a single-arrow connecting line is arranged between any two nodes representing the target event with a father-son relationship, and the father-son relationship of the target event represented by the two nodes is represented by the pointing direction of the connecting line, wherein the connecting line can point to a child target event from a father target event or point to a father target event from a child target event. Therefore, by applying the method for constructing the event knowledge graph provided by the embodiment of the invention, the event knowledge graph which can embody the relation of each event can be constructed.
In addition, by applying the event determination method provided by the embodiment of the invention, for a certain designated event, the father target event and/or the son target event of the designated event can be directly searched and determined through the constructed event knowledge graph comprising the node representing the designated event, and various information of an information source is not required to be analyzed and processed, so that the efficiency of determining the father target event and/or the son target event of the designated event can be improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a method for constructing an event knowledge graph according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an exemplary event knowledge graph;
FIG. 3 is a schematic diagram of an exemplary event knowledge graph;
FIG. 4 is a flow chart of one implementation of S102 in FIG. 1;
FIG. 5 is a flow chart of one implementation of S401 in FIG. 4;
FIG. 6 is a schematic diagram of an exemplary event knowledge graph;
FIG. 7 (a) is a schematic diagram of an exemplary knowledge-graph of events to be consolidated;
FIG. 7 (b) is a schematic diagram of another exemplary knowledge-graph of events to be consolidated;
FIG. 7 (c) is a schematic diagram of another exemplary knowledge-graph of events to be consolidated;
fig. 8 (a) is a schematic diagram of an obtained expansion map after merging the event knowledge maps to be merged shown in fig. 7 (a), 7 (b) and 7 (c), respectively;
fig. 8 (b) is a schematic diagram of an obtained expansion map with associated display of transition probability after the event knowledge maps to be combined shown in fig. 7 (a), 7 (b) and 7 (c) are combined;
FIG. 9 (a) is a schematic diagram of an event knowledge graph obtained by splitting the extended graph shown in FIG. 8 (a);
FIG. 9 (b) is a schematic diagram of another event knowledge graph obtained after splitting the extended graph shown in FIG. 8 (a);
fig. 10 is a flowchart of a method for determining an event according to an embodiment of the present invention;
FIG. 11 is an exemplary event knowledge graph with associated display of target attributes;
Fig. 12 is a schematic structural diagram of a device for constructing an event knowledge graph according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of an event determining apparatus according to an embodiment of the present invention;
fig. 14 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 15 is a schematic structural diagram of another electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Currently, in many new application scenarios, such as event prediction and personalized recommendation in the financial domain and the consumer domain, users want to provide theoretical support for decisions by acquiring parent-child relationships between events through event knowledge maps. Therefore, how to construct an event knowledge graph that can represent the relationship of each event is a problem to be solved. In order to solve the technical problems, the embodiment of the invention provides an event knowledge graph construction method.
The following describes a method for constructing an event knowledge graph provided by the embodiment of the invention.
Fig. 1 is a flow chart of a method for constructing an event knowledge graph according to an embodiment of the present invention. It should be noted that the method for constructing an event knowledge graph provided by the embodiment of the invention can be applied to any electronic device capable of performing information analysis and graph construction, such as a notebook computer, a tablet computer, a desktop computer, and the like. The embodiment of the present invention is not particularly limited, and hereinafter referred to as a first electronic device.
As shown in fig. 1, the method for constructing an event knowledge graph provided by the embodiment of the invention may include the following steps:
s101: a plurality of event information sets are obtained from a target information source,
wherein each event information group includes a pair of child events and parent events;
it will be appreciated that since events occur in an orderly fashion, each event may have a parent event that caused the event to occur and/or a child event that the event caused. Based on this, the first electronic device may obtain a plurality of event information sets including a pair of child events and a parent event from the target information source.
Specifically, each event information group includes two events, and the two events occur sequentially, that is, after one event occurs, the occurrence of the other event will be caused, and then the event that occurs before is called a parent event, and the event that occurs after is called a child event. That is, the notation of "parent" and "child" is to characterize the relationship between two events included in each event group. The nature of the parent and child events remains an event. For an event, the event can have the represented event content and also can have event labels, wherein the event labels are identification information of the event, and different events have different event labels; furthermore, for two events that characterize the same event content, the manner in which the two events are described for the event content may be different, and the event tags that the two events have may be different.
It should be noted that the target information source may be any information source preset for acquiring an event information group, where the target information source may be an information source for generating event information, for example, a network device where a user performs various operations on a network to generate user operation data; the information sources can also be information sources for recording and disclosing event information, such as web page news, various newspapers, business annual newspaper and the like. In the embodiment of the present invention, the number of the target information sources may be one or more, which is reasonable.
The first electronic device may execute the step S101 in a plurality of manners, which is not specifically limited in the embodiment of the present invention.
Optionally, in a specific implementation manner, after determining the target information source, the first electronic device may first determine whether the target information source provides structured event information, where the structured event information refers to: relationships between individual events expressed in the form of "event-relationship-event".
Obviously, when the judgment result is yes, the first electronic equipment can directly acquire a plurality of event information groups from the structured event information provided by the target information source;
And when the judgment result is negative, the first electronic equipment can extract a plurality of event information groups from the event information provided by the target information source by using an event information extraction algorithm. The first electronic device may extract a plurality of event information groups through a plurality of event information extraction algorithms.
Optionally, the first electronic device may extract the relationship among the upstream event, the downstream event and the upstream event by constructing a causal relationship word and a compliant relationship word library by using a pattern matching method, and then combine a Bootstrap algorithm to model the event and the event relationship by using a semi-supervised learning method, so that a plurality of event information sets are extracted from the event information provided by the target information source by using the established model.
S102: determining a plurality of target events of a map to be constructed from the child events and the parent events included in the plurality of event information groups;
wherein, the event content of different target event characterization is different;
after acquiring the plurality of event information sets, the first electronic device may determine a plurality of target events respectively characterizing different event contents of the map to be constructed from the child events and the parent events included in the plurality of event information sets.
After acquiring the plurality of event information groups, the first electronic device may acquire a parent event and a child event included in each event information group. I.e. the first electronic device may obtain a number of events, obviously twice the number of events obtained by the first electronic device as the number of event information sets obtained.
It will be appreciated that for an event, there may be a variety of situations in which the relationship between the event and other events. For example, the event is a parent event of a certain event, while the event is also a child event of another event; or, the event is a parent of some event; or, the event is a sub-event of some event; or, the event is a parent event of several events, while the event is also a child event of several other events.
Based on this, among the plurality of event information groups acquired by the first electronic device, there may be: some event information groups include events representing the same event content. That is, among the plurality of events obtained by the first electronic device, there may be: the content of the event characterized by some events is the same.
Because the events representing the same event content are identified by the same node in the event knowledge graph, the first electronic device needs to determine a plurality of target events of the graph to be constructed from the obtained plurality of events. Wherein the event content of the characterization of different target events is different, each target event is identified by a node of the event knowledge graph, and the number of the determined target events is not greater than the number of the obtained events.
Optionally, when the event contents represented by the plurality of events acquired by the first electronic device are different, the first electronic device may determine each event as a target event;
optionally, when at least one event characterizing the same event content exists among the plurality of events acquired by the first electronic device, the first electronic device may determine, for the at least one event, a target event identical to the event content characterized by the at least one event.
For example, event A1 and event B1 are included in event information group 1, and event A1 is a parent event of event B1; event information group 2 includes event C2 and event A2, and event C2 is a parent event of event A2; event information group 3 includes event B3 and event D3, and event B3 is a parent event of event D3; meanwhile, the event A1 and the event A2 represent the same event content, and the event content can be represented by the event A; event B1 and event B3 characterize the same event content, which may be characterized by event B. Obviously, event a is included in each of the event information group 1 and the event information group 2, event B is included in each of the event information group 2 and the event information group 3, event C2 is included in only the event information group 2, and event D3 is included in only the event information group 3. Thus, the first electronic device may determine a target event a, a target event B, a target event C2C, and a target event D3 for a total of 4 target events.
It should be noted that, the first electronic device may execute the step S102 in a plurality of manners, which is not specifically limited in the embodiment of the present invention. For clarity, the specific manner in which the first electronic device performs step S102 will be described later.
S103: for each target event, searching a parent target event and a child target event of the target event from a plurality of target events based on father-son relations of each pair of the child events and the parent event included in a plurality of event information groups, and obtaining a searching result corresponding to the target event;
after determining a plurality of target events of the map to be constructed, for each target event, the first electronic device may search for a parent target event and a child target event of the target event from the plurality of target events based on a parent-child relationship between each pair of child events and the parent event included in the plurality of event information sets, and further obtain a search result corresponding to the target event.
Because each event information group comprises father-son relations of each pair of sub-events and father events, and each target event is determined from the sub-events and the father events included in the event information groups, for each target event, an event information group corresponding to the target event can be determined in the event information groups, wherein the determined event information group comprises events with the same content as the event represented by the target event, and the other event in the determined event information group is the father event or the son event of the target event. And searching a target event with the same content as that of the other event in the determined multiple target events, wherein the searched target event is the father target event or the son target event of the target event. The searched target event can be used as a searching result corresponding to the target event.
Thus, the first electronic device can obtain the search result of each target event by traversing all the target events. Wherein for each target event, the target event may only have a parent target event; only sub-target events may also exist; there may also be both parent and child target events.
For example, event A1 and event B1 are included in event information group 1, and event A1 is a parent event of event B1; event information group 2 includes event C2 and event A2, and event C2 is a parent event of event A2; event information group 3 includes event B3 and event D3, and event B3 is a parent event of event D3; event information group 4 includes event C4 and event E4, and event C4 is a parent event of event E4; event A5 and event E5 are included in the event information group 5, and event A5 is a parent event of event E5. Meanwhile, the event A1, the event A2 and the event A5 represent the same event content, and the event content can be represented by the event a; event B1 and event B3 characterize the same event content, which may be characterized by event B; event C2 and event C4 characterize the same event, the event content can be characterized by event C; event E4 and event E5 characterize the same event, and the event content can be characterized by event E. Thus, the first electronic device may determine target event a, target event B, target event C, target event D3, and target event E.
The first electronic device may determine, based on the parent-child relationship of each pair of parent and child events in the event information sets 1-5: the search result of the target event A is as follows: the father target event is a target event C, and the child target event is a target event B and a target event E; the search result of the target event B is: the father target event is a target event A, and the child target event is a target event D3; the search result of the target event C is: the child target event is a target event A and a target event E without a father target event; the search result of the target event D3 is: the father target event is a target event B, and no child target event exists; the search result of the target event E is: the father target event is a target event A and a target event C, and no child target event exists.
S104: constructing an event knowledge graph about each target event based on the search result corresponding to each target event;
the event knowledge graph comprises a plurality of nodes, each node is used for representing a target event, a connecting line with a single arrow is arranged between any two nodes with father-son relations of the represented target event, the single arrow of each connecting line points to the same target point, and the target points are as follows: pointing from a parent target event to a child target event or pointing from a child target event to a parent target event.
After obtaining the search result corresponding to each target event, the first electronic device may construct an event knowledge graph about each target event based on the search result corresponding to each target event. The single arrow points of each connecting line in the constructed event knowledge graph are pointed to the same target, and the target points are as follows: pointing from a parent target event to a child target event or pointing from a child target event to a parent target event. That is, in the constructed event knowledge graph, the connecting lines with single arrows arranged between any two nodes with father-son relations of the represented target event are all directed from the father target event to the son target event or all directed from the son target event to the father target event. That is to say: in the same event knowledge graph, there cannot be a connection line from the parent target event to the child target event with a single arrow and a connection line from the child target event to the parent target event with a single arrow at the same time. Based on this, in the following description, the single-arrow orientations of the connection lines in the described knowledge-graph each represent the single-arrow orientation of each connection line in the knowledge-graph.
For example, the first electronic device determines: the search result of the target event A is as follows: the father target event is a target event C, and the child target event is a target event B and a target event E; the search result of the target event B is: the father target event is a target event A, and the child target event is a target event D3; the search result of the target event C is: the child target event is a target event A and a target event E without a father target event; the search result of the target event D3 is: the father target event is a target event B, and no child target event exists; the search result of the target event E is: the father target event is a target event A and a target event C, and no child target event exists. And the single arrow of each connecting line in the constructed event knowledge graph points to: pointing from a parent target event to a child target event.
The event knowledge graph constructed by the first electronic device about each target event is shown in fig. 2. Wherein node a represents a target event a, node B represents a target event B, node C represents a target event C, node D represents a target event D3, and node E represents a target event E. A connection line with a single arrow between two nodes points from a parent target event to a child target event in the target events characterized by the two nodes.
Obviously, according to the single arrow pointing of the connecting line in the constructed event knowledge graph, the user can conveniently and intuitively know the father target event or the son target event of a certain target event in the event knowledge graph along the arrow pointing of the connecting line. Taking fig. 2 as an example, for the target event a, the nodes B and E are pointed according to the connection line from the node a, so that the user can intuitively and conveniently obtain that the sub-target events of the target event a are the target event B and the target event E.
Further, for a connection line pointing to a node representing a certain target event, the user may start with an arrow of the connection line, and reversely push the node connected to the other end of the connection line along a direction opposite to the arrow, thereby determining a child target event or a parent target event of the target event.
It should be noted that, in order to be able to more intuitively and conveniently obtain the father target event and the child target event of a certain target event from the event knowledge graph, optionally, in a specific implementation manner, before step S104, the method for constructing an event knowledge graph according to the embodiment of the present invention may further include the following step A1:
step A1: for each target event, when the search result corresponding to the target event shows that the target event has a preset event, setting a target attribute for the target event,
the target attribute is an event tag of a preset event of the target event, and the preset event is a father target event or a son target event.
In this implementation manner, after obtaining the search result corresponding to each target event, for each target event, the search result corresponding to the target event may indicate whether the target event has a preset event, and when the search result indicates that the target event has a preset event, the first electronic device may set the event tag of the preset event as the target attribute of the target event.
Correspondingly, each node with the target attribute set for the target event represented in the event knowledge graph can be associated and displayed with the target attribute of the target event represented by the node.
Wherein, since the purpose of setting the target attribute for the target event is to facilitate the user to be able to more intuitively obtain the parent target event and the child target event of a certain target event at the same time from the event knowledge graph, when the single arrow of the connecting line in the set event knowledge graph points to: when pointing from the father target event to the child target event, the preset event set in the step A1 is the father target event; when the single arrow of the connecting line in the set event knowledge graph points to: when pointing from the child target event to the parent target event, the preset event set in the step A1 is the child target event.
For example, in each node in the event knowledge graph shown in fig. 2, the target attribute of the target event represented by the node is displayed in an associated manner, and the obtained new event knowledge graph is shown in fig. 3. Wherein, the target attribute is: parent target event.
Therefore, according to the single arrow pointing of the connecting line in the constructed event knowledge graph, the user can conveniently and intuitively know the father target event or the son target event of a certain target event in the event knowledge graph along the arrow pointing of the connecting line. Meanwhile, the node of the child target event or the father target event representing the target event can be obtained according to the target attribute of the node association display representing the target event, and then the child target event or the father target event of the target event is obtained.
Taking fig. 3 as an example, for the target event a, according to the connection line from the node a pointing to the node B and the node E, the user can intuitively and conveniently obtain that the sub-target events of the target event a are the target event B and the target event E. Meanwhile, the node a displays the target attribute C of the target event A in an associated mode, and a user can intuitively and conveniently know that the father target event of the target event A is the target event C.
In this implementation, in the event knowledge graph, a manner of simultaneously displaying a parent target event and a child target event of a target event by associating a target attribute displayed by a connection line having a single arrow with each node may be referred to as a bidirectional adjacency list storage structure.
In the above, by applying the method for constructing the event knowledge graph provided by the embodiment of the invention, each target event can be represented by a node in the constructed event knowledge graph, a single-arrow connecting line is arranged between any two nodes representing the target event with a father-son relationship, and the father-son relationship of the target event represented by the two nodes is represented by the pointing direction of the connecting line, wherein the connecting line can point to a child target event from a father target event or point to a father target event from a child target event. Thus, by applying the method for constructing the event knowledge graph provided by the embodiment of the invention, the event knowledge graph which can embody the relation of each event can be constructed.
The first electronic device executes the above step S102, and a manner of determining a plurality of target events of the map to be constructed from the sub-events and the parent events included in the plurality of event information sets is described by way of example.
Alternatively, in a specific implementation manner, as shown in fig. 4, the method may include the following steps:
s401: dividing each event representing the same event content in sub-events and parent events included in the event information groups into the same target group to obtain at least one target group,
wherein different target groups characterize different event content;
after the plurality of event information groups are acquired, the first electronic device can divide each event representing the same event content into the same target group in the sub event and the parent event included in the plurality of event information groups, so as to obtain at least one target group.
It may be understood that, in the sub-events and the parent events included in the plurality of event information groups obtained by the first electronic device, event contents represented by a certain number of events may be the same, and the events are events from different event information groups, where each event may be a parent event in an event information group where the event information group itself is located, or may be a sub-event in an event information group where the event information group itself is located.
Based on this, the first electronic device may divide each event characterizing the same event content into the same target group, resulting in at least one target group. Obviously, different target groups characterize different event content.
It should be noted that, the first electronic device may divide, in a plurality of ways, each event that characterizes the same event content into the same target group, where the events are included in the sub-event and the parent event included in the plurality of event information groups, which is not specifically limited in the embodiment of the present invention.
S402: for each target group, selecting a first event for representing the event content corresponding to the target group from the target group;
after obtaining at least one target group, for each target group, the first electronic device may select a first event from the target group for characterizing the event content corresponding to the target group. In this way, the first event can be used to represent each event in the target group, thereby realizing merging of each event characterizing the same event content into one event.
It should be noted that, the first electronic device may select one first event for characterizing the event content corresponding to each target group from each target group in a plurality of manners, which is not specifically limited in the embodiments of the present invention. For example, for each target group, the first electronic device may randomly extract an event from the target group as a first event for characterizing the content of the event corresponding to the target group. For another example, for each target group, the second electronic device may use the event with the largest number of words/words included in the target group as a first event for characterizing the content of the event corresponding to the target group. This is reasonable.
S403: determining the selected first event and at least one second event as a plurality of target events of the map to be constructed,
wherein the at least one second event is: and removing the events remained after the events contained in the plurality of target groups from the sub events and the parent events contained in the plurality of event information groups.
It is understood that at least one second event may also exist in the child event and the parent event included in the plurality of event information sets obtained by the first electronic device. Wherein, for each second event, there is no event content characterized by another event among the child events and the parent events included in the plurality of event information groups, which is the same as the event content characterized by the second event. That is, each second event cannot be scored into one target group with other events. Thus, the at least one second event is: and removing the events remained after the events contained in the plurality of target groups from the sub events and the parent events contained in the plurality of event information groups. Further, in the event knowledge graph, the at least one second event needs to be identified by using one node, respectively.
Thus, after obtaining the first event for characterizing the event content corresponding to each target group, the first electronic device may determine the selected first event and the at least one second event as a plurality of target events of the map to be constructed.
Next, the above step S401 is executed on the first electronic device, and the manner of dividing each event representing the same event content into the same target group from among the sub-events and the parent events included in the plurality of event information groups to obtain at least one target group is illustrated.
Optionally, in a specific implementation manner, as shown in fig. 5, the foregoing manner may include the following steps:
s501: for each initial event of a plurality of initial events, determining a feature vector of the initial event;
wherein, the plurality of initial events are: child events and parent events included in the plurality of event information groups;
after acquiring the plurality of event information sets, the first electronic device may use the child events and the parent events included in the plurality of event information sets as a plurality of initial events, and further, for each initial event, the first electronic device may determine a feature vector of the initial event.
Wherein the first electronic device may determine the feature vector for each initial event in a number of ways. Specific: and aiming at each initial event, acquiring each preset type of information in the event content represented by the initial event, and further converting the acquired information into a feature vector of the initial event. The information of each preset type may be: the event occurrence time, the event occurrence place, the event occurrence subject, the event occurrence object, and the like, and the embodiment of the present invention is not particularly limited. It should be noted that each dimension in the determined feature vector may correspond to each preset type.
S502: for every two initial events, calculating cosine angles of feature vectors of the two initial events, and judging whether the cosine angles are smaller than a preset angle threshold; if yes, execute S503;
s503: determining that the two initial events characterize the same target event;
further, after the feature vector of each initial vector is obtained, the first electronic device may calculate, for each two initial events, a cosine included angle of the feature vectors of the two initial events, and further determine whether the calculated cosine included angle is smaller than a preset included angle threshold. Thus, when the judgment result is yes, the first electronic device can determine that the two initial events represent the same target event.
The first electronic device may calculate cosine included angles of feature vectors of the two initial events according to the following formula:
wherein,and->The feature vectors of the two initial events respectively, the feature vector +.>Is the feature vector ++y ++>Cos θ is the calculated feature vector +.>And->Cosine included angle of (2).
It should be noted that, the preset included angle threshold may be any threshold set according to practical situations, which is not specifically limited in the embodiments of the present invention.
S504: dividing the determined initial event representing the same target event into the same target group to obtain at least one target group.
Thus, after traversing any two initial events in the plurality of initial events, the first electronic device may divide the determined initial events characterizing the same target event into the same target group, to obtain at least one target group.
It should be noted that, the above-mentioned cosine included angle based on the feature vector of the preliminary event may be referred to as event reduction.
As can be seen from the embodiment shown in fig. 4, the first electronic device divides a plurality of events representing the same event content into a target group from among the sub-events and the parent events included in the obtained plurality of event information groups, and obtains the first event by corresponding to the target group to represent each event in the target group.
Based on this, the first event may have a data attribute, where the data attribute may characterize a number of events included in a target group corresponding to the first event, so that the number may characterize an event having the same content as the first event in sub-events and parent events included in a plurality of event information groups obtained by the first electronic device.
Therefore, in an optional implementation manner, the method for constructing an event knowledge graph provided by the embodiment of the present invention may further include the following steps B1 to B4:
step B1: for each first event, taking the number of the events included in the target group corresponding to the first event as the data attribute of the first event;
step B2: setting the data attribute of each second event to 1 for the second event;
it will be appreciated that for each second event, there is no event content characterized by another event among the child events and parent events included in the plurality of event information sets, which is identical to the event content characterized by the second event. That is, among the plurality of events obtained by the first electronic device, the event of the event content characterized by each second event is characterized only by the second event. Thus, for each second event, the first electronic device may set the data attribute of the second event to 1.
It should be noted that the execution sequence of the steps B1 to B2 may be that the step B1 is executed first, then the step B2 is executed, or the steps B1 to B2 are executed simultaneously, which is reasonable.
Step B3: calculating transition probability between any two nodes with father-son relation for the target event represented by the event knowledge graph based on the data attribute of the target event represented by the two nodes;
wherein, the transition probability is: of two target events with father-son relationship represented by the two nodes, the father target event leads to the probability of child target event occurrence;
after obtaining the data attribute of each first event and each second event, the first electronic device can determine any two nodes with father-son relations of the target event represented in the constructed event knowledge graph because the father target event and the son target event of each event in the first event and the second event are determined. Furthermore, for any two determined nodes, the first electronic device may calculate a transition probability between the two nodes based on the data attributes of the target events represented by the two nodes, that is, calculate a probability that a parent target event causes a child target event to occur in two target events with a parent-child relationship represented by the two nodes.
Optionally, the manner in which the first electronic device performs the step B3 may be;
Determining a child target event and a father target event in two target events characterized by any two nodes with father-son relations in the event knowledge graph, and calculating a first ratio of the data attribute of the child target event to the data attribute of the father target event; calculating the sum value of the data attributes of all the sub-target events of the father target event, and calculating a second ratio of the data attributes of the sub-target event to the calculated sum value; the smaller value between the first ratio and the second ratio is taken as the transition probability between the two nodes.
For example, for the event knowledge graph shown in fig. 2, the data attribute of the target event represented by the node a is 3, the data attribute of the target event represented by the node b is 2, the data attribute of the target event represented by the node c is 2, the data attribute of the target event represented by the node d is 1, and the data attribute of the target event represented by the node e is 2.
The transition probabilities between the nodes c and a and between the nodes b and d are calculated using the above method, taking the nodes c and a and the nodes b and d as examples. Specific: since, in fig. 2, the connection line with a single arrow between two nodes points from the parent target event to the child target event in the target events represented by the two nodes, it can be determined that the target event represented by the node c is the parent target event and the target event represented by the node a is the child target event in the two target events represented by the node c and the node a. Further, the calculation result can be obtained: the first ratio is (3/2=) 1.5, and the value is (3+2=) 5, and the second ratio is (3/5=) 0.6, thereby determining that the transition probability of the node c and the node a is 0.6; the method can determine that the target event represented by the node b is a father target event and the target event represented by the node d is a child target event in two target events represented by the node b and the node d. Further, the calculation result can be obtained: the first ratio is (1/2=) 0.5 and the value is 1, and the second ratio is (1/1=) 1, whereby the transition probability between the node b and the node d is determined to be 0.5.
Step B4: aiming at a connecting line with a single arrow, which is arranged between any two nodes with father-son relations of the represented target event, in the event knowledge graph, the transition probability between the two nodes is displayed in an associated mode.
Therefore, after the transition probability between any two nodes with father-son relations of the represented target event in the event knowledge graph is calculated, the first electronic equipment can be used for displaying the transition probability between any two nodes with father-son relations of the represented target event in the event knowledge graph in an associated mode according to the connecting line with a single arrow arranged between any two nodes with father-son relations of the represented target event.
Optionally, for the data attribute of the first event and the second event determined in the steps B1 and B2, in the event knowledge graph, each node with the data attribute set on the represented target event may further display the data attribute of the target event represented by the node in an associated manner.
For example, for the event knowledge graph shown in fig. 2, each node in the event knowledge graph is associated with and displays the data attribute of the target event represented by the node; aiming at a connecting line with a single arrow arranged between any two nodes with father-son relations of a target event represented in an event knowledge graph, the transition probability between the two nodes is displayed in a correlation manner, and a new event knowledge graph is obtained and is shown in fig. 5.
In the description of the above step B3, the transition probability between the node c and the node a is calculated to be 0.6, and the transition probability between the node B and the node d is calculated to be 0.5; by such a push, the transition probability between the node c and the node e can be calculated to be 0.4; the transition probability between node a and node b is 0.5; the transition probability between node a and node e is 0.5.
It should be noted that, the steps B1 to B4 may be: after the step S104, the first electronic device perfects the event knowledge graph constructed in the step S104 by executing the steps B1 to B4; it may also be: steps B1-B3 are performed before step S104, step B4 is performed simultaneously with step S104, or step B4 is performed after step S104, i.e. the first electronic device may directly construct an event knowledge graph capable of associating display data attributes with transition probabilities. This is reasonable.
In addition, when the first electronic device determines the target event, other attributes of the target event, such as event occurrence time, event occurrence place, personnel or mechanism related to the event and the like, can be determined simultaneously, so that each node representing the target event can be related to and display the other attributes of the target event represented by the node in the event knowledge graph; the configuration file can also be set for each node, and various attribute information of the target event represented by the node can be stored in the configuration file, so that various attribute information about the target event represented by each node can be stored in the configuration file more abundantly.
Optionally, in a specific implementation manner of setting a configuration file for each node, when a user selects a certain node in the event knowledge graph, the configuration file corresponding to the node can be obtained through a designated operation on the node, for example, clicking, suspending a mouse cursor on the node, and further, various attributes of a target event represented by the node are read from the configuration file. Among the various attributes include, but are not limited to: target attributes and data attributes.
It should be noted that, in the embodiment of the present invention, after the first electronic device performs the step S104 to construct an event knowledge graph, the event knowledge graph is not unchanged, but may be expanded by combining with other event knowledge graphs.
For example, the first electronic device may acquire event information sets from a plurality of different target information sources, and then construct a plurality of event knowledge maps for each target information source, respectively, and in order to more completely reflect the relationship between events, the first electronic device may combine the plurality of event knowledge maps obtained by the construction.
It should be noted that, the manner of merging the plurality of event knowledge maps to be merged to obtain one expansion map may be performed on the first electronic device, where the first electronic device may locally construct the plurality of event knowledge maps to be merged, or may obtain the plurality of event knowledge maps to be merged from other electronic devices connected in a communication manner, which is reasonable. In addition, the method of combining the event knowledge graphs to be combined to obtain an expansion graph can also be performed on other electronic devices, and at this time, the first electronic device can send the event knowledge graph which is built by itself to the other electronic devices. Based on this, the embodiment of the present invention does not specifically limit the execution subject in a manner of merging a plurality of event knowledge maps to be merged to obtain one expansion map. In the following, a specific description will be given of a manner of merging a plurality of event knowledge maps to be merged to obtain an expansion map, taking a case that an execution subject is a first electronic device as an example.
Based on this, the method for constructing the event knowledge graph provided by the embodiment of the invention further comprises the following steps C1-C4:
step C1: determining a plurality of event knowledge maps to be combined;
it should be noted that, in the embodiment of the present invention, the specific number of event knowledge maps to be combined, the event information sources of the target events represented by each node, and the number of target events included in each event knowledge map to be combined are not limited. For example, the plurality of event knowledge maps to be combined may be event knowledge maps for a plurality of different target information sources, or may be a plurality of event knowledge maps for different event information of the same target data source, which is reasonable.
Step C2: determining a plurality of target nodes from a plurality of nodes included in the event knowledge maps;
wherein, the event content represented by different target nodes is different;
it can be understood that, among the plurality of nodes included in the plurality of event knowledge maps to be combined, there may be nodes located in different event knowledge maps and the content of the represented events is the same, and obviously, when the plurality of event knowledge maps to be combined are combined, the nodes may be combined into the same node. In addition, in the plurality of nodes included in the plurality of event knowledge maps to be combined, there may be event content represented by a certain node only represented by the node, that is, event content represented by any node except the node in the plurality of nodes included in the plurality of event knowledge maps to be combined is different from event content represented by the node, and obviously, the node is also determined as a target node.
In this way, after determining the plurality of event knowledge maps to be combined, the first electronic device may determine a plurality of target nodes from a plurality of nodes included in the plurality of event knowledge maps, where the event content represented by different target nodes is different.
For example, fig. 7 (a), fig. 7 (b) and fig. 7 (c) are three event knowledge graphs to be combined, where the event content represented by the node a1 in fig. 7 (a), the node a2 in fig. 7 (b) and the node a3 in fig. 7 (c) is the same, and it may be determined that the node a1, the node a2 and the node a3 correspond to the target node a0; the event content represented by the node b1 in fig. 7 (a) and the event content represented by the node b3 in fig. 7 (3) are the same, and then the target node b0 corresponding to the node b1 and the node b3 can be determined; if the event content represented by the node c1 in fig. 7 (a) and the event content represented by the node c2 in fig. 7 (b) are the same, it may be determined that the node c1 corresponds to the target node c0 of the node c 2; further, a target node d0 corresponding to the node d1 in fig. 7 (a), a target node e0 corresponding to the node e2 in fig. 7 (b), and a target node f0 corresponding to the node f1 in fig. 7 (c) may be determined.
Step C3: aiming at each target node, determining a first type target node and a second type target node of the target node from a plurality of target nodes based on a connection relation constructed by each node in the event knowledge maps through a connecting line with a single arrow, and obtaining a target result corresponding to the target node;
The target events represented by the first type of target nodes are as follows: a parent target event of the target event characterized by the target node; the second class of target nodes characterize the target events as: sub-target events of the target event characterized by the target node;
after determining a plurality of target nodes, determining a first type target node and a second type target node of each target node from the plurality of target nodes based on a connection relation constructed by each node in the plurality of event knowledge maps through a connecting line with a single arrow, and obtaining a target result corresponding to the target node.
Because the father target event and the son target event of the target event represented by each node are indicated by the pointing direction of the single arrow of the set connecting line in each event knowledge graph to be merged, for each target node, the same node as the event represented by the target node can be determined in a plurality of event knowledge graphs to be merged, and the node connected with the determined node is determined, and obviously, the target event represented by the connected node is the son target event or the father target event of the target event represented by the target node. Further, the target nodes corresponding to the connected nodes are the first type target nodes and the second type target nodes of the target nodes. Further, the target result of the target node can be obtained.
Based on the above, after determining a plurality of target nodes, for each target node, the first electronic device may determine, from the plurality of target nodes, a first type target node and a second type target node of the target node based on a connection relationship constructed by each node in the plurality of event knowledge maps through a connection line with a single arrow, and obtain a target result corresponding to the target node.
For example, the single arrows of the connecting lines in the event knowledge maps to be combined shown in fig. 7 (a), 7 (b) and 7 (c) respectively point to: pointing from a parent target event to a child target event. The target result of the determined target node a0 is: no first class target node exists, and the second class target nodes are b0 and c0; the target result of the determined target node b0 is: the first class of target nodes are a0, and the second class of target nodes are d0 and f0; the target result of the determined target node c0 is: the first class target node is a0, and the second class target node is e0; the target result of the determined target node d0 is: the first class target node is b0, and no second class target node exists; the target result of the determined target node e0 is: the first class target node is c0, and no second class target node exists; the target result of the determined target node f0 is: the first class of target nodes is b0, and no second class of target nodes exist.
Step C4: and constructing an expansion map about a plurality of target nodes based on the target result corresponding to each target node.
After obtaining the target result corresponding to each target node, the first electronic device may construct an expansion map related to the plurality of target nodes based on the target result corresponding to each target node.
For example, for the event knowledge graphs to be combined shown in fig. 7 (a), 7 (b) and 7 (c), respectively, the single arrow pointing of the connecting line in the constructed event knowledge graph is set as: the resulting expansion map is shown in fig. 8 (a) for pointing from the parent target event to the child target event.
According to the description of the method for constructing the event knowledge graph provided by the embodiment of the invention, it can be seen that in the constructed event knowledge graph, each node can be associated and displayed with the data attribute of the target event represented by the node. Based on this, in an optional specific implementation manner, in a plurality of nodes included in the plurality of event knowledge maps to be combined, each node is associated with and displays a data attribute of a target event represented by the node;
the method for combining the plurality of event knowledge maps to be combined to obtain an extended map may further include the following steps D1-D3:
Step D1: calculating target data attributes of the target events represented by each target node in the expansion map;
the first electronic device may calculate, through multiple calculation manners, a target data attribute of the target event represented by each target node in the expansion map based on the determined data attribute of the target event represented by each node in the multiple event knowledge maps to be combined. The embodiment of the present invention is not particularly limited in this regard.
Alternatively, the first calculation method: determining each node representing an event corresponding to the target node in a plurality of event knowledge maps aiming at each target node, and taking the sum of data attributes which are associatively displayed by each determined node as a target data attribute of the target event represented by the target node, wherein the event corresponding to the target node is a target event represented by the target node;
optionally, the second calculation mode: for each target node, determining each node representing an event corresponding to the target node in a plurality of event knowledge maps; calculating the product of the determined data attribute displayed in an associated mode of each node and the weight of the event knowledge graph to which the node belongs; and taking the calculated sum of the at least one product as a target data attribute of a target event characterized by the target node.
For example, in the event knowledge graph to be combined shown in fig. 7 (a), the data attribute of the target event represented by the node a1 is 2, the data attribute of the target event represented by the node b1 is 2, the data attribute of the target event represented by the node c1 is 1, and the data attribute of the target event represented by the node d1 is 1;
in the event knowledge graph to be combined shown in fig. 7 (b), the data attribute of the target event represented by the node a2 is 1, the data attribute of the target event represented by the node c2 is 2, and the data attribute of the target event represented by the node e2 is 1;
in the event knowledge graph to be combined shown in fig. 7 (c), the data attribute of the target event represented by the node a3 is 1, the data attribute of the target event represented by the node b3 is 2, and the data attribute of the target event represented by the node f3 is 1.
The weight of the event knowledge graph to be combined shown in fig. 7 (a) is 0.5, the weight of the event knowledge graph to be combined shown in fig. 7 (b) is 0.2, and the weight of the event knowledge graph to be combined shown in fig. 7 (c) is 0.3.
Then, in the expansion map shown in fig. 8 (a), the target data attribute of the target event represented by the target node a0 is (2+1+1=) 4, the target data attribute of the target event represented by the target node b0 is (2+2=) 4, the target data attribute of the target event represented by the target node c0 is (1+2=) 3, the target data attribute of the target event represented by the target node d0 is 1, the target data attribute of the target event represented by the target node e0 is 1, and the target data attribute of the target event represented by the target node f0 is 1.
Then, in the expansion map shown in fig. 8 (a), the target data attribute of the target event represented by the target node a0 is (2×0.5+1×0.2+1×0.3=) 1.5, the target data attribute of the target event represented by the target node b0 is (2×0.5+2×0.3=) 1.6, the target data attribute of the target event represented by the target node c0 is (1×0.5+2×0.2) =0.9, the target data attribute of the target event represented by the target node d0 is (1×0.5=) 0.5, the target data attribute of the target event represented by the target node e0 is (1×0.2=) 0.2, and the target data attribute of the target event represented by the target node f0 is (1×0.3=) 0.3.
Step D2: calculating transition probability between any two target nodes with father-son relations aiming at the target events represented by the expansion map based on the target data attribute of the target events represented by the two target nodes; wherein, the transition probability is: of two target events with father-son relationship characterized by the two target nodes, the father target event leads to the probability of child target event occurrence;
after calculating the target data attribute of the target event represented by each target node, the first electronic device can calculate the transition probability between the two target nodes according to the target data attribute of the target event represented by the two target nodes aiming at any two target nodes with father-son relations of the target event represented by the expansion map, so as to obtain the probability of occurrence of the father target event in the two target events with father-son relations represented by the two target nodes.
Alternatively, the first electronic device may execute the above step D2 in a similar manner to execute the above step B2, specifically:
aiming at any two target nodes with father-son relations of the target events represented by the expansion map, determining a child target event and a father target event in the two target events represented by the two target nodes, and calculating a third ratio of the data attribute of the child target event to the data attribute of the father target event; calculating the sum value of the data attributes of all the child target events of the father target event, and calculating the fourth ratio of the data attributes of the child target event to the calculated sum value; the smaller value between the third ratio and the fourth ratio is taken as the transition probability between the two target nodes.
Step D3: and aiming at a connecting line with a single arrow arranged between any two target nodes with father-son relations of the represented target events in the expansion map, the transition probability between the two target nodes is displayed in a correlation mode.
After the transition probability between any two target nodes with father-son relations of the represented target event in the expansion map is calculated, aiming at the connecting line with a single arrow arranged between any two target nodes with father-son relations of the represented target event in the expansion map, the first electronic equipment can display the transition probability between any two target nodes with father-son relations of the represented target event in the expansion map in a related mode.
For example, in the expansion map shown in fig. 8 (a), the target data attribute of the target event represented by the target node a0 is 4, the target data attribute of the target event represented by the target node b0 is 4, the target data attribute of the target event represented by the target node c0 is 3, the target data attribute of the target event represented by the target node d0 is 1, the target data attribute of the target event represented by the target node e0 is 1, and the target data attribute of the target event represented by the target node f0 is 1.
Then for the target node a0 and the target node b0, since the parent target event among the target events characterized by the two nodes points to the child target event due to the connection line with the single arrow between the two nodes in fig. 8 (a), it can be determined that the target event characterized by the target node a0 is the parent target event and the target event characterized by the target node b0 is the child target event among the two target events characterized by the target node a0 and the target node b 0. Further, the calculation result can be obtained: the third ratio is (4/4=) 1, the value is (4+3=) 7, the fourth ratio is (4/7=) 0.57, and the transition probability between the target node a0 and the target node b0 is determined to be 0.57; thus, by analogy, it is possible to calculate that the transition probability between the target node a0 and the target node c0 is 0.43, the transition probability between the target node b0 and the target node d0 is 0.25, the transition probability between the target node b0 and the target node f0 is 0.25, and the transition probability between the target node c0 and the target node e0 is 0.33.
Further, on a connection line with a single arrow arranged between any two target nodes with father-son relations of the target event represented by the expansion map shown in fig. 8 (a), the transition probability between the two target nodes is displayed in a correlated manner, and the expansion map shown in fig. 8 (b) is obtained.
Optionally, for the target data attribute of the target event represented by each target node in the expansion map obtained by calculation in the step D1, each target node in the expansion map, where the target event represented by the target node is provided with the target data attribute, may further display the target data attribute of the target event represented by the target node in an associated manner.
In the above description of the method for constructing an event knowledge graph provided by the embodiment of the present invention, the first electronic device or other electronic devices may combine a plurality of event knowledge graphs to be combined, so as to obtain an extended graph. In practical applications, the first electronic device or other electronic devices may split an event knowledge graph into multiple sub-event knowledge graphs, for example, the extended graph shown in fig. 8 (a) may be split into two sub-event knowledge graphs shown in fig. 9 (a) and 9 (b).
It can be seen that the extended spectrum shown in fig. 8 (a) is obtained by combining the three event knowledge maps to be combined shown in fig. 7 (a), 7 (b) and 7 (c), and the extended spectrum shown in fig. 8 (a) can be split into two sub-event knowledge maps shown in fig. 9 (a) and 9 (b). Therefore, the extended spectrum can be split into event knowledge maps different from the event knowledge maps to be combined, which correspond to the extended spectrum.
When the event knowledge graph is split into a plurality of sub-event knowledge graphs, when the transition probability between any two target nodes with father-son relations of the represented target event is displayed in association in the event knowledge graph, the transition probability is unchanged in the obtained plurality of sub-event knowledge graphs.
By applying the method for constructing the event knowledge graph provided by the embodiment of the invention, the constructed event knowledge graph can reflect father-son relations among all events and the probability of occurrence of the child event caused by the father event between each pair of father events and child events. Therefore, by using the event knowledge graph constructed by the method, a user can predict and infer the event of interest.
Thus, based on the method for constructing the event knowledge graph provided by the embodiment of the invention, the embodiment of the invention also provides an event determination method. The following describes an event determination method provided in the embodiment of the present invention.
Fig. 10 is a flowchart of an event determining method according to an embodiment of the present invention. It should be noted that the event determining method provided by the embodiment of the present invention may be applied to any electronic device capable of determining an event, for example, a notebook computer, a tablet computer, a desktop computer, etc. The embodiment of the present invention is not particularly limited, and hereinafter referred to as a second electronic device. The second electronic device may be the same electronic device as the first electronic device, that is, the first electronic device may continue to perform event determination after obtaining the event knowledge graph through construction; the second electronic device may also be an electronic device different from the first electronic device, that is, the first electronic device sends the constructed event knowledge graph to the second electronic device, so that the second electronic device may determine the event based on the received event knowledge graph.
As shown in fig. 10, a method for determining an event according to an embodiment of the present invention may include the following steps:
S1001: acquiring first event content of a specified event;
s1002: searching a node with the event content of the represented target event as the first event content in the constructed event knowledge graph as a designated node;
the event knowledge graph is constructed according to the method for constructing the event knowledge graph provided by the embodiment of the invention.
It will be appreciated that the description of the specified event acquired by the second electronic device may be different from the description of the target event characterized by the node in the event knowledge graph, so when the user needs to determine the relevant event about the specified event, the first event content of the specified event needs to be acquired first.
Further, as can be seen from the description of the method for constructing an event knowledge graph provided by the embodiment of the present invention, in the event knowledge graph, each target event is represented by a node. Based on the information, the second electronic device can search the node with the event content of the characterized target event being the first event content in the constructed event knowledge graph as the designated node. Obviously, the event content characterized by the designated node is identical to the first event content acquired by the second electronic device. That is, when the specified event is substituted into the event knowledge graph, the specified event can be characterized by the specified node.
The second electronic device may search for the specified node in the event knowledge graph in multiple manners, which is not specifically limited in the embodiment of the present invention.
Optionally, the second electronic device may first obtain vectors corresponding to the target event and the specified event represented by each node in the event knowledge graph, and further calculate a matching degree between the vector corresponding to the target event represented by each node and the vector corresponding to the specified event, and determine a node corresponding to the maximum matching degree as the specified node.
S1003: determining a father target event and/or a son target event of a specified event based on a target connecting line in the event knowledge graph;
the target connecting line is a connecting line connected with the appointed node.
After the designated node is found, the second electronic device can determine the connecting line connected with the designated node in the event knowledge graph, and take the connecting line as the target connecting line.
In the event knowledge graph, a connecting line with a single arrow is arranged between any two nodes with father-son relations of the represented target event, so that the second electronic device can determine that the target event represented by the node connected with the designated node through the target connecting line in the event knowledge graph is a father target event or a son target event of the designated event. In this way, the second electronic device may determine a parent target event and/or a child target event for the specified event based on the target connection lines in the event knowledge graph.
The second electronic device may perform the step S403 in various manners, and determine the parent target event and/or the child target event of the specified event, which is not specifically limited in this embodiment of the present invention.
Optionally, in a specific implementation manner, the step S403 may include the following steps E1-E2:
step E1: the single arrow of the connection line in the event knowledge graph points to: when pointing from a father target event to a child target event, determining a first connecting line pointing to a designated node in a target connecting line, and determining a target event represented by the connecting node at the other end of the first connecting line as a father target event of the designated event; determining a second connecting line except the first connecting line in the target connecting lines, and determining a target event represented by a connecting node at the other end of the second connecting line as a sub-target event of the designated event;
for example, in the event knowledge graph shown in fig. 2, the single arrow of the known connection line points to: from the parent target event to the child target event, it is assumed that the designated node is node a. Thus, the target connection line can be determined to be the connection line ca between the node c and the node a, the connection line ab between the node b and the node a, and the connection line ae between the node e and the node a.
Furthermore, since the connecting line ca is the connecting line pointing to the node a, it can be determined that the connecting line ca is the first connecting line, and further, if the node connected to the other end of the connecting line ca is the node c, the target event represented by the node c is the parent target event of the specified event; and the connection line ab and the connection line ae are determined to be second connection lines, the node connected with the other end of the connection line ab is the node b, the node connected with the other end of the connection line ae is the node e, and the target events represented by the node b and the node e are sub-target events of the appointed event.
Step E2: the single arrow of the connection line in the event knowledge graph points to: when pointing from the child target event to the father target event, determining a third connecting line pointing to a designated node in the target connecting line, and determining the target event represented by the connecting node at the other end of the third connecting line as the child target event of the designated event; determining a fourth connecting line except the third connecting line in the target connecting lines, and determining a target event represented by a connecting node at the other end of the fourth connecting line as a father target event of the designated event;
for example, in the event knowledge graph shown in fig. 2, it is assumed that the single arrow of the connection line points to: the direction from the child target event to the parent target event, and the designated node is node b. Thus, the target connection line can be determined as a connection line ab between the node a and the node b, and a connection line bd between the node b and the node d.
Furthermore, since the connection line ab is the connection line pointing to the node b, it can be determined that the connection line ab is a third connection line, and further, if the node connected to the other end of the connection line ab is the node a, the target event represented by the node a is a sub-target event of the specified event; the connection line bd is determined to be a fourth connection line, the node connected to the other end of the connection line bd is the node d, and the target events represented by the node d are all father target events of the designated event.
Optionally, in another specific implementation manner, each node in the event knowledge graph is associated with and displays a target attribute of a target event represented by the node;
thus, in this implementation, the step S403 may include the following steps F1-F2: :
step F1: when the preset event corresponding to the target attribute is a father target event of the target event represented by each node, determining the target event corresponding to the target attribute displayed in a correlated manner by the designated node as the father target event of the designated event; determining a fifth connecting line with a starting end as a designated node in the target connecting lines, and determining a target event represented by a node pointed by a single arrow of the fifth connecting line as a sub-target event of the designated event;
For example, in the event knowledge graph shown in fig. 3, if the target attribute is known as the event tag of the parent target event that the target event has, it is assumed that the designated node is node a. Thus, the target connection line can be determined to be the connection line ca between the node c and the node a, the connection line ab between the node b and the node a, and the connection line ae between the node e and the node a.
Furthermore, the father target event of the designated event can be determined to be the target event characterized by the node c through the target attribute displayed in an associated manner by the node a;
further, since the starting ends of the connection line ab and the connection line ae are the node a, it can be determined that the connection line ab and the connection line ae are the fifth connection line, and the target event represented by the node b pointed by the connection line ab and the target event represented by the node e pointed by the connection line ae are both sub-target events of the specified event.
Step F2: when the preset event corresponding to the target attribute is a sub-target event of the target event represented by each node, determining the target event corresponding to the target attribute displayed in an associated mode of the designated node as the sub-target event of the designated event; and determining a sixth connecting line with the starting end of the target connecting line being a designated node, and determining a target event represented by the node pointed by a single arrow of the sixth connecting line as a father target event of the designated event.
For example, in the event knowledge graph shown in fig. 11, if the target attribute is known as the event tag of the sub-target event that the target event has, it is assumed that the designated node is node b. Thus, the target connection line can be determined as a connection line ab between the node a and the node b, and a connection line bd between the node b and the node d.
Furthermore, the sub-target event of the designated event can be determined to be the target event characterized by the node a through the target attribute displayed in an associated manner by the node b;
further, since the starting end of the connection line bd is the node b, it can be determined that the connection line bd is the sixth connection line, and the target event represented by the node d pointed to by the connection line bd is the parent target event of the specified event.
In addition, according to the description of the method for constructing the event knowledge graph provided by the embodiment of the invention, it can be seen that the probability that the parent target event causes the child target event in the two target events with the parent-child relationship, which are characterized by the two nodes, can be represented by connecting lines with single arrows, which are arranged between any two nodes with the parent-child relationship, in the event knowledge graph, and displaying the transition probability between the two nodes in an associated manner.
Therefore, optionally, in a specific implementation manner, in the constructed event knowledge graph, a connecting line with a single arrow is set between any two nodes with father-son relationship of the represented target event, and the transition probability between the two nodes is displayed in an associated manner; wherein, the transition probability is: of two target events with father-son relationship represented by the two nodes, the father target event leads to the probability of child target event occurrence;
in this implementation manner, the event determining method provided in the embodiment of the present invention further includes the following steps G1-G2:
step G1: the single arrow of the connection line in the event knowledge graph points to: when pointing from a father target event to a child target event, determining a seventh connecting line pointed to a designated node in a target connecting line, and determining the transition probability of the seventh connecting line in an associated display manner as the probability that the designated event occurs due to the target event represented by the connecting node of the other point of the seventh connecting line; determining an eighth connecting line except the seventh connecting line in the target connecting lines, and determining the transition probability of the associated display of the eighth connecting line as the probability of the occurrence of the target event represented by the connecting node at the other end of the eighth connecting line caused by the designated event;
For example, in the event knowledge graph shown in fig. 5, the single arrow of the known connecting line points to: from the direction of the parent target event to the child target event, it is assumed that the designated node is node a, and thus, the target connection line can be determined as connection line ca between node c and node a, connection line ab between node b and node a, and connection line ae between node e and node a.
Furthermore, since the connecting line ca is the connecting line pointing to the node a, the connecting line ca can be determined to be a seventh connecting line, and further, the node connected to the other end of the connecting line ca is the node c, the target event represented by the node c is the father target event of the specified event, and the transition probability of the connecting line ca in an associated display is 0.6, which is the probability that the specified event occurs due to the target event represented by the node c; in this way, if the connection line ab and the connection line ae are determined as eighth connection lines, the target events represented by the node b and the node e are sub-target events of the specified event, the transition probability displayed by the connection line ab in an associated manner is 0.5, the probability of occurrence of the target event represented by the node b is caused by the specified event, the transition probability displayed by the connection line ae in an associated manner is 0.5, and the probability of occurrence of the target event represented by the node e is caused by the specified event.
Step G1: the single arrow of the connection line in the event knowledge graph points to: when pointing from the child target event to the father target event, determining a ninth connecting line pointed to a designated node in the target connecting line, and determining the transition probability of the associated display of the ninth connecting line as the probability that the designated event causes the target event represented by the connecting node at the other point of the ninth connecting line; and determining a tenth connecting line except for the ninth connecting line in the target connecting lines, and determining the transition probability of the associated display of the tenth connecting line as the probability that the target event represented by the connecting node at the other end of the tenth connecting line leads to the occurrence of the designated event.
For example, in the event knowledge graph shown in fig. 5, it is assumed that the single arrow of the connection line points to: the direction from the child target event to the parent target event, and assume that the designated node is node b. Thus, the target connection line can be determined as a connection line ab between the node a and the node b, and a connection line bd between the node b and the node d.
Furthermore, since the connection line ab is the connection line pointing to the node b, it can be determined that the connection line ab is a ninth connection line, and further, the target event represented by the node a is a sub-target event of the specified event, the transition probability of the connection line ab in association display is 0.5, which is the probability that the event represented by the node a occurs due to the specified event; in this way, the connection line bd is determined as the tenth connection line, the target events represented by the node d are all father target events of the specified event, and the transition probability of the connection line bd in an associated display is 0.5, so that the probability of the occurrence of the specified event is caused by the target events represented by the node d.
It should be noted that, in this implementation, the second electronic device may determine not only a probability that the parent target event of the specified event results in the occurrence of the specified event, but also a probability that the specified event results in the occurrence of the child target event of the specified event. It is also possible to determine the probability that a previously occurring target event, of two target events connected by multiple parent-child relationships, results in a later occurring target event.
For example, in the event knowledge graph shown in fig. 5, the single arrow of the known connecting line points to: from the direction from the parent target event to the child target event, it can be seen that the target event represented by the node d is connected with the target event represented by the node c through multiple parent-child relationships, specifically, the parent target event of the target event represented by the node d is the target event represented by the node b, the parent target event of the target event represented by the node b is the target event represented by the node a, the parent target event of the target event represented by the node a is the target event represented by the node c, the target event represented by the node c is the target event occurring in advance, and the target event represented by the node d is the target event occurring later. Further, it may be determined that the probability that the target event characterized by the node c results in the target event characterized by the node d being 0.6×0.5×0.5=0.15.
As can be seen from the above, by applying the event determining method provided by the embodiment of the present invention, for a specific event, as the parent target event and/or the child target event of the specific event can be directly found and determined through the constructed event knowledge graph including the node representing the specific event, various information of the information source does not need to be analyzed and processed, so that the efficiency of determining the parent target event and/or the child target event of the specific event can be improved.
Corresponding to the method for constructing the event knowledge graph provided by the embodiment of the invention, the embodiment of the invention provides a device for constructing the event knowledge graph. Fig. 12 is a schematic structural diagram of a device for constructing an event knowledge graph according to an embodiment of the present invention, where, as shown in fig. 12, the device may include the following modules:
an event acquisition module 1210 for acquiring a plurality of event information groups from a target information source, wherein each event information group includes a pair of child events and a parent event;
an event determining module 1220 for determining a plurality of target events to be mapped from among child events and parent events included in the plurality of event information sets; wherein, the event content of different target event characterization is different;
The result searching module 1230 is configured to search, for each target event, for a parent target event and a child target event of the target event from a plurality of target events based on parent-child relationships between each pair of events and the parent event included in the plurality of event information groups, to obtain a search result corresponding to the target event;
a graph construction module 1240, configured to construct an event knowledge graph about each target event based on the search result corresponding to each target event; the event knowledge graph comprises a plurality of nodes, each node is used for representing a target event, a connecting line with a single arrow is arranged between any two nodes with father-son relations of the represented target event, the single arrow of each connecting line points to the same target point, and the target points are as follows: pointing from a parent target event to a child target event or pointing from a child target event to a parent target event.
In the above, by applying the method for constructing the event knowledge graph provided by the embodiment of the invention, each target event can be represented by a node in the constructed event knowledge graph, a single-arrow connecting line is arranged between any two nodes representing the target event with a father-son relationship, and the father-son relationship of the target event represented by the two nodes is represented by the pointing direction of the connecting line, wherein the connecting line can point to a child target event from a father target event or point to a father target event from a child target event. Thus, by applying the method for constructing the event knowledge graph provided by the embodiment of the invention, the event knowledge graph which can embody the relation of each event can be constructed.
Optionally, in a specific implementation manner, the event determining module 1220 may include:
the event dividing sub-module is used for dividing each event representing the same event content into the same target group in the sub-event and the father event included in the event information groups to obtain at least one target group, wherein different target groups represent different event contents;
the event selection sub-module is used for selecting a first event for representing the event content corresponding to each target group from the target group;
an event determination submodule, configured to determine the selected first event and at least one second event as a plurality of target events of a map to be constructed, where the at least one second event is: and removing the events remained after the events contained in the plurality of target groups from the sub events and the parent events contained in the plurality of event information groups.
Optionally, in a specific implementation manner, the apparatus may further include:
the target attribute setting module is used for setting target attributes for each target event when the search result corresponding to the target event indicates that the target event has a preset event according to the search result corresponding to each target event before an event knowledge graph related to each target event is constructed, wherein the target attributes are event labels of preset events of the target event, and the preset events are father target events or child target events;
In a corresponding manner,
each node in the event knowledge graph, wherein the target event represented by the node is provided with the target attribute, and the target attribute of the target event represented by the node is displayed in an associated mode.
Optionally, in a specific implementation manner, the event dividing sub-module may include:
a vector determination unit configured to determine, for each of a plurality of initial events, a feature vector of the initial event; wherein, the plurality of initial events are: child events and parent events included in the plurality of event information groups;
the threshold value judging unit is used for calculating cosine included angles of feature vectors of each two initial events aiming at each two initial events and judging whether the cosine included angles are smaller than a preset included angle threshold value or not; if yes, triggering an event determining unit;
the event determining unit is used for determining that the two initial events represent the same target event;
the event dividing unit is used for dividing the determined initial event representing the same target event into the same target group to obtain at least one target group.
Optionally, in a specific implementation manner, the apparatus may further include:
the data attribute determining module is used for regarding the number of the events included in the target group corresponding to each first event as the data attribute of the first event;
A data attribute setting module, configured to set, for each second event, a data attribute of the second event to 1;
the probability calculation module is used for calculating the transition probability between any two nodes with father-son relations aiming at the target event represented in the event knowledge graph based on the data attribute of the target event represented by the two nodes; wherein, the transition probability is: of two target events with father-son relationship represented by the two nodes, the father target event leads to the probability of child target event occurrence;
the data display module is used for displaying the transition probability between any two nodes with a single arrow arranged between any two nodes with father-son relations of the represented target event in an event knowledge graph in an associated mode.
Optionally, in a specific implementation manner, the probability calculation module may be specifically configured to:
determining a child target event and a father target event in two target events characterized by any two nodes with father-son relations in the event knowledge graph, and calculating a first ratio of the data attribute of the child target event to the data attribute of the father target event; calculating the sum value of the data attributes of all the sub-target events of the father target event, and calculating a second ratio of the data attributes of the sub-target event to the calculated sum value; the smaller value between the first ratio and the second ratio is taken as the transition probability between the two nodes.
Optionally, in a specific implementation manner, the apparatus may further include:
the map determining module is used for determining a plurality of event knowledge maps to be combined;
the node determining module is used for determining a plurality of target nodes from a plurality of nodes included in the event knowledge maps; wherein, the event content represented by different target nodes is different;
the target node determining module is used for determining a first type target node and a second type target node of each target node from a plurality of target nodes based on the connection relation constructed by the nodes in the event knowledge maps through the connecting lines with single arrows, and obtaining a target result corresponding to the target node; the target events represented by the first type of target nodes are as follows: a parent target event of the target event characterized by the target node; the second class of target nodes characterize the target events as: sub-target events of the target event characterized by the target node;
and the map expansion module is used for constructing expansion maps of a plurality of target nodes based on target results corresponding to each target node.
Optionally, in a specific implementation manner, each node is associated with and displays a data attribute of a target event represented by the node in a plurality of nodes included in the plurality of event knowledge maps;
Thus, the apparatus may further comprise:
the data attribute calculation module is used for calculating the target data attribute of the target event represented by each target node in the expansion map;
the transition probability calculation module is used for calculating the transition probability between any two target nodes with father-son relations aiming at the target events represented in the expansion map based on the target data attribute of the target events represented by the two target nodes; wherein, the transition probability is: of two target events with father-son relationship characterized by the two target nodes, the father target event leads to the probability of child target event occurrence;
the transition probability display module is used for displaying the transition probability between any two target nodes with a father-son relationship aiming at the target event represented in the expansion map, wherein the connecting line is provided with a single arrow and is arranged between the two target nodes.
Optionally, in a specific implementation manner, the data attribute calculating module may be specifically configured to:
determining each node representing an event corresponding to the target node in a plurality of event knowledge maps aiming at each target node, and taking the sum of data attributes which are associatively displayed by each determined node as a target data attribute of the target event represented by the target node, wherein the event corresponding to the target node is a target event represented by the target node; or alternatively, the first and second heat exchangers may be,
For each target node, determining each node representing an event corresponding to the target node in a plurality of event knowledge maps; calculating the product of the determined data attribute displayed in an associated mode of each node and the weight of the event knowledge graph to which the node belongs; and taking the calculated sum of the at least one product as a target data attribute of a target event characterized by the target node.
Corresponding to the event determining method provided by the embodiment of the invention, the embodiment of the invention also provides an event determining device. Fig. 13 is a schematic structural diagram of an event determining apparatus according to an embodiment of the present invention, as shown in fig. 13, the apparatus may include the following modules:
a content acquisition module 1310 for acquiring a first event content of a specified event;
the node searching module 1320 is configured to search, in the constructed event knowledge graph, a node whose event content is the first event content of the characterized target event as a designated node; the event knowledge graph is constructed according to the method for constructing the event knowledge graph provided by the embodiment of the invention.
The target event determining module 1330 is configured to determine a parent target event and/or a child target event of the specified event based on a target connection line in the event knowledge graph, where the target connection line is a connection line connected to the specified node.
As can be seen from the above, by applying the event determining method provided by the embodiment of the present invention, for a specific event, as the parent target event and/or the child target event of the specific event can be directly found and determined through the constructed event knowledge graph including the node representing the specific event, various information of the information source does not need to be analyzed and processed, so that the efficiency of determining the parent target event and/or the child target event of the specific event can be improved.
Optionally, in a specific implementation manner, the target event determining module 1330 may include:
the first determining module is used for determining that when a single arrow of a connecting line in the event knowledge graph points to: when pointing from a father target event to a child target event, determining a first connecting line pointing to a designated node in a target connecting line, and determining a target event represented by the connecting node at the other end of the first connecting line as a father target event of the designated event; determining a second connecting line except the first connecting line in the target connecting lines, and determining a target event represented by a connecting node at the other end of the second connecting line as a sub-target event of the designated event;
the second determining module is configured to, when a single arrow of the connection line in the event knowledge graph points to: when pointing from the child target event to the father target event, determining a third connecting line pointing to a designated node in the target connecting line, and determining the target event represented by the connecting node at the other end of the third connecting line as the child target event of the designated event; determining a fourth connecting line except the third connecting line in the target connecting lines, and determining a target event represented by a connecting node at the other end of the fourth connecting line as a father target event of the designated event;
Optionally, in a specific implementation manner, each node in the event knowledge graph is associated with and displays a target attribute of a target event represented by the node;
thus, the target event determination module 1330 described above may be specifically configured to:
when the preset event corresponding to the target attribute is a father target event of the target event represented by each node, determining the target event corresponding to the target attribute displayed in a correlated manner by the designated node as the father target event of the designated event; determining a fifth connecting line with a starting end as a designated node in the target connecting lines, and determining a target event represented by a node pointed by a single arrow of the fifth connecting line as a sub-target event of the designated event;
when the preset event corresponding to the target attribute is a sub-target event of the target event represented by each node, determining the target event corresponding to the target attribute displayed in an associated mode of the designated node as the sub-target event of the designated event; and determining a sixth connecting line with the starting end of the target connecting line being a designated node, and determining a target event represented by the node pointed by a single arrow of the sixth connecting line as a father target event of the designated event.
Optionally, in a specific implementation manner, in the event knowledge graph, a connecting line with a single arrow is arranged between any two nodes with father-son relationships of the represented target event, and the transition probability between the two nodes is displayed in an associated manner; wherein, the transition probability is: of two target events with father-son relationship represented by the two nodes, the father target event leads to the probability of child target event occurrence;
Thus, the apparatus may further comprise:
the first probability determining module is used for determining that when a single arrow of a connecting line in the event knowledge graph points to: when pointing from a father target event to a child target event, determining a seventh connecting line pointed to a designated node in a target connecting line, and determining the transition probability of the seventh connecting line in an associated display manner as the probability that the designated event occurs due to the target event represented by the connecting node of the other point of the seventh connecting line; determining an eighth connecting line except the seventh connecting line in the target connecting lines, and determining the transition probability of the associated display of the eighth connecting line as the probability of the occurrence of the target event represented by the connecting node at the other end of the eighth connecting line caused by the designated event;
the second probability determining module is used for determining that when the single arrow of the connecting line in the event knowledge graph points to: when pointing from the child target event to the father target event, determining a ninth connecting line pointed to a designated node in the target connecting line, and determining the transition probability of the associated display of the ninth connecting line as the probability that the designated event causes the target event represented by the connecting node at the other point of the ninth connecting line; and determining a tenth connecting line except for the ninth connecting line in the target connecting lines, and determining the transition probability of the associated display of the tenth connecting line as the probability that the target event represented by the connecting node at the other end of the tenth connecting line leads to the occurrence of the designated event.
Corresponding to the method for constructing an event knowledge graph provided by the embodiment of the present invention, the embodiment of the present invention further provides an electronic device, as shown in fig. 14, including a processor 1401, a communication interface 1402, a memory 1403 and a communication bus 1404, where the processor 1401, the communication interface 1402 and the memory 1403 complete communication with each other through the communication bus 1404,
a memory 1403 for storing a computer program;
the processor 1401 is configured to implement the method for constructing an event knowledge graph according to the embodiment of the present invention when executing the program stored in the memory 1403.
Corresponding to the event determining method provided by the embodiment of the present invention, the embodiment of the present invention further provides an electronic device, as shown in fig. 15, including a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, where the processor 1501, the communication interface 1502 and the memory 1503 complete communication with each other through the communication bus 1504,
a memory 1503 for storing a computer program;
the processor 1501 is configured to implement the event determination method provided in the embodiment of the present invention when executing the program stored in the memory 1503.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
Corresponding to the method for constructing an event knowledge graph provided by the embodiment of the invention, the embodiment of the invention also provides a computer readable storage medium, and the method for constructing the event knowledge graph provided by the embodiment of the invention is realized when the computer program is executed by a processor.
Corresponding to the event determining method provided in the above embodiment of the present invention, the embodiment of the present invention further provides a computer readable storage medium, where the computer program implements the event determining method provided in the above embodiment of the present invention when executed by a processor.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the apparatus embodiments, the electronic device embodiments, the computer-readable storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the section of the method embodiments for relevance.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (16)

1. The method for constructing the event knowledge graph is characterized by comprising the following steps:
obtaining a plurality of event information sets from a target information source, wherein each event information set comprises a pair of child events and a parent event;
determining a plurality of target events of a map to be constructed from the sub-events and the parent events included in the plurality of event information groups; wherein, the event content of different target event characterization is different;
For each target event, searching a parent target event and a child target event of the target event from a plurality of target events based on father-son relations of each pair of the child events and the parent event included in the plurality of event information groups, and obtaining a searching result corresponding to the target event;
constructing an event knowledge graph about each target event based on the search result corresponding to each target event; the event knowledge graph comprises a plurality of nodes, each node is used for representing a target event, a connecting line with a single arrow is arranged between any two nodes with father-son relations of the represented target event, the single arrow of each connecting line points to the same target point, and the target points to: pointing from a parent target event to a child target event or pointing from a child target event to a parent target event;
wherein the obtaining a plurality of event information sets from the target information source includes:
determining a target information source; the target information source is network equipment for generating operation data; judging whether the target information source provides structured event information or not; the structured event information includes: relationships between individual events expressed by the form of event-relationship-events; when the judgment result is yes, acquiring a plurality of event information groups from the structured event information provided by the target information source; when the judgment result is negative, extracting a plurality of event information groups from event information provided by the target information source by using an event information extraction algorithm;
The step of determining a plurality of target events of the map to be constructed from the child events and the parent events included in the plurality of event information sets includes:
dividing each event representing the same event content into the same target group in the sub event and the father event included in the event information groups to obtain at least one target group, wherein different target groups represent different event contents;
for each target group, selecting a first event for representing the event content corresponding to the target group from the target group;
determining the selected first event and at least one second event as a plurality of target events of a map to be constructed, wherein the at least one second event is: and removing the events remained after the events contained in the target groups from the sub events and the parent events contained in the event information groups.
2. The method according to claim 1, wherein before the step of constructing an event knowledge base for each target event based on the search result corresponding to each target event, the method comprises:
aiming at each target event, when a search result corresponding to the target event shows that the target event has a preset event, setting a target attribute for the target event, wherein the target attribute is an event tag of the preset event of the target event, and the preset event is a father target event or a son target event;
In a corresponding manner,
and each node with the target attribute set for the target event represented in the event knowledge graph is associated and displayed with the target attribute of the target event represented by the node.
3. The method according to claim 1, wherein the step of dividing each event characterizing the same event content among the child events and the parent events included in the plurality of event information groups into the same target group to obtain at least one target group includes:
for each initial event of a plurality of initial events, determining a feature vector of the initial event; wherein the plurality of initial events are: child events and parent events included in the plurality of event information groups;
for every two initial events, calculating cosine included angles of feature vectors of the two initial events, and judging whether the cosine included angles are smaller than a preset included angle threshold value or not;
if yes, determining that the two initial events represent the same target event;
dividing the determined initial event representing the same target event into the same target group to obtain at least one target group.
4. The method according to claim 1, wherein the method further comprises:
for each first event, taking the number of the events included in the target group corresponding to the first event as the data attribute of the first event;
Setting the data attribute of each second event to 1 for the second event;
calculating transition probability between any two nodes with father-son relations aiming at the target event represented in the event knowledge graph based on the data attribute of the target event represented by the two nodes; wherein, the transition probability is: of two target events with father-son relationship represented by the two nodes, the father target event leads to the probability of child target event occurrence;
aiming at each node with the data attribute set in the represented target event in the event knowledge graph, the data attribute of the target event represented by the node is displayed in an associated mode; the represented target event has a connecting line with a single arrow arranged between any two nodes with father-son relations, and the connection shows the transition probability between the two nodes.
5. The method according to claim 4, wherein the step of calculating the transition probability between any two nodes of the event knowledge graph with parent-child relationships for the target event characterized by the two nodes based on the data attributes of the target event characterized by the two nodes comprises:
Determining a child target event and a father target event in two target events characterized by two nodes according to any two nodes with father-son relations of the target events characterized by the event knowledge graph, and calculating a first ratio of the data attribute of the child target event to the data attribute of the father target event; calculating the sum value of the data attributes of all the sub-target events of the father target event, and calculating a second ratio of the data attributes of the sub-target event to the calculated sum value; the smaller value between the first ratio and the second ratio is taken as the transition probability between the two nodes.
6. The method according to claim 1, wherein the method further comprises:
determining a plurality of event knowledge maps to be combined;
determining a plurality of target nodes from a plurality of nodes included in the event knowledge maps; wherein, the event content represented by different target nodes is different;
aiming at each target node, determining a first type target node and a second type target node of the target node from the plurality of target nodes based on the connection relation constructed by the nodes in the event knowledge maps through the connecting lines with single arrows, and obtaining a target result corresponding to the target node; wherein, the target event represented by the first type of target node is: a parent target event of the target event characterized by the target node; the target events represented by the second class of target nodes are as follows: sub-target events of the target event characterized by the target node;
And constructing an expansion map about the plurality of target nodes based on the target result corresponding to each target node.
7. The method of claim 6, wherein the plurality of event knowledge maps comprise a plurality of nodes, each node being associated with a data attribute that displays a target event characterized by the node;
the method further comprises the steps of:
calculating target data attributes of target events represented by each target node in the expansion map;
calculating the transition probability between any two target nodes with father-son relations aiming at the target events represented in the expansion map based on the target data attribute of the target events represented by the two target nodes; wherein, the transition probability is: of two target events with father-son relationship characterized by the two target nodes, the father target event leads to the probability of child target event occurrence;
and aiming at a connecting line with a single arrow arranged between any two target nodes with father-son relations of the represented target event in the expansion map, displaying the transition probability between the two target nodes in a correlation way.
8. The method of claim 7, wherein the step of calculating the target data attributes of the target events characterized by each target node in the extended graph comprises:
Determining each node representing an event corresponding to the target node in the plurality of event knowledge maps aiming at each target node, and taking the sum of the data attributes which are associatively displayed by each determined node as a target data attribute of the target event represented by the target node, wherein the event corresponding to the target node is the target event represented by the target node; or alternatively, the first and second heat exchangers may be,
for each target node, determining each node representing an event corresponding to the target node in the event knowledge maps; calculating the product of the determined data attribute displayed in an associated mode of each node and the weight of the event knowledge graph to which the node belongs; and taking the calculated sum of the at least one product as a target data attribute of a target event characterized by the target node.
9. A method of event determination, the method comprising:
acquiring first event content of a specified event;
searching a node with the event content of the represented target event as the first event content in the constructed event knowledge graph as a designated node; wherein the event knowledge graph is constructed according to the method of any one of claims 1-8;
And determining a father target event and/or a son target event of the specified event based on a target connecting line in the event knowledge graph, wherein the target connecting line is a connecting line connected with the specified node.
10. The method according to claim 9, wherein the step of determining a parent target event and/or a child target event of the specified event based on target connection lines in the event knowledge graph comprises:
when the single arrow of the connecting line in the event knowledge graph points to: when pointing from a father target event to a child target event, determining a first connecting line pointing to the appointed node in the target connecting line, and determining a target event represented by the connecting node at the other end of the first connecting line as the father target event of the appointed event; determining a second connecting line except the first connecting line in the target connecting lines, and determining a target event represented by a connecting node at the other end of the second connecting line as a sub-target event of the designated event;
when the single arrow of the connecting line in the event knowledge graph points to: when pointing from a child target event to a father target event, determining a third connecting line pointing to the appointed node in the target connecting lines, and determining a target event represented by a connecting node at the other end of the third connecting line as the child target event of the appointed event; and determining a fourth connecting line except the third connecting line in the target connecting lines, and determining a target event represented by a connecting node at the other end of the fourth connecting line as a father target event of the appointed event.
11. The method of claim 9, wherein each node in the event knowledge graph is associated with a target attribute that displays a target event characterized by the node;
the step of determining the father target event and/or son target event piece of the specified event based on the target connecting lines in the event knowledge graph comprises the following steps:
when the preset event corresponding to the target attribute is a father target event of the target event represented by each node, determining the target event corresponding to the target attribute which is displayed in an associated mode by the designated node as the father target event of the designated event; determining a fifth connecting line with a starting end of the target connecting line as the designated node, and determining a target event represented by the node pointed by a single arrow of the fifth connecting line as a sub-target event of the designated event;
when the preset event corresponding to the target attribute is a sub-target event of the target event represented by each node, determining the target event corresponding to the target attribute which is displayed in an associated manner by the designated node as the sub-target event of the designated event; and determining a sixth connecting line with the starting end of the target connecting line being the designated node, and determining a target event represented by the node pointed by the single arrow of the sixth connecting line as a father target event of the designated event.
12. The method according to any one of claims 9-11, wherein in the event knowledge graph, a connecting line with a single arrow is arranged between any two nodes with father-son relationship of the represented target event, and the transition probability between the two nodes is displayed in an associated manner; wherein, the transition probability is: of two target events with father-son relationship represented by the two nodes, the father target event leads to the probability of child target event occurrence;
the method further comprises the steps of:
when the single arrow of the connecting line in the event knowledge graph points to: when pointing from a father target event to a child target event, determining a seventh connecting line pointing to the appointed node in the target connecting lines, and determining the transition probability of the seventh connecting line in an associated display manner as the probability that the target event represented by the connecting node of the other point of the seventh connecting line leads to the appointed event; determining an eighth connecting line except a seventh connecting line in the target connecting lines, and determining the transition probability of the eighth connecting line in an associated display as the probability that the designated event causes the target event represented by a connecting node at the other end of the eighth connecting line;
When the single arrow of the connecting line in the event knowledge graph points to: determining a ninth connecting line pointing to the appointed node in the target connecting lines when pointing from the child target event to the father target event, and determining the transition probability of the ninth connecting line in an associated display as the probability that the appointed event causes the target event represented by the connecting node at the other point of the ninth connecting line; and determining a tenth connecting line except a ninth connecting line in the target connecting lines, and determining the transition probability of the associated display of the tenth connecting line as the probability that the target event represented by the connecting node at the other end of the tenth connecting line leads to the occurrence of the appointed event.
13. An event knowledge graph construction device, which is characterized in that the device comprises:
an event acquisition module for acquiring a plurality of event information groups from a target information source, wherein each event information group comprises a pair of sub events and a parent event;
the event acquisition module is specifically used for determining a target information source; the target information source is network equipment for generating operation data; judging whether the target information source provides structured event information or not; the structured event information includes: relationships between individual events expressed by the form of event-relationship-events; when the judgment result is yes, acquiring a plurality of event information groups from the structured event information provided by the target information source; when the judgment result is negative, extracting a plurality of event information groups from event information provided by the target information source by using an event information extraction algorithm;
The event determining module is used for determining a plurality of target events of the map to be constructed from the child events and the father events included in the event information groups; wherein, the event content of different target event characterization is different;
the event determining module is specifically configured to divide each event representing the same event content into the same target group in the child event and the parent event included in the plurality of event information groups, so as to obtain at least one target group, where different target groups represent different event contents; for each target group, selecting a first event for representing the event content corresponding to the target group from the target group; determining the selected first event and at least one second event as a plurality of target events of a map to be constructed, wherein the at least one second event is: removing the remaining events after the events contained in the target groups from the sub events and the parent events contained in the event information groups;
the result searching module is used for searching the father target event and the child target event of the target event from the plurality of target events based on the father-son relationship between each pair of the event and the father event included in the plurality of event information groups, and obtaining a searching result corresponding to the target event;
The map construction module is used for constructing an event knowledge map about each target event based on the search result corresponding to each target event; the event knowledge graph comprises a plurality of nodes, each node is used for representing a target event, a connecting line with a single arrow is arranged between any two nodes with father-son relations of the represented target event, the single arrow of each connecting line points to the same target point, and the target points to: pointing from a parent target event to a child target event or pointing from a child target event to a parent target event.
14. An event determination apparatus, the apparatus comprising:
the content acquisition module is used for acquiring the first event content of the specified event;
the node searching module is used for searching the node with the event content of the represented target event as the first event content in the constructed event knowledge graph as a designated node; wherein the event knowledge graph is constructed according to the method of any one of claims 1-8;
and the target event determining module is used for determining a father target event and/or a child target event of the specified event based on target connecting lines in the event knowledge graph, wherein the target connecting lines are connecting lines connected with the specified node.
15. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 1-8 when executing a program stored on a memory.
16. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-8.
CN201910236491.2A 2019-03-27 2019-03-27 Method and device for constructing event knowledge graph and method and device for determining event Active CN111753094B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910236491.2A CN111753094B (en) 2019-03-27 2019-03-27 Method and device for constructing event knowledge graph and method and device for determining event

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910236491.2A CN111753094B (en) 2019-03-27 2019-03-27 Method and device for constructing event knowledge graph and method and device for determining event

Publications (2)

Publication Number Publication Date
CN111753094A CN111753094A (en) 2020-10-09
CN111753094B true CN111753094B (en) 2024-02-02

Family

ID=72671022

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910236491.2A Active CN111753094B (en) 2019-03-27 2019-03-27 Method and device for constructing event knowledge graph and method and device for determining event

Country Status (1)

Country Link
CN (1) CN111753094B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112214614B (en) * 2020-10-16 2024-02-09 民生科技有限责任公司 Knowledge-graph-based risk propagation path mining method and system
CN112149759B (en) * 2020-10-26 2024-07-02 青岛明略软件技术开发有限公司 Event map matching method and device, electronic equipment and storage medium
CN112749239B (en) * 2021-01-20 2022-10-21 青岛海信网络科技股份有限公司 Event map construction method and device and computing equipment
CN113269513A (en) * 2021-05-12 2021-08-17 北京创仕科锐信息技术有限公司 Target management method and system
CN113449116B (en) * 2021-06-22 2022-12-20 青岛海信网络科技股份有限公司 Map construction and early warning method, device and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106777331A (en) * 2017-01-11 2017-05-31 北京航空航天大学 Knowledge mapping generation method and device
CN106909622A (en) * 2017-01-20 2017-06-30 中国科学院计算技术研究所 Knowledge mapping vector representation method, knowledge mapping relation inference method and system
CN109213854A (en) * 2018-09-05 2019-01-15 平安科技(深圳)有限公司 Knowledge mapping approaches to IM, device, computer equipment and storage medium
CN109284396A (en) * 2018-09-27 2019-01-29 北京大学深圳研究生院 Medical knowledge graph construction method, device, server and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9336300B2 (en) * 2014-01-17 2016-05-10 Facebook, Inc. Client-side search templates for online social networks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106777331A (en) * 2017-01-11 2017-05-31 北京航空航天大学 Knowledge mapping generation method and device
CN106909622A (en) * 2017-01-20 2017-06-30 中国科学院计算技术研究所 Knowledge mapping vector representation method, knowledge mapping relation inference method and system
CN109213854A (en) * 2018-09-05 2019-01-15 平安科技(深圳)有限公司 Knowledge mapping approaches to IM, device, computer equipment and storage medium
CN109284396A (en) * 2018-09-27 2019-01-29 北京大学深圳研究生院 Medical knowledge graph construction method, device, server and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
《Building event-centric knowledge graphs from news》;Marco Rospocher 等;《Web Semantics: Science, Services and Agents on the World Wide Web》;全文 *
《基于知识图谱的应急管理研究态势分析》;王云才 等;《中国安全科学学报》;第22卷(第4期);全文 *
Zhongyang Li等.《Constructing Narrative Event Evolutionary Graph for Script Event Prediction》.《arXiv》.2018,全文. *
雷枫.《语义互联国史百科的知识组织研究与实现》.《科研信息化技术与应用》.2015,全文. *

Also Published As

Publication number Publication date
CN111753094A (en) 2020-10-09

Similar Documents

Publication Publication Date Title
CN111753094B (en) Method and device for constructing event knowledge graph and method and device for determining event
US12229501B2 (en) Populating values in a spreadsheet using semantic cues
US9959015B2 (en) Systems and methods for monitoring and analyzing performance in a computer system with node pinning for concurrent comparison of nodes
US9972105B2 (en) Visualization of data clusters
US9426045B2 (en) Proactive monitoring tree with severity state sorting
US8972992B2 (en) Proactive monitoring tree with state distribution ring
US9142049B2 (en) Proactive monitoring tree providing distribution stream chart with branch overlay
US9652472B2 (en) Service requirement analysis system, method and non-transitory computer readable storage medium
US9418178B2 (en) Controlling a size of hierarchical visualizations through contextual search and partial rendering
WO2011134141A1 (en) Method of extracting named entity
CN114090838B (en) Method, system, electronic device and storage medium for visually displaying big data
US20150379112A1 (en) Creating an on-line job function ontology
AU2022228142B2 (en) Intelligent change summarization for designers
US8392393B2 (en) Graph searching
CN117591624B (en) Test case recommendation method based on semantic index relation
CN118228993A (en) Method, device, computer equipment and storage medium for determining demand priority
JP2020091607A (en) Search system and search method
CN113743506A (en) Data processing method and device and electronic equipment
US20240320259A1 (en) Methods and device for information presenting and information processing
CN116738216B (en) Association processing method and device for early warning big data
US12423358B2 (en) Method and device for information presenting
CN115269785B (en) Search method, device, computer equipment and storage medium
US20160275181A1 (en) Method of relation estimation and information processing apparatus
CN114757202A (en) Method and apparatus for detecting ambiguity of entity type, electronic device, storage medium
CN119476275A (en) Resource data display method and related equipment based on knowledge graph

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