CN111143578B - Method, device and processor for extracting event relationship based on neural network - Google Patents

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

Info

Publication number
CN111143578B
CN111143578B CN201911405157.1A CN201911405157A CN111143578B CN 111143578 B CN111143578 B CN 111143578B CN 201911405157 A CN201911405157 A CN 201911405157A CN 111143578 B CN111143578 B CN 111143578B
Authority
CN
China
Prior art keywords
event
events
transaction
probability
neural network
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
CN201911405157.1A
Other languages
Chinese (zh)
Other versions
CN111143578A (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
Beijing Internetware 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 Beijing Internetware Ltd filed Critical Beijing Internetware 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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Animal Behavior & Ethology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

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 relationship comprises the following steps: ordering all events in the knowledge graph according to time; dividing the ordered 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 transaction, 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; 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. The neural network algorithm is adopted to predict the associated events, so that the efficiency and accuracy of the method for determining the association relationship between the knowledge graph events are greatly improved.

Description

Method, device and processor for extracting event relationship based on neural network
Technical Field
The application relates to the field of knowledge maps, in particular to a method, a device, a storage medium and a processor for extracting event relations based on a neural network.
Background
The event knowledge graph is still in the development stage, and a great number of technical problems still need to be solved at present, wherein the analysis of the association relation between events is a difficult problem. The association relationship refers to whether one event affects another event, including causality, opposition, turning, forward, and so on. The data expression modes of the events in the knowledge graph are divided into structured data and unstructured data. The structured data of an event typically contains attributes of the event type, trigger words, arguments, roles. The unstructured data of an event typically contains attributes such as the topic name of the event, the time of the event, the subject, the object, etc., except for the topic name, it is not required that each attribute must have an attribute value, and there may be an attribute of the attribute (e.g., the subject has its own attribute).
The association relation between the events is determined currently, which requires an expert in the field, the association relation of the events is written into rules according to the deep knowledge and experience of the field, and the association relation between the subject events (such as gold price rising caused by American joint storage and settlement) is determined by rule matching when the association relation is used. The implementation mode needs the deep participation of economic financial experts in the knowledge graph construction, and through the cooperation of engineering technicians, the knowledge and experience of the experts are converted into knowledge graph architecture, logic and even codes, and the landing difficulty is conceivable. Algorithms (e.g., FP-tree) may also be provided to reduce the above-mentioned manual effort and automatically mine association rules between events. The accuracy of rules excavated by the excavation algorithm is generally not high, the excavated relations are further confirmed manually, and finally the rules are formed.
The above information disclosed in the background section is only for enhancement of understanding of the background art from the technology described herein and, therefore, may contain some information that does not form the prior art that is already known in the country to a person of ordinary skill in the art.
Disclosure of Invention
The main purpose of the application is 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 efficiency of a method for determining the association relations between knowledge graph events in the prior art is low.
To achieve the above object, according to one aspect of the present application, there is provided a method of extracting an event relationship based on a neural network, the method of extracting an event relationship including: ordering all events in the knowledge graph according to time; dividing the ordered 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 transaction, 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; 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, a training set is constructed according to the transaction, the training set comprises a plurality of training data, and the method comprises the following steps: extracting a preset number of events from the transaction to obtain event combinations, wherein the preset number is more 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 labeling label comprises the following steps: 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 corresponding numbers of the events are 4, 5, 6, 7 and … K+3, and are defined<PAD>、<S>、<E>And<UNK>The corresponding numbers are 0, 1, 2 and 3 respectively,<PAD>the representation is used to complement the input length,<S>representing a series of the event start symbols,<E>indicating the end of a series of said events,<UNK>the event representing this location is not in the database; according to the number of the event,<PAD>Numbering of (2),<S>Numbering of (2),<E>Is numbered according to the number of (2)<UNK>Determining the number form corresponding to the event combination; in the event that occurs after the transaction occurs is an EM, constructing the annotation tag, the annotation tag being expressed asWherein four 0's respectively represent special symbols <PAD>,<S>,<E>And<UNK>The corresponding label, K represents the total number of the events, p is a super parameter, let p=0.9, let the probability of occurrence of the event EM be p, let the probability of occurrence of other events be +.>And constructing the training set according to the numbered forms corresponding to the event combinations and the labeling labels.
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 frame, taking the labeling label as the output of the preset neural network frame, and training to obtain the classification model.
Further, 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, including: respectively 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 largest occurrence probability as the event occurring 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, transformer-encoder. .
According to another aspect of the present application, there is provided an apparatus for extracting event relationships based on a neural network, including: the sequencing unit is used for sequencing all the events in the knowledge graph according to time; the dividing unit is used for dividing the ordered events according to a preset time window to obtain a plurality of transactions, and each transaction consists of at least one event; a building unit, configured to build a training set according to the transaction, where the training set includes a plurality of training data; the training unit is used for inputting the training data into a preset neural network frame for training to obtain a classification model; and the determining unit predicts the transaction to be predicted by using the classification model to obtain the occurrence probability of each event, and determines the event occurring after the transaction to be predicted according to the probability.
According to another aspect of the present application, there is provided a storage medium including a stored program, wherein the program performs any one of the methods.
According to another aspect of the present application, there is provided a processor for running a program, wherein the program when run performs any one of the methods.
According to the technical scheme, all events in a knowledge graph are ordered according to time, the ordered events are divided according to a preset time window to obtain a plurality of transactions, each transaction consists of at least one event, a training set is constructed according to the transactions, the training set comprises a plurality of training data, the training data are input into a preset neural network framework to be trained to obtain a classification model, finally, the classification model is used for predicting the events to be predicted to obtain the occurrence probability of each event, and the events which occur after the events to be predicted are determined according to the probability. All events in the knowledge graph are ordered according to time, the ordered events are divided according to a preset time window, a plurality of events are obtained, the events are composed of at least one event, a training set is built through the plurality of events, training is conducted through a preset neural network framework, a classification model is obtained, the events to be predicted are predicted through the classification model, the events occurring after the events to be predicted are obtained, and compared with the mode of predicting the associated events according to experience in the prior art, the method adopts a neural network algorithm to predict the associated events, and therefore efficiency and accuracy of a determination method of association relations between the knowledge graph events are greatly improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and 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 do not constitute an undue limitation to the application. In the drawings:
FIG. 1 illustrates a flow chart of a method for extracting event relationships based on a neural network, according to an embodiment of the present application; and
fig. 2 shows 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, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the present application described herein. 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. Furthermore, in the description and in the 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 method for determining the association relationship between the knowledge graph events in the prior art is not efficient, and in order to solve the technical problems, a method, a device, a storage medium and a processor for extracting the event relationship based on a neural network are provided.
According to an embodiment of the application, a method for extracting event relationships based on a neural network is provided. FIG. 1 is a flow chart 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, ordering all events in the knowledge graph according to time;
step S102, dividing the ordered 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 transaction, 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;
step S105, 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.
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 other than that illustrated herein.
In the above scheme, firstly, all events in a knowledge graph are ordered according to time, secondly, the ordered 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, the training data are input into a preset neural network framework for training to obtain a classification model, finally, the classification model is used for predicting the events to be predicted to obtain the occurrence probability of each event, and the events which occur after the events to be predicted are determined according to the probability. All events in the knowledge graph are ordered according to time, the ordered events are divided according to a preset time window, a plurality of events are obtained, the events are composed of at least one event, a training set is built through the plurality of events, training is conducted through a preset neural network framework, a classification model is obtained, the events to be predicted are predicted through the classification model, the events occurring after the events to be predicted are obtained, and compared with the mode of predicting the associated events according to experience in the prior art, the method adopts a neural network algorithm to predict the associated events, and therefore efficiency and accuracy of a determination method of association relations between the knowledge graph events are greatly improved.
It should be noted that, all events in the knowledge graph are ordered according to the events, the size of the event window is set to be W, all events are divided according to the time windows, and the events in each time window are ordered according to the occurrence time. For example as shown in the following table:
i= { E1, E2, E3, E4, E5,.} is called a set of items, 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 on a weekly basis. The association mining is to find out the association between several events, such as { E2, E3 = > { E1}, which means that if E2 and E3 occur, E1 is likely to occur as well.
In one 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 includes: and extracting a preset number of the events from the transaction to obtain event combinations, wherein the preset number is more than or equal to 2, and constructing the training set according to the event combinations and the labeling labels. Given the integer K, from all events in each transaction, all combinations of events less than K and greater than 2 are extracted, the last event of all extracted combinations is taken as a label, and other events are network inputs. For example, one transaction contains events of t= { E1, E2, E3, E4, E1}, E1 to E4 are arranged in time, E1 occurs twice, and k=3 is set, so that all 3 events to be extracted are combined with 2 events:
{{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 required to be trained can be provided when the events are numbered later.
In an embodiment of the present application, constructing the training set according to the event combination and the labeling includes: numbering all the events in the event list, wherein the events are represented by E1, E2, E3, E4 and … EK respectively, and the numbers corresponding to the events are 4, 5, 6, 7 and … K+3 respectively, and are defined<PAD>、<S>、<E>And<UNK>The corresponding numbers are respectively 0, 1, 2 and 3,<PAD>the representation is used to complement the input length,<S>representing a series of the event start symbols described above,<E>indicating the end of a series of such events,<UNK>the event indicating the position is not in the database, and is based on the number of the event,<PAD>Numbering of (2),<S>Numbering of (2),<E>Is numbered according to the number of (2)<UNK>In the event of EM, the label is constructed, and the label is expressed asWherein four 0's respectively represent special symbols<PAD>,<S>,<E>And<UNK>The corresponding label, K represents the total number of the events, p is a super parameter, let p=0.9, let the probability of occurrence of the event EM be p, let the probability of occurrence of other events be +. >The training set is constructed according to the number form and the label corresponding to the event combination, and p can be set to other proper values in practical application.
Taking { E1, E2, E3, E4} = > { E1} as an example, the input data is < S >, E1, E2, E3, E4, < E >.
Conversion to numbered form
1,4,5,6,7,2。
The labeling label is as follows:
assuming that K events are total, p is arranged at the number position of E1, wherein p is a super parameter, the super parameter needs to be specified before training, and p=0.9 is generally set, so that more efficient and accurate labeling is provided when probability calculation is performed subsequently, the effectiveness of data is provided for numbering the events, and the performance and effect of machine learning are provided by applying the super parameter.
In one embodiment of the present application, the training data is input to a predetermined neural network frame for training, to obtain a classification model, including: and training the numbering form as the input of the preset neural network frame and the labeling label as the output of the preset 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 the prediction transaction more efficiently and accurately.
In an embodiment of the present application, predicting a transaction to be predicted using the classification model to obtain a probability of occurrence of each event, determining, according to the probability, the event occurring after the transaction to be predicted, including: and respectively 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.
Setting an output probability threshold t, sequentially using model prediction for event combinations in new things, and selecting an event with the maximum probability and greater than t as a final output. For example, with a new transaction t= { E1, E2, E3, E4, E5}, let k=4, t=0.5, it is now predicted what event is most likely to occur after event E5 occurs. Sequentially calculating by using the model:
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 the fact that,
max(0.9,0.8,0.7,0.6)=0.9>t=0.5,
then select
B=E1,
The final result is { E2, E3, E4, E5} = > E1.
I.e. E2, E3, E4, E5, then the probability of occurrence of immediately following E1 is 0.9, thus obtaining the probability of occurrence of a transaction after the transaction to be predicted, and finding the one with the largest probability, i.e. the most likely probability of occurrence, according to the calculated probability, the expert can know what event is likely to occur next according to the probability, and take corresponding measures for processing.
In one embodiment of the present application, the predetermined time window is at least one of: one week, one month, one quarter, one year.
Of course, the time window may be determined according to practical situations, for example, two weeks, two months, two quarters, and half a year may be selected, and other suitable ranges may be selected.
In one embodiment of the present application, the predetermined neural network frame is at least one of the following: CNN, BLSTM, transformer-encoder. The application of the neural network frame can make machine learning clearer, has high readability and can improve learning speed, and of course, the preset neural network frame is not limited to the above-mentioned several types, and can be selected according to practical situations, for example, other neural network frames such as Tensorflow, caffe, theano, MXNET and the like can be selected.
The embodiment of the application also provides a device for extracting the event relationship based on the neural network, and it should be noted that the device for extracting the event relationship based on the neural network in the embodiment of the application can be used for executing the method for extracting the event relationship based on the neural network provided in the embodiment of the application. The following describes a device 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 ranking unit 10, configured to rank all events in the knowledge graph according to time;
a dividing unit 20, configured to divide the ordered events according to a predetermined time window, so as to obtain a plurality of transactions, where at least one of the transactions includes the event;
A construction 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 frame for training, so as to obtain a classification model;
the determining unit 50 predicts the transaction to be predicted by using the classification model to obtain the probability of each event, and determines the event occurring after the transaction to be predicted according to the probability.
In the above device, the sorting unit sorts all the events in the knowledge graph according to time, the dividing unit divides the sorted events according to a predetermined time window to obtain a plurality of transactions, each transaction is composed of at least one of the events, the constructing unit constructs a training set according to the transactions, the training set includes a plurality of training data, the training unit inputs the training data into a predetermined neural network frame to train to obtain a classification model, the determining unit predicts the transactions to be predicted by using the classification model to obtain the occurrence probability of each event, and the events occurring after the transactions to be predicted are determined according to the probability. All events in the knowledge graph are ordered according to time, the ordered events are divided according to a preset time window, a plurality of events are obtained, the events are composed of at least one event, a training set is built through the plurality of events, training is conducted through a preset neural network framework, a classification model is obtained, the events to be predicted are predicted through the classification model, the events occurring after the events to be predicted are obtained, and compared with the mode of predicting the associated events according to experience in the prior art, the method adopts a neural network algorithm to predict the associated events, and therefore efficiency and accuracy of a determination method of association relations between the knowledge graph events are greatly improved.
It should be noted that, all events in the knowledge graph are ordered according to the events, the size of the event window is set to be W, all events are divided according to the time windows, and the events in each time window are ordered according to the occurrence time. For example as shown in the following table:
t1=1 week E1,E2,...
T2=2 weeks E3,...
T3=3 weeks E4,E5,...
T4=4 weeks E1,E2,E3,...
T5=5 weeks E2,...
... ...
I= { E1, E2, E3, E4, E5,.} is called a set of items, 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 on a weekly basis. The association mining is to find out the association between several events, such as { E2, E3 = > { E1}, which means that if E2 and E3 occur, E1 is likely to occur as well.
In one embodiment of the present application, the building unit includes an extraction module and a building module, where the extraction module is configured to extract a predetermined number of the events from the transaction to obtain an event combination, where the predetermined number is greater than or equal to 2, and the building module is configured to build the training set according to the event combination and the label. Given the integer K, from all events in each transaction, all combinations of events less than K and greater than 2 are extracted, the last event of all extracted combinations is taken as a label, and other events are network inputs. For example, one transaction contains events of t= { E1, E2, E3, E4, E1}, E1 to E4 are arranged in time, E1 occurs twice, and k=3 is set, then all 3 events to be extracted and a combination of 2 events:
{{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 required to be trained can be provided when the events are numbered later.
In one embodiment of the present application, the building module includes a coding sub-module, a determining sub-module, a first building sub-module and a second building sub-module, and the numbering sub-module is configured to number all the events in the event list, where a plurality of the events are represented by E1, E2, E3, E4, … EK, and the numbers corresponding to the events are 4, 5, 6, 7, … k+3, and are defined<PAD>、<S>、<E>And<UNK>The corresponding numbers are respectively 0, 1, 2 and 3,<PAD>the representation is used to complement the input length,<S>representing a series of the event start symbols described above,<E>indicating the end of a series of such events,<UNK>the event indicating the position is not in the database, and the determination submodule is used for determining the number of the event,<PAD>Numbering of (2),<S>Numbering of (2),<E>Is numbered according to the number of (2)<UNK>Determining a corresponding numbering form of the event combination, wherein the first construction submodule is used for constructing the labeling label when the event occurring after the event occurs is EM, Wherein four 0's respectively represent special symbols<PAD>,<S>,<E>And<UNK>The corresponding label, K represents the total number of the events, p is a super parameter, let p=0.9, let the probability of occurrence of the event EM be p, let the probability of occurrence of other events be +.>The second construction submodule is used for constructing the training set according to the numbering form and the labeling label corresponding to the event combination, and of course, p can be made to be 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>。
converting into a numbered form:
1,4,5,6,7,2。
the labeling label is as follows:
assuming that K events are total, p is arranged at the number position of E1, wherein p is a super parameter, the super parameter needs to be specified before training, and p=0.9 is generally set, so that more efficient and accurate labeling is provided when probability calculation is performed subsequently, the effectiveness of data is provided for numbering the events, and the performance and effect of machine learning are provided by applying the super parameter.
In one implementation of the present application, the training unit includes a training module, configured to train the number form as an input of the predetermined neural network frame and the label tag as an output of the predetermined neural network frame, so as 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 the prediction transaction more efficiently and accurately.
In an embodiment of the present application, the determining unit includes a prediction module and a selection module, where the prediction module is configured to predict each of the event combinations by using the classification model to obtain a probability of occurrence of each of the events after a last of the event combinations, and the selection module is configured to select the event with the highest probability of occurrence as the event occurring after the last of the events of the transaction to be predicted.
Setting an output probability threshold t, sequentially using model prediction for event combinations in new things, and selecting an event with the maximum probability and greater than t as a final output. For example, with a new transaction t= { E1, E2, E3, E4, E5}, let k=4, t=0.5, it is now predicted what event is most likely to occur after event E5 occurs. Sequentially calculating by using the model:
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 is { E2, E3, E4, E5} = > E1.
I.e. E2, E3, E4, E5, then the probability of occurrence of immediately following E1 is 0.9, thus obtaining the probability of occurrence of a transaction after the transaction to be predicted, and finding the one with the largest probability, i.e. the most likely probability of occurrence, according to the calculated probability, the expert can know what event is likely to occur next according to the probability, and take corresponding measures for processing.
In one embodiment of the present application, the predetermined time window is at least one of: one week, one month, one quarter, one year.
Of course, the time window may be determined according to practical situations, for example, two weeks, two months, two quarters, and half a year may be selected, and other suitable ranges may be selected.
In one embodiment of the present application, the predetermined neural network frame is at least one of the following: CNN, BLSTM, transformer-encoder. The application of the neural network frame can make machine learning clearer, has high readability and can improve learning speed, and of course, the preset neural network frame is not limited to the above-mentioned several types, and can be selected according to practical situations, for example, other neural network frames such as Tensorflow, caffe, theano, MXNET and the like can be selected.
The device for extracting the event relationship based on the neural network comprises a processor and a memory, wherein the sorting unit, the dividing unit, the constructing unit, the training unit, the determining unit and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one, and the efficiency of the method for determining the association relationship between the knowledge-graph events is improved by adjusting the kernel parameters.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the invention provides a storage medium, and a program is stored on the storage medium, and the program is executed by a processor to realize the method for extracting event relations 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 stored in the memory and capable of running on the processor, wherein the processor realizes at least the following steps when executing the program:
step S101, ordering all events in the knowledge graph according to time;
step S102, dividing the ordered 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 transaction, 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;
step S105, 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.
The device herein may be a server, PC, PAD, cell phone, etc.
The present application also provides a computer program product adapted to perform a program initialized with at least the following method steps when executed on a data processing device:
step S101, ordering all events in the knowledge graph according to time;
step S102, dividing the ordered 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 transaction, 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;
step S105, 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.
It will be appreciated by those skilled in the art that 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 flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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 one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. 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 storage media for a computer 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, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
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 one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
1) According to the neural network based event relation extraction method, firstly, all events in a knowledge graph are ordered according to time, secondly, the ordered events are divided according to a preset time window to obtain a plurality of events, each event is composed of at least one event, then a training set is constructed according to the events, the training set comprises a plurality of training data, the training data are input into a preset neural network framework to be trained, a classification model is obtained, finally, the classification model is used for predicting the events to be predicted, the occurrence probability of each event is obtained, and the events which occur after the events to be predicted are determined according to the probability. All events in the knowledge graph are ordered according to time, the ordered events are divided according to a preset time window, a plurality of events are obtained, the events are composed of at least one event, a training set is built through the plurality of events, training is conducted through a preset neural network framework, a classification model is obtained, the events to be predicted are predicted through the classification model, the events occurring after the events to be predicted are obtained, and compared with the mode of predicting the associated events according to experience in the prior art, the method adopts a neural network algorithm to predict the associated events, and therefore efficiency and accuracy of a determination method of association relations between the knowledge graph events are greatly improved.
2) According to the device for extracting the event relation based on the neural network, a sorting unit sorts all events in a knowledge graph according to time, a dividing unit divides the sorted events according to a preset time window to obtain a plurality of transactions, each transaction consists of at least one event, a building unit builds 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 frame to train to obtain a classification model, a determining unit predicts the events to be predicted by using the classification model to obtain the occurrence probability of each event, and the events which occur after the events to be predicted are determined according to the probability. All events in the knowledge graph are ordered according to time, the ordered events are divided according to a preset time window, a plurality of events are obtained, the events are composed of at least one event, a training set is built through the plurality of events, training is conducted through a preset neural network framework, a classification model is obtained, the events to be predicted are predicted through the classification model, the events occurring after the events to be predicted are obtained, and compared with the mode of predicting the associated events according to experience in the prior art, the method adopts a neural network algorithm to predict the associated events, and therefore efficiency and accuracy of a determination method of association relations between the knowledge graph events are greatly improved.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims (8)

1. A method for extracting event relationships based on a neural network, comprising:
ordering all events in the knowledge graph according to time;
dividing the ordered 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 transaction, 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;
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;
building a training set according to the transaction, wherein the training set comprises a plurality of training data and comprises:
extracting a preset number of events from the transaction to obtain event combinations, wherein the preset number is more than or equal to 2;
Constructing the training set according to the event combination and the labeling label;
constructing the training set according to the event combination and the labeling label, including:
numbering all the events in the event list, wherein a plurality of the events are respectively denoted as E1, E2, E3, E4 and … EK, the numbers corresponding to the events are respectively denoted as 4, 5, 6, 7 and … K+3, and the numbers corresponding to the < PAD >, < S >, < E > and < UNK > are respectively defined as 0, 1, 2 and 3, the < PAD > is used for complementing the input length, the < S > is used for representing a series of the event start symbols, the < E > is used for representing a series of the event end, and the events corresponding to the < UNK > are not in the database;
determining a number form corresponding to the event combination according to the number of the event, < PAD >, < S >, < E >, and < UNK >;
in the event that occurs after the transaction occurs is an EM, constructing the annotation tag, the annotation tag being expressed asWherein four 0's respectively represent special symbols<PAD>,<S>,<E>And<UNK>The corresponding label, K represents the total number of the events, p is a super parameter, let p=0.9, let the probability of occurrence of the event EM be p, let the probability of occurrence of other events be +. >And constructing the training set according to the numbered forms corresponding to the event combinations and the labeling labels.
2. The method of claim 1, wherein inputting the training data into a predetermined neural network framework for training to obtain a classification model, comprising:
and taking the numbering form as the input of the preset neural network frame, taking the labeling label as the output of the preset neural network frame, and training to obtain the classification model.
3. The method of claim 1, wherein predicting the transaction to be predicted using the classification model to obtain a probability of occurrence of each of the events, determining the event occurring after the transaction to be predicted based on the probability, comprises:
respectively 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 largest occurrence probability as the event occurring after the last event of the transaction to be predicted.
4. A method according to any one of claims 1 to 3, wherein the predetermined time window is at least one of:
One week, one month, one quarter, one year.
5. A method according to any one of claims 1 to 3, wherein the predetermined neural network framework is at least one of:
CNN、BLSTM、transformer-encoder。
6. an apparatus for extracting event relationships based on a neural network, comprising:
the sequencing unit is used for sequencing all the events in the knowledge graph according to time;
the dividing unit is used for dividing the ordered events according to a preset time window to obtain a plurality of transactions, and at least one transaction comprises the events;
a building unit, configured to build a training set according to the transaction, where the training set includes a plurality of training data;
the training unit is used for inputting the training data into a preset neural network frame for training to obtain a classification model;
the determining unit predicts the transaction to be predicted by using the classification model to obtain the occurrence probability of each event, and determines the event occurring after the transaction to be predicted according to the probability;
a building unit comprising:
the extraction module is used for extracting a preset number of events from the transaction to obtain event combinations, wherein the preset number is more than or equal to 2;
The construction module is used for constructing the training set according to the event combination and the labeling label;
a build module, comprising:
a coding sub-module, configured to number all the events in the event list, where a plurality of the events represent E1, E2, E3, E4, … EK, respectively, and each of the events corresponds to a number of 4, 5, 6, 7, … k+3, and defines < PAD >, < S >, < E >, and < UNK > to correspond to the numbers of 0, 1, 2, and 3, respectively, where < PAD > represents a length of input for complementing, where < S > represents a series of the event start symbols, where < E > represents a series of the events end, and where < UNK > represents that the event at the location is not in the database;
a determining submodule, configured to determine a number form corresponding to the event combination according to the number of the event, < PAD > number, < S > number, < E > number, and < UNK > number;
a first construction sub-module for constructing the labeling label in case that the event occurring after the transaction is EM, the labeling label is expressed asWherein four 0's respectively represent special symbols<PAD>,<S>,<E>And<UNK>The corresponding label, K represents the total number of the events, p is a super parameter, let p=0.9, let the probability of occurrence of the event EM be p, let the probability of occurrence of other events be +. >
And the second construction sub-module is used for constructing the training set according to the numbered forms corresponding to the event combinations and the labeling labels.
7. A storage medium comprising a stored program, wherein the program performs the method of any one of claims 1 to 5.
8. A processor for running a program, wherein the program when run performs the method of any one of claims 1 to 5.
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 CN111143578A (en) 2020-05-12
CN111143578B true 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)

Families Citing this family (6)

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

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10360507B2 (en) * 2016-09-22 2019-07-23 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

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
庄传志 ; 靳小龙 ; 朱伟建 ; 刘静伟 ; 白龙 ; 程学旗 ; .基于深度学习的关系抽取研究综述.中文信息学报.2019,(12),全文. *

Also Published As

Publication number Publication date
CN111143578A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
CN111143578B (en) Method, device and processor for extracting event relationship based on neural network
Verenich et al. Survey and cross-benchmark comparison of remaining time prediction methods in business process monitoring
EP3467723B1 (en) Machine learning based network model construction method and apparatus
US11861462B2 (en) Preparing structured data sets for machine learning
US20150032708A1 (en) Database analysis apparatus and method
US11514369B2 (en) Systems and methods for machine learning model interpretation
US11379710B2 (en) Personalized automated machine learning
US11841839B1 (en) Preprocessing and imputing method for structural data
US11620453B2 (en) System and method for artificial intelligence driven document analysis, including searching, indexing, comparing or associating datasets based on learned representations
CN114359563B (en) Model training method, device, computer equipment and storage medium
CN110490304B (en) Data processing method and device
CN111178533B (en) Method and device for realizing automatic semi-supervised machine learning
CN111882426A (en) Business risk classifier training method, device, equipment and storage medium
CN113837635A (en) Risk detection processing method, device and equipment
CN110019784B (en) Text classification method and device
CN114139490A (en) Method, device and equipment for automatic data preprocessing
CN116304748A (en) Text similarity calculation method, system, equipment and medium
CN115456421A (en) Work order dispatching method and device, processor and electronic equipment
CN115186738B (en) Model training method, device and storage medium
US20190065987A1 (en) Capturing knowledge coverage of machine learning models
CN115481803A (en) Financial time sequence prediction method, device and equipment based on industry crowding degree
CN114969253A (en) Market subject and policy matching method and device, computing device and medium
CN111046934B (en) SWIFT message soft clause recognition method and device
CN114115878A (en) Workflow node recommendation method and device
CN111080433A (en) Credit risk assessment method and device

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

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.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant