CN111143578A - Method, device and processor for extracting event relation based on neural network - Google Patents

Method, device and processor for extracting event relation based on neural network Download PDF

Info

Publication number
CN111143578A
CN111143578A CN201911405157.1A CN201911405157A CN111143578A CN 111143578 A CN111143578 A CN 111143578A CN 201911405157 A CN201911405157 A CN 201911405157A CN 111143578 A CN111143578 A CN 111143578A
Authority
CN
China
Prior art keywords
event
events
transaction
neural network
training
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.)
Granted
Application number
CN201911405157.1A
Other languages
Chinese (zh)
Other versions
CN111143578B (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.)
Beijing Internetware Ltd
Original Assignee
Smart Shenzhou Beijing 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 Smart Shenzhou Beijing Technology Co Ltd filed Critical Smart Shenzhou Beijing Technology Co Ltd
Priority to CN201911405157.1A priority Critical patent/CN111143578B/en
Publication of CN111143578A publication Critical patent/CN111143578A/en
Application granted granted Critical
Publication of CN111143578B publication Critical patent/CN111143578B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Abstract

The application provides a method, a device, a storage medium and a processor for extracting event relations based on a neural network. The method for extracting the event relation comprises the following steps: sequencing all events in the knowledge-graph by time; dividing the sequenced events according to a preset time window to obtain a plurality of transactions, wherein at least one transaction comprises an event; constructing a training set according to the affairs, wherein the training set comprises a plurality of training data; inputting training data into a preset neural network framework for training to obtain a classification model; and predicting the transaction to be predicted by using the classification model to obtain the occurrence probability of each event, and determining the event occurring after the transaction to be predicted according to the probability. And the neural network algorithm is adopted to predict the associated events, so that the efficiency and the accuracy of the determination method of the association relation between the knowledge map events are greatly improved.

Description

Method, device and processor for extracting event relation based on neural network
Technical Field
The present application relates to the field of knowledge graphs, and in particular, to a method, an apparatus, a storage medium, and a processor for extracting event relationships based on a neural network.
Background
Event knowledge maps are still in the development stage, and a great number of technical problems still need to be solved at present, wherein the analysis of the incidence relation between events is a difficult problem. The association relationship means that one event influences whether another event occurs, and includes a causal relationship, an opposite relationship, a turning relationship, a sequential relationship and the like. The data representation of the event in the knowledge graph is divided into structured data and unstructured data. The structured data of the event generally comprises attributes of event type, trigger words, arguments and roles. The unstructured data of the event generally contains attributes such as event subject name, event time, subject, object, etc., and besides the subject name, there is no requirement that each attribute must have an attribute value, and there may be attributes of the attributes (e.g., the subject has its own attribute).
Currently, the association relation between events needs experts in the field, the association relation of the events is written into a rule according to the profound field knowledge and experience of the experts, and the association relation between the theme events (such as 'meilian storage interest reduction' to cause 'gold price rising') is determined by rule matching during use. The realization mode needs economic and financial experts to deeply participate in the construction of the knowledge map, and the knowledge and experience of the experts are converted into the structure, logic and even codes of the knowledge map through the cooperation of engineering and technical personnel, so that the landing difficulty can be known. There are also algorithms (e.g., FP-trees) that can reduce the above-mentioned manual workload and automatically mine the association rule relationship between events. The accuracy of the rules excavated by the excavation algorithm is generally low, the excavation relationship needs to be further confirmed manually, and finally the rules are formed.
The above information disclosed in this background section is only for enhancement of understanding of the background of the technology described herein and, therefore, certain information may be included in the background that does not form the prior art that is already known in this country to a person of ordinary skill in the art.
Disclosure of Invention
The application mainly aims to provide a method, a device, a storage medium and a processor for extracting event relations based on a neural network, so as to solve the problem that the determination method of incidence relations among knowledge graph events in the prior art is low in efficiency.
In order to achieve the above object, according to one aspect of the present application, there is provided a method of extracting event relations based on a neural network, the method of extracting event relations including: sequencing all events in the knowledge-graph by time; dividing the sequenced events according to a preset time window to obtain a plurality of transactions, wherein at least one transaction comprises the events; constructing a training set according to the affairs, wherein the training set comprises a plurality of training data; inputting the training data into a preset neural network framework for training to obtain a classification model; and predicting the transaction to be predicted by using the classification model to obtain the occurrence probability of each event, and determining the event occurring after the transaction to be predicted according to the probability.
Further, constructing a training set from the transactions, the training set including a plurality of training data, including: extracting a preset number of events from the transaction to obtain an event combination, wherein the preset number is greater than or equal to 2; and constructing the training set according to the event combination and the labeling label.
Further, constructing the training set according to the event combination and the label tag, including: numbering all the events in the event list, wherein a plurality of the events are respectively represented as E1, E2, E3, E4 and … EK, and the number corresponding to each event is 4, 5, 6, 7 and … K +3, and the definition<PAD>、<S>、<E>And<UNK>the corresponding numbers are 0, 1, 2 and 3 respectively,<PAD>the representation is used to make up the input length,<S>representing a string of said event start symbols,<E>indicating the end of a string of said events,<UNK>the event representing this location is not in the database; according to the number of the event,<PAD>The numbers of,<S>The numbers of,<E>Is numbered and<UNK>determining the number form corresponding to the event combination; in the case where the event occurring after the transaction is an EM, constructing the annotation tag, which is represented as
Figure BDA0002348416270000021
Wherein four 0 s respectively represent a special symbol<PAD>,<S>,<E>And<UNK>and corresponding label, K represents the total number of the events, p is a hyperparameter, p is 0.9, the probability of the event EM is p, and the probabilities of other events are p
Figure BDA0002348416270000022
And establishing the training set according to the numbering form and the labeling label corresponding to the event combination.
Further, inputting the training data into a predetermined neural network framework for training to obtain a classification model, including: and taking the numbering form as the input of the preset neural network framework, taking the label as the output of the preset neural network framework, and training to obtain the classification model.
Further, predicting the transaction to be predicted by using the classification model to obtain the probability of occurrence of each event, and determining the event occurring after the transaction to be predicted according to the probability, wherein the method comprises the following steps: predicting each event combination respectively by using the classification model to obtain the probability of each event after the last event of each event combination; and selecting the event with the maximum probability as the event which occurs after the last event of the transaction to be predicted.
Further, the predetermined time window is at least one of: one week, one month, one quarter, one year.
Further, the predetermined neural network framework is at least one of: CNN, BLSTM, transducer-encoder. .
According to another aspect of the present application, there is provided an apparatus for extracting event relations based on a neural network, including: the sequencing unit is used for sequencing all events in the knowledge graph according to time; the dividing unit is used for dividing the sequenced events according to a preset time window to obtain a plurality of transactions, and each transaction consists of at least one event; the construction unit is used for constructing a training set according to the affairs, and the training set comprises a plurality of training data; the training unit is used for inputting the training data into a preset neural network framework for training to obtain a classification model; and the determining unit is used for predicting the transaction to be predicted by using the classification model to obtain the occurrence probability of each event, and determining the event occurring after the transaction to be predicted according to the probability.
According to another aspect of the application, there is provided a storage medium comprising a stored program, wherein the program performs any one of the methods.
According to another aspect of the application, a processor for running a program is provided, wherein the program when running performs any of the methods.
According to the technical scheme, firstly, all events in a knowledge graph are sequenced according to time, secondly, the sequenced events are divided according to a preset time window to obtain a plurality of transactions, each transaction consists of at least one event, then, a training set is constructed according to the transactions, the training set comprises a plurality of training data, then, the training data are input to a preset neural network framework to be trained to obtain a classification model, finally, the classification model is used for predicting the transactions to be predicted to obtain the occurrence probability of each event, and the events occurring after the transactions to be predicted are determined according to the probability. The method comprises the steps of sequencing all events in a knowledge graph according to time, dividing the sequenced events according to a preset time window to obtain a plurality of transactions, wherein each transaction consists of at least one event, constructing a training set through the plurality of transactions, training the training set by adopting a preset neural network framework to obtain a classification model, predicting the transaction to be predicted by adopting the classification model to obtain the event occurring after the transaction to be predicted, and compared with the mode of predicting the correlated event according to experience in the prior art, the method for predicting the correlated event by adopting a neural network algorithm greatly improves the efficiency and accuracy of the method for determining the correlation between the knowledge graph events.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
FIG. 1 illustrates a flow diagram of a method of extracting event relationships based on a neural network, in accordance with embodiments of the present application; and
fig. 2 is a schematic diagram of an apparatus for extracting event relationships based on a neural network according to an embodiment of the present application.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It will be understood that when an element such as a layer, film, region, or substrate is referred to as being "on" another element, it can be directly on the other element or intervening elements may also be present. Also, in the specification and claims, when an element is described as being "connected" to another element, the element may be "directly connected" to the other element or "connected" to the other element through a third element.
As described in the background art, the prior art method for determining the correlation between knowledge-graph events is not efficient, and in order to solve the above technical problems, a method, an apparatus, a storage medium, and a processor for extracting event relationships based on a neural network are provided.
According to an embodiment of the application, a method for extracting event relations based on a neural network is provided. Fig. 1 is a flowchart of a method for extracting event relationships based on a neural network according to an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
step S101, sequencing all events in the knowledge graph according to time;
step S102, dividing the sequenced events according to a preset time window to obtain a plurality of transactions, wherein at least one transaction comprises an event;
step S103, constructing a training set according to the affairs, wherein the training set comprises a plurality of training data;
step S104, inputting the training data into a preset neural network framework for training to obtain a classification model;
and step S105, predicting the transaction to be predicted by using the classification model to obtain the probability of each event, and determining the event occurring after the transaction to be predicted according to the probability.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
In the scheme, firstly, all events in a knowledge graph are sequenced according to time, secondly, the sequenced events are divided according to a preset time window to obtain a plurality of transactions, each transaction consists of at least one event, secondly, a training set is constructed according to the transactions, the training set comprises a plurality of training data, thirdly, the training data are input into a preset neural network framework to be trained to obtain a classification model, lastly, the classification model is used for predicting the transactions to be predicted to obtain the occurrence probability of each event, and the events occurring after the transactions to be predicted are determined according to the probability. The method comprises the steps of sequencing all events in a knowledge graph according to time, dividing the sequenced events according to a preset time window to obtain a plurality of transactions, wherein each transaction consists of at least one event, constructing a training set through the plurality of transactions, training the training set by adopting a preset neural network framework to obtain a classification model, predicting the transaction to be predicted by adopting the classification model to obtain the event occurring after the transaction to be predicted, and compared with the mode of predicting the correlated event according to experience in the prior art, the method for predicting the correlated event by adopting a neural network algorithm greatly improves the efficiency and accuracy of the method for determining the correlation between the knowledge graph events.
It should be noted that all events in the knowledge graph are sorted according to events, the size of an event window is set to be W, all events are divided according to a time window, and the events in each time window are sorted according to occurrence time. For example as shown in the following table:
Figure BDA0002348416270000041
Figure BDA0002348416270000051
according to the definition of the association rule algorithm, I ═ E1, E2, E3, E4, E5, · is called an item set, Ei is an event, D ═ T1, T2, T3, T4, T5, · is called a database, Ti is called a transaction, each transaction is a subset of I, and the table records the occurrence of each event in a week. The association mining is to find out an association between events, such as { E2, E3} - > { E1}, which means that if E2 and E3 occur, then E1 is likely to occur.
In an embodiment of the present application, a training set is constructed according to the transaction, where the training set includes a plurality of training data, and the method includes: and extracting a preset number of events from the affairs to obtain an event combination, wherein the preset number is more than or equal to 2, and constructing the training set according to the event combination and the label. Given the integer K, all combinations of events with K less than 2 are extracted from all events in each transaction, the last event of all extracted combinations is used as a label, and the other events are network inputs. For example, a transaction includes events T ═ { E1, E2, E3, E4, E1}, E1 to E4 are arranged in time, E1 occurs twice, and K is 3, then all combinations of 3 events and 2 events to be extracted:
{{E1,E2}{E1,E3}{E1,E4}{E2,E3}{E2,E4}{E3,E4}{E1,E1}{E1,E2,E3}{E1,E2,E4}{E1,E2,E1}{E1,E3,E4}{E1,E3,E1}{E1,E4,E1}},
and extracting the combinations from all the transactions to obtain an event combination set, wherein all the extracted event combinations are training data, so that the events needing to be trained can be provided when the events are numbered in the subsequent process.
In an embodiment of the application, constructing the training set according to the event combination and the label tag includes: numbering all the events in the event list, wherein when a plurality of the events are respectively represented by E1, E2, E3, E4 and … EK, the numbers corresponding to the events are 4, 5, 6, 7 and … K +3, and the definition is defined<PAD>、<S>、<E>And<UNK>the corresponding numbers are 0, 1, 2 and 3,<PAD>the representation is used to make up the input length,<S>a string of the above-mentioned event start symbols is represented,<E>indicating that a string of the above-mentioned events is over,<UNK>the event indicating the location is not in the database, based on the eventNumbering,<PAD>The numbers of,<S>The numbers of,<E>Is numbered and<UNK>the number of (2), the number format corresponding to the event combination is determined, and the label tag is constructed when the event occurring after the transaction is EM, the label tag being expressed as
Figure BDA0002348416270000052
Wherein four 0 s respectively represent a special symbol<PAD>,<S>,<E>And<UNK>in the corresponding label tag, K represents the total number of events, p is a hyperparameter, p is 0.9, the probability of occurrence of the event EM is p, and the probabilities of occurrence of other events are p
Figure BDA0002348416270000053
And (3) the training set is established according to the number form and the label tag corresponding to the event combination, and of course, p can be set to other suitable values in practical application.
Taking { E1, E2, E3, E4} { E1} as an example, the input data is < S >, E1, E2, E3, E4, < E >.
Converted into numbered forms
1,4,5,6,7,2。
The label is as follows:
Figure BDA0002348416270000061
assuming that K events are total, p is the number of the E1, where p is a hyper-parameter, and needs to be specified before training, and p is generally 0.9, so that a more efficient and accurate label is provided during subsequent probability calculation, data validity is provided by numbering events, and machine learning performance and effect are provided by applying the hyper-parameter.
In an embodiment of the present application, the training data is input to a predetermined neural network framework for training, and a classification model is obtained, including: and taking the number form as the input of the preset neural network framework, taking the label tag as the output of the preset neural network framework, and training to obtain the classification model. The accuracy of the model can be improved by training the data, and the obtained model can be used for predicting predicted transactions more efficiently and accurately subsequently.
In an embodiment of the application, predicting transactions to be predicted by using the classification model to obtain probabilities of occurrence of the events, and determining the events occurring after the transactions to be predicted according to the probabilities includes: and predicting each event combination by using the classification model to obtain the probability of each event after the last event of each event combination, and selecting the event with the highest probability as the event after the last event of the transaction to be predicted.
And setting an output probability threshold t, sequentially using model prediction for event combinations in new objects, and selecting the event with the maximum probability and greater than t as final output. For example, there are new transactions T { E1, E2, E3, E4, E5}, K ═ 4, and T ═ 0.5, and it is now predicted what event is most likely to occur after event E5 occurs. Using the model to calculate in sequence:
A1={E2,E3,E4,E5}
A2={E3,E4,E5}
A3={E4,E5}
A4={E5}。
4 results were obtained:
B1=argmax(0,0,0,0,0.9,0.001,...)=E1
B2=argmax(0,0,0,0,0.001,0.8,...)=E2
B3=argmax(0,0,0,0,0.001,0.001,0.7...)=E3
B4=argmax(0,0,0,0,0.001,0.001,0.001,0.6,...)=E4。
because of this, it is possible to reduce the number of the,
max(0.9,0.8,0.7,0.6)=0.9>t=0.5,
then select
B=E1,
The final result was { E2, E3, E4, E5} > E1.
I.e. E2, E3, E4, E5, then the probability of occurrence of the transaction immediately after E1 is 0.9, thus obtaining the probability of occurrence of the transaction after the transaction to be predicted, and finding the one with the highest probability according to the calculated probability, namely the most likely probability to occur, the expert can know what event is likely to occur next according to the probability and take corresponding measures to process.
In an embodiment of the application, the predetermined time window is at least one of: one week, one month, one quarter, one year.
Of course, the time window can be determined according to actual conditions, for example, two weeks, two months, two quarters, and a half year can be selected, and other suitable ranges can be selected.
In an embodiment of the application, the predetermined neural network framework is at least one of: CNN, BLSTM, transducer-encoder. The application of the neural network framework can enable machine learning to be clearer, readability is high, learning speed can be improved, certainly, the preset neural network framework is not limited to the above types, and other neural network frameworks such as Tensorflow, Caffe, Theano and MXNET can be selected according to actual conditions.
The embodiment of the present application further provides a device for extracting event relationships based on a neural network, and it should be noted that the device for extracting event relationships based on a neural network according to the embodiment of the present application can be used to execute the method for extracting event relationships based on a neural network provided by the embodiment of the present application. The following describes an apparatus for extracting event relationships based on a neural network according to an embodiment of the present application.
Fig. 2 is a schematic diagram of an apparatus for extracting event relationships based on a neural network according to an embodiment of the present application. As shown in fig. 2, the apparatus includes:
a sorting unit 10, configured to sort all events in the knowledge graph by time;
a dividing unit 20, configured to divide the sequenced events according to a predetermined time window to obtain multiple transactions, where at least one transaction includes the event;
a constructing unit 30, configured to construct a training set according to the transaction, where the training set includes a plurality of training data;
a training unit 40, configured to input the training data to a predetermined neural network framework for training, so as to obtain a classification model;
and the determining unit 50 is used for predicting the transaction to be predicted by using the classification model to obtain the occurrence probability of each event, and determining the event occurring after the transaction to be predicted according to the probability.
In the device, a sequencing unit sequences all events in a knowledge graph according to time, a dividing unit divides the sequenced events according to a preset time window to obtain a plurality of transactions, each transaction consists of at least one event, a construction unit constructs a training set according to the transactions, the training set comprises a plurality of training data, the training unit inputs the training data into a preset neural network framework for training to obtain a classification model, a determination unit predicts the transactions to be predicted by using the classification model to obtain the probability of occurrence of each event, and the events occurring after the transactions to be predicted are determined according to the probability. The method comprises the steps of sequencing all events in a knowledge graph according to time, dividing the sequenced events according to a preset time window to obtain a plurality of transactions, wherein each transaction consists of at least one event, constructing a training set through the plurality of transactions, training the training set by adopting a preset neural network framework to obtain a classification model, predicting the transaction to be predicted by adopting the classification model to obtain the event occurring after the transaction to be predicted, and compared with the mode of predicting the correlated event according to experience in the prior art, the method for predicting the correlated event by adopting a neural network algorithm greatly improves the efficiency and accuracy of the method for determining the correlation between the knowledge graph events.
It should be noted that all events in the knowledge graph are sorted according to events, the size of an event window is set to be W, all events are divided according to a time window, and the events in each time window are sorted according to occurrence time. For example as shown in the following table:
t1 1 week E1,E2,...
T2 for 2 weeks E3,...
T3 for 3 weeks E4,E5,...
T4 for 4 weeks E1,E2,E3,...
T5 for 5 weeks E2,...
... ...
According to the definition of the association rule algorithm, I ═ E1, E2, E3, E4, E5, · is called an item set, Ei is an event, D ═ T1, T2, T3, T4, T5, · is called a database, Ti is called a transaction, each transaction is a subset of I, and the table records the occurrence of each event in a week. The association mining is to find out an association between events, such as { E2, E3} - > { E1}, which means that if E2 and E3 occur, then E1 is likely to occur.
In an embodiment of the application, the construction unit includes an extraction module and a construction module, the extraction module is configured to extract a predetermined number of the events from the transactions to obtain an event combination, the predetermined number is greater than or equal to 2, and the construction module is configured to construct the training set according to the event combination and the label. Given the integer K, all combinations of events with K less than 2 are extracted from all events in each transaction, the last event of all extracted combinations is used as a label, and the other events are network inputs. For example, a transaction includes events T ═ { E1, E2, E3, E4, E1}, E1 to E4 are arranged in time, E1 occurs twice, and K is 3, then all combinations of 3 events and 2 events to be extracted:
{{E1,E2}{E1,E3}{E1,E4}{E2,E3}{E2,E4}{E3,E4}{E1,E1}{E1,E2,E3}{E1,E2,E4}{E1,E2,E1}{E1,E3,E4}{E1,E3,E1}{E1,E4,E1}}
and extracting the combinations from all the transactions to obtain an event combination set, wherein all the extracted event combinations are training data, so that the events needing to be trained can be provided when the events are numbered in the subsequent process.
In an embodiment of the application, the construction module includes a numbering submodule, a determination submodule, a first construction submodule and a second construction submodule, the numbering submodule is configured to number all the events in an event list, a plurality of the events are represented as E1, E2, E3, E4, and … EK, respectively, and the number corresponding to each of the events is 4, 5, 6, 7, and … K +3, and defines<PAD>、<S>、<E>And<UNK>the corresponding numbers are 0, 1, 2 and 3,<PAD>the representation is used to make up the input length,<S>a string of the above-mentioned event start symbols is represented,<E>indicating that a string of the above-mentioned events is over,<UNK>the event indicating the location is not in the database, and the determination submodule is configured to determine the location based on the number of the event,<PAD>The numbers of,<S>The numbers of,<E>Is numbered and<UNK>the number of the event combination is determined, the number form corresponding to the event combination is determined, the first construction submodule is used for constructing the label tag under the condition that the event occurring after the transaction is EM,
Figure BDA0002348416270000091
wherein four 0 s respectively represent a special symbol<PAD>,<S>,<E>And<UNK>in the corresponding label tag, K represents the total number of events, p is a hyperparameter, p is 0.9, the probability of occurrence of the event EM is p, and the probabilities of occurrence of other events are p
Figure BDA0002348416270000092
The second construction submodule is configured to surely construct the training set according to the number format and the label tag corresponding to the event combination, and certainly, p may be set to another suitable value in an actual application.
Taking { E1, E2, E3, E4} { E1} as an example, the input data is:
<S>,E1,E2,E3,E4,<E>。
conversion to the numbered form:
1,4,5,6,7,2。
the label is as follows:
Figure BDA0002348416270000093
assuming that K events are total, p is the number of the E1, where p is a hyper-parameter, and needs to be specified before training, and p is generally 0.9, so that a more efficient and accurate label is provided during subsequent probability calculation, data validity is provided by numbering events, and machine learning performance and effect are provided by applying the hyper-parameter.
In an implementation of the present application, the training unit includes a training module, configured to train the number format as an input of the predetermined neural network frame and the label tag as an output of the predetermined neural network frame to obtain the classification model. The accuracy of the model can be improved by training the data, and the obtained model can be used for predicting predicted transactions more efficiently and accurately subsequently.
In an embodiment of the application, the determining unit includes a predicting module and a selecting module, the predicting module is configured to predict each event combination by using the classification model to obtain a probability of occurrence of each event after a last event of each event combination, and the selecting module is configured to select the event with the highest occurrence probability as the event occurring after the last event of the transaction to be predicted.
And setting an output probability threshold t, sequentially using model prediction for event combinations in new objects, and selecting the event with the maximum probability and greater than t as final output. For example, there are new transactions T { E1, E2, E3, E4, E5}, K ═ 4, and T ═ 0.5, and it is now predicted what event is most likely to occur after event E5 occurs. Using the model to calculate in sequence:
A1={E2,E3,E4,E5}
A2={E3,E4,E5}
A3={E4,E5}
A4={E5}。
4 results were obtained:
B1=argmax(0,0,0,0,0.9,0.001,...)=E1
B2=argmax(0,0,0,0,0.001,0.8,...)=E2
B3=argmax(0,0,0,0,0.001,0.001,0.7...)=E3
B4=argmax(0,0,0,0,0.001,0.001,0.001,0.6,...)=E4。
because:
max(0.9,0.8,0.7,0.6)=0.9>t=0.5,
then select
B=E1,
The final result was { E2, E3, E4, E5} > E1.
I.e. E2, E3, E4, E5, then the probability of occurrence of the transaction immediately after E1 is 0.9, thus obtaining the probability of occurrence of the transaction after the transaction to be predicted, and finding the one with the highest probability according to the calculated probability, namely the most likely probability to occur, the expert can know what event is likely to occur next according to the probability and take corresponding measures to process.
In an embodiment of the application, the predetermined time window is at least one of: one week, one month, one quarter, one year.
Of course, the time window can be determined according to actual conditions, for example, two weeks, two months, two quarters, and a half year can be selected, and other suitable ranges can be selected.
In an embodiment of the application, the predetermined neural network framework is at least one of: CNN, BLSTM, transducer-encoder. The application of the neural network framework can enable machine learning to be clearer, readability is high, learning speed can be improved, certainly, the preset neural network framework is not limited to the above types, and other neural network frameworks such as Tensorflow, Caffe, Theano and MXNET can be selected according to actual conditions.
The device for extracting the event relation based on the neural network comprises a processor and a memory, wherein the sequencing unit, the dividing unit, the constructing unit, the training unit, the determining unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, and the efficiency of the determination method of the incidence relation between the knowledge graph events is improved by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium, on which a program is stored, where the program, when executed by a processor, implements the method for extracting event relationships based on a neural network.
The embodiment of the invention provides a processor, which is used for running a program, wherein the method for extracting event relations based on a neural network is executed when the program runs.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein when the processor executes the program, at least the following steps are realized:
step S101, sequencing all events in the knowledge graph according to time;
step S102, dividing the sequenced events according to a preset time window to obtain a plurality of transactions, wherein each transaction consists of at least one event;
step S103, constructing a training set according to the affairs, wherein the training set comprises a plurality of training data;
step S104, inputting the training data into a preset neural network framework for training to obtain a classification model;
and step S105, predicting the transaction to be predicted by using the classification model to obtain the probability of each event, and determining the event occurring after the transaction to be predicted according to the probability.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program of initializing at least the following method steps when executed on a data processing device:
step S101, sequencing all events in the knowledge graph according to time;
step S102, dividing the sequenced events according to a preset time window to obtain a plurality of transactions, wherein each transaction consists of at least one event;
step S103, constructing a training set according to the affairs, wherein the training set comprises a plurality of training data;
step S104, inputting the training data into a preset neural network framework for training to obtain a classification model;
and step S105, predicting the transaction to be predicted by using the classification model to obtain the probability of each event, and determining the event occurring after the transaction to be predicted according to the probability.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that 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 an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
From the above description, it can be seen that the above-described embodiments of the present application achieve the following technical effects:
1) the method for extracting the event relation based on the neural network comprises the steps of firstly sequencing all events in a knowledge graph according to time, secondly dividing the sequenced events according to a preset time window to obtain a plurality of transactions, wherein each transaction comprises at least one event, secondly constructing a training set according to the transactions, the training set comprises a plurality of training data, thirdly inputting the training data into a preset neural network framework to train to obtain a classification model, thirdly predicting the transaction to be predicted by using the classification model to obtain the occurrence probability of each event, and finally determining the event occurring after the transaction to be predicted according to the probability. The method comprises the steps of sequencing all events in a knowledge graph according to time, dividing the sequenced events according to a preset time window to obtain a plurality of transactions, wherein each transaction consists of at least one event, constructing a training set through the plurality of transactions, training the training set by adopting a preset neural network framework to obtain a classification model, predicting the transaction to be predicted by adopting the classification model to obtain the event occurring after the transaction to be predicted, and compared with the mode of predicting the correlated event according to experience in the prior art, the method for predicting the correlated event by adopting a neural network algorithm greatly improves the efficiency and accuracy of the method for determining the correlation between the knowledge graph events.
2) The device for extracting the event relation based on the neural network comprises a sequencing unit, a dividing unit, a constructing unit and a determining unit, wherein the sequencing unit is used for sequencing all events in a knowledge graph according to time, the dividing unit is used for dividing the sequenced events according to a preset time window to obtain a plurality of transactions, each transaction consists of at least one event, the constructing unit is used for constructing a training set according to the transactions, the training set comprises a plurality of training data, the training unit is used for inputting the training data into a preset neural network frame to train to obtain a classification model, the determining unit is used for predicting the transactions to be predicted by using the classification model to obtain the probability of occurrence of each event, and the events occurring after the transactions to be predicted are determined according to the probability. The method comprises the steps of sequencing all events in a knowledge graph according to time, dividing the sequenced events according to a preset time window to obtain a plurality of transactions, wherein each transaction consists of at least one event, constructing a training set through the plurality of transactions, training the training set by adopting a preset neural network framework to obtain a classification model, predicting the transaction to be predicted by adopting the classification model to obtain the event occurring after the transaction to be predicted, and compared with the mode of predicting the correlated event according to experience in the prior art, the method for predicting the correlated event by adopting a neural network algorithm greatly improves the efficiency and accuracy of the method for determining the correlation between the knowledge graph events.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A method for extracting event relations based on a neural network is characterized by comprising the following steps:
sequencing all events in the knowledge-graph by time;
dividing the sequenced events according to a preset time window to obtain a plurality of transactions, wherein at least one transaction comprises the events;
constructing a training set according to the affairs, wherein the training set comprises a plurality of training data;
inputting the training data into a preset neural network framework for training to obtain a classification model;
and predicting the transaction to be predicted by using the classification model to obtain the occurrence probability of each event, and determining the event occurring after the transaction to be predicted according to the probability.
2. The method of claim 1, wherein constructing a training set from the transactions, the training set comprising a plurality of training data comprises:
extracting a preset number of events from the transaction to obtain an event combination, wherein the preset number is greater than or equal to 2;
and constructing the training set according to the event combination and the labeling label.
3. The method of claim 2, wherein constructing the training set from the event combinations and annotation tags comprises:
numbering all the events in the event list, wherein a plurality of the event representations are respectively E1, E2, E3, E4 and … EK, the number corresponding to each event is 4, 5, 6, 7 and … K +3, and the numbers corresponding to < PAD >, < S >, < E > and < UNK > are respectively 0, 1, 2 and 3, the < PAD > is used for complementing the input length, the < S > is used for representing a string of the event starting symbols, the < E > is used for representing a string of the event ending, and the < UNK > is used for representing that the event at the position is not in the database;
determining a number form corresponding to the event combination according to the number of the event, < PAD >, the number of < S >, the number of < E > and the number of < UNK >;
in the case where the event occurring after the transaction is an EM, constructing the annotation tag, which is represented as
Figure FDA0002348416260000011
Wherein four 0 s respectively represent a special symbol<PAD>,<S>,<E>And<UNK>and corresponding label, K represents the total number of the events, p is a hyperparameter, p is 0.9, the probability of the event EM is p, and the probabilities of other events are p
Figure FDA0002348416260000012
And establishing the training set according to the numbering form and the labeling label corresponding to the event combination.
4. The method of claim 3, wherein inputting the training data into a predetermined neural network framework for training, resulting in a classification model, comprises:
and taking the numbering form as the input of the preset neural network framework, taking the label as the output of the preset neural network framework, and training to obtain the classification model.
5. The method of claim 3, wherein predicting transactions to be predicted using the classification model to obtain a probability of occurrence of each of the events, and determining the events occurring after the transactions to be predicted according to the probabilities comprises:
predicting each event combination respectively by using the classification model to obtain the probability of each event after the last event of each event combination;
and selecting the event with the maximum probability as the event which occurs after the last event of the transaction to be predicted.
6. The method according to any one of claims 1 to 5, wherein the predetermined time window is at least one of:
one week, one month, one quarter, one year.
7. The method of any one of claims 1 to 5, wherein the predetermined neural network framework is at least one of:
CNN、BLSTM、transformer-encoder。
8. an apparatus for extracting event relationships based on a neural network, comprising:
the sequencing unit is used for sequencing all events in the knowledge graph according to time;
the dividing unit is used for dividing the sequenced events according to a preset time window to obtain a plurality of transactions, and at least one transaction comprises the events;
the construction unit is used for constructing a training set according to the affairs, and the training set comprises a plurality of training data;
the training unit is used for inputting the training data into a preset neural network framework for training to obtain a classification model;
and the determining unit is used for predicting the transaction to be predicted by using the classification model to obtain the occurrence probability of each event, and determining the event occurring after the transaction to be predicted according to the probability.
9. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program performs the method of any one of claims 1 to 7.
10. A processor, characterized in that the processor is configured to run a program, wherein the program when running performs the method of any of claims 1 to 7.
CN201911405157.1A 2019-12-30 2019-12-30 Method, device and processor for extracting event relationship based on neural network Active CN111143578B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911405157.1A CN111143578B (en) 2019-12-30 2019-12-30 Method, device and processor for extracting event relationship based on neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911405157.1A CN111143578B (en) 2019-12-30 2019-12-30 Method, device and processor for extracting event relationship based on neural network

Publications (2)

Publication Number Publication Date
CN111143578A true CN111143578A (en) 2020-05-12
CN111143578B CN111143578B (en) 2023-12-22

Family

ID=70522301

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911405157.1A Active CN111143578B (en) 2019-12-30 2019-12-30 Method, device and processor for extracting event relationship based on neural network

Country Status (1)

Country Link
CN (1) CN111143578B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111680170A (en) * 2020-06-11 2020-09-18 南京星火技术有限公司 Method and device for predicting physical characteristics of periodic structure and related product
CN112231447A (en) * 2020-11-21 2021-01-15 杭州投知信息技术有限公司 Method and system for extracting Chinese document events
CN112287996A (en) * 2020-10-27 2021-01-29 南京莱斯信息技术股份有限公司 Major event key factor mining method based on machine learning
CN113626609A (en) * 2021-08-10 2021-11-09 南方电网数字电网研究院有限公司 Electric power measurement knowledge map construction method, device, equipment and storage medium
CN114417721A (en) * 2022-01-19 2022-04-29 北京万旺科技有限公司 Event sequence prediction model construction method, prediction method, device and terminal
CN114706992A (en) * 2022-02-17 2022-07-05 中科雨辰科技有限公司 Event information processing system based on knowledge graph

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180082197A1 (en) * 2016-09-22 2018-03-22 nference, inc. Systems, methods, and computer readable media for visualization of semantic information and inference of temporal signals indicating salient associations between life science entities
CN108563653A (en) * 2017-12-21 2018-09-21 清华大学 A kind of construction method and system for knowledge acquirement model in knowledge mapping
CN108733792A (en) * 2018-05-14 2018-11-02 北京大学深圳研究生院 A kind of entity relation extraction method
CN109885698A (en) * 2019-02-13 2019-06-14 北京航空航天大学 A kind of knowledge mapping construction method and device, electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180082197A1 (en) * 2016-09-22 2018-03-22 nference, inc. Systems, methods, and computer readable media for visualization of semantic information and inference of temporal signals indicating salient associations between life science entities
CN108563653A (en) * 2017-12-21 2018-09-21 清华大学 A kind of construction method and system for knowledge acquirement model in knowledge mapping
CN108733792A (en) * 2018-05-14 2018-11-02 北京大学深圳研究生院 A kind of entity relation extraction method
CN109885698A (en) * 2019-02-13 2019-06-14 北京航空航天大学 A kind of knowledge mapping construction method and device, electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
庄传志;靳小龙;朱伟建;刘静伟;白龙;程学旗;: "基于深度学习的关系抽取研究综述" *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111680170A (en) * 2020-06-11 2020-09-18 南京星火技术有限公司 Method and device for predicting physical characteristics of periodic structure and related product
CN111680170B (en) * 2020-06-11 2023-05-02 南京星火技术有限公司 Physical characteristic prediction method and device of periodic structure and related products
CN112287996A (en) * 2020-10-27 2021-01-29 南京莱斯信息技术股份有限公司 Major event key factor mining method based on machine learning
CN112287996B (en) * 2020-10-27 2023-03-24 南京莱斯信息技术股份有限公司 Major event key factor mining method based on machine learning
CN112231447A (en) * 2020-11-21 2021-01-15 杭州投知信息技术有限公司 Method and system for extracting Chinese document events
CN113626609A (en) * 2021-08-10 2021-11-09 南方电网数字电网研究院有限公司 Electric power measurement knowledge map construction method, device, equipment and storage medium
CN113626609B (en) * 2021-08-10 2024-03-26 南方电网数字电网研究院有限公司 Electric power metering knowledge graph construction method, device, equipment and storage medium
CN114417721A (en) * 2022-01-19 2022-04-29 北京万旺科技有限公司 Event sequence prediction model construction method, prediction method, device and terminal
CN114417721B (en) * 2022-01-19 2023-03-03 北京万旺科技有限公司 Event sequence prediction model construction method, prediction method, device and terminal
CN114706992A (en) * 2022-02-17 2022-07-05 中科雨辰科技有限公司 Event information processing system based on knowledge graph
CN114706992B (en) * 2022-02-17 2022-09-30 中科雨辰科技有限公司 Event information processing system based on knowledge graph

Also Published As

Publication number Publication date
CN111143578B (en) 2023-12-22

Similar Documents

Publication Publication Date Title
CN111143578A (en) Method, device and processor for extracting event relation based on neural network
Verenich et al. Survey and cross-benchmark comparison of remaining time prediction methods in business process monitoring
WO2019128526A1 (en) Method, apparatus, and device for training risk control model and risk control
CN107423278B (en) Evaluation element identification method, device and system
US20150032708A1 (en) Database analysis apparatus and method
CN111080304B (en) Credible relationship identification method, device and equipment
CN109684476B (en) Text classification method, text classification device and terminal equipment
CN110674188A (en) Feature extraction method, device and equipment
CN111159428A (en) Method and device for automatically extracting event relation of knowledge graph in economic field
WO2021129121A1 (en) Table recognition method and device, and computer-readable storage medium
CN110347724A (en) Abnormal behaviour recognition methods, device, electronic equipment and medium
US20190130030A1 (en) Generation method, generation device, and recording medium
CN111178533B (en) Method and device for realizing automatic semi-supervised machine learning
CN111831629A (en) Data processing method and device
US20180247226A1 (en) Classifier
CN106878242B (en) Method and device for determining user identity category
CN107392311A (en) The method and apparatus of sequence cutting
CN113837635A (en) Risk detection processing method, device and equipment
CN111259975B (en) Method and device for generating classifier and method and device for classifying text
CN106874286B (en) Method and device for screening user characteristics
CN115774784A (en) Text object identification method and device
Mandal et al. Improving it support by enhancing incident management process with multi-modal analysis
CN112183622B (en) Mobile application bots installation cheating detection method, device, equipment and medium
CN114840642A (en) Event extraction method, device, equipment and storage medium
CN114358284A (en) Method, device and medium for training neural network step by step based on category information

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200804

Address after: 1608, 14 / F, No. 65, Beisihuan West Road, Haidian District, Beijing 100080

Applicant after: BEIJING INTERNETWARE Ltd.

Address before: No. 603, floor 6, No. 9, Shangdi 9th Street, Haidian District, Beijing 100085

Applicant before: Smart Shenzhou (Beijing) Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant