CN112633483B - Quaternary combination gate map neural network event prediction method, device, equipment and medium - Google Patents

Quaternary combination gate map neural network event prediction method, device, equipment and medium Download PDF

Info

Publication number
CN112633483B
CN112633483B CN202110026128.5A CN202110026128A CN112633483B CN 112633483 B CN112633483 B CN 112633483B CN 202110026128 A CN202110026128 A CN 202110026128A CN 112633483 B CN112633483 B CN 112633483B
Authority
CN
China
Prior art keywords
event
vector
background
events
new
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
CN202110026128.5A
Other languages
Chinese (zh)
Other versions
CN112633483A (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.)
Institute of Automation of Chinese Academy of Science
Original Assignee
Institute of Automation of Chinese Academy of Science
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 Institute of Automation of Chinese Academy of Science filed Critical Institute of Automation of Chinese Academy of Science
Priority to CN202110026128.5A priority Critical patent/CN112633483B/en
Publication of CN112633483A publication Critical patent/CN112633483A/en
Application granted granted Critical
Publication of CN112633483B publication Critical patent/CN112633483B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • 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/048Activation functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/063Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Human Resources & Organizations (AREA)
  • Game Theory and Decision Science (AREA)
  • Development Economics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Neurology (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Traffic Control Systems (AREA)

Abstract

The embodiment of the application relates to a four-element portal map neural network event prediction method, device, equipment and medium, and aims to improve the traditional event prediction precision. The method comprises the following steps: forming a rational map by a plurality of initial background events and a plurality of events to be selected; representing vectors of all events in the event map in a four-element form to obtain an initial background event vector and an initial candidate event vector; performing graph network calculation on the event map by using a four-element portal graph neural network to obtain a plurality of new background event vectors and a plurality of new event vectors to be selected; calculating the vector of the event by using the attention neural network to obtain the whole vector of the background event; and scoring the whole vector and each new candidate event vector, and taking the candidate event corresponding to one candidate event vector with the highest score as a prediction result.

Description

Quaternary combination gate map neural network event prediction method, device, equipment and medium
Technical Field
The embodiment of the application relates to the technical field of data processing, in particular to a four-element portal map neural network event prediction method, device, equipment and medium.
Background
Script event prediction is an important research direction in the field of artificial intelligence, understanding script events is an important step in realizing real artificial intelligence, specifically, script time prediction task is to select a standard answer from a plurality of possible answers according to the existing context, and script event prediction can be applied to reading understanding, intention recognition, dialogue management and the like. In the existing script event prediction method, the context is mainly modeled, and the event prediction is realized by using a model.
In the prior art, one problem is that different components of an event are directly spliced, so that the mutual influence relation between the different components in the event can not be captured well, and the other problem is that modeling is performed based on the event or an event chain, so that the mutual influence relation between different events can not be captured well.
Disclosure of Invention
The embodiment of the application provides a four-element portal map neural network event prediction method, device, equipment and medium. The aim is to improve the traditional event prediction accuracy.
An embodiment of the present application provides a method for predicting a four-tuple portal map neural network event, where the method includes:
Forming a rational map by a plurality of initial background events and a plurality of events to be selected;
representing vectors of the initial background events and the initial candidate events in the event map in a four-element mode to obtain initial background event vectors and initial candidate event vectors;
performing graph network calculation on the event map by using a four-element portal graph neural network to obtain a plurality of new background event vectors and a plurality of new event vectors to be selected;
calculating the plurality of new background event vectors and the plurality of new candidate event vectors by using an attention neural network to obtain an overall vector of the background event;
and scoring the whole vector and each new event vector to be selected, and taking one event to be selected with the highest score as a prediction result.
Optionally, forming a rational map from the plurality of initial background events and the plurality of candidate events includes:
setting a relation between a plurality of initial background events and a plurality of events to be selected;
and forming a rational map by taking a plurality of initial background events and a plurality of events to be selected as nodes and taking the relation between the plurality of initial background events and the plurality of events to be selected as edges.
Optionally, the representing the vectors of the initial background events and the initial candidate events in the event map in a form of four-tuple to obtain an initial background event vector and an initial candidate event vector includes:
Will include the plurality of initial background events and a plurality of initial candidatesVectors of all events within a piece are expressed as v (e s ,e o ,e p ) Where v represents predicate verb e s Representing subject, e o Representing object, e p Representing an entity having a preposition relationship with the predicate verb.
Optionally, before performing graph network calculation on the event map by using a four-element portal graph neural network to obtain a plurality of new background event vectors and a plurality of new candidate event vectors, the method further includes:
collecting a plurality of related events, marking one part of the plurality of related events as background events, and marking the other part of the plurality of related events as events to be selected as a training set;
and inputting the training set into the four-element portal map neural network to train the four-element portal map neural network, so as to obtain a trained four-element portal map neural network.
Optionally, performing graph network calculation on the event map by using a four-element portal graph neural network to obtain a plurality of new background event vectors and a plurality of new candidate event vectors, including:
inputting a representation vector of the event in the event map and an adjacency matrix representing a relationship between the events into the four-tuple portal map neural network;
And the four-element gate map neural network calculates the representation vector of the event and the adjacency matrix to obtain the plurality of new background event vectors and the plurality of new candidate event vectors.
Optionally, calculating the plurality of new background event vectors and the plurality of new candidate event vectors by using an attention neural network to obtain an overall vector of the background event, including:
inputting the plurality of new background event vectors and the plurality of new candidate event vectors into the attention neural network;
for each new candidate event vector of the plurality of new candidate event vectors, performing attention mechanism operation on each new background event vector of the plurality of new background event vectors to obtain a weight coefficient of each new background event vector of the plurality of new background event vectors relative to each new candidate event vector;
and calculating to obtain the integral vector of the background event according to the weight coefficient.
Optionally, scoring the whole vector and each new candidate event vector, and taking the candidate event corresponding to the candidate event vector with the highest score as a prediction result, including:
Calculating Euclidean distances between each new event vector to be selected and the whole vector of the background event according to the whole vector of the background event to obtain a plurality of Euclidean distance values;
and selecting a new candidate event vector corresponding to the minimum value in the plurality of Euclidean distances as the candidate event vector with the highest score, and taking the candidate event corresponding to the candidate event vector with the highest score as a prediction result.
A second aspect of an embodiment of the present application provides a four-tuple portal map neural network event prediction apparatus, including:
the event map construction module is used for constructing event maps from a plurality of initial background events and a plurality of events to be selected;
the quadruple event representation module is used for representing vectors of the initial background events and the initial candidate events in the event map in a quadruple mode to obtain initial background event vectors and initial candidate event vectors;
the four-element portal map neural network module is used for carrying out map network calculation on the event map by using the four-element portal map neural network to obtain a plurality of new background event vectors and a plurality of new event vectors to be selected;
the background fusion module is used for calculating the plurality of new background event vectors and the plurality of new candidate event vectors by using the attention neural network to obtain an overall vector of the background event;
And the background event and candidate event scoring module is used for scoring the whole vector and each new candidate event vector, and taking the candidate event corresponding to the candidate event vector with the highest score as a prediction result.
Optionally, the rational map construction module includes:
the relation setting sub-module is used for setting the relation between a plurality of initial background events and a plurality of events to be selected;
the event map is formed by a sub-module, which is used for forming the event map by taking a plurality of initial background events and a plurality of events to be selected as nodes and taking the relation between the initial background events and the events to be selected as edges.
Optionally, the four-tuple event representation module includes:
a quadruple event representation sub-module for representing vectors of all events including the plurality of initial background events and the plurality of initial candidate events by v (e) s ,e o ,e p ) Where v represents predicate verb e s Representing subject, e o Representing object, e p Representing an entity having a preposition relationship with the predicate verb.
Optionally, the apparatus further comprises:
the event collection module is used for collecting a plurality of related events, and marking one part of the plurality of related events as background events and the other part of the plurality of related events as to-be-selected events as training sets;
And the four-element portal map neural network training module is used for inputting the training set into the four-element portal map neural network to train the four-element portal map neural network, so as to obtain a trained four-element portal map neural network.
Optionally, the four-element portal map neural network module includes:
a first vector input sub-module for inputting a representation vector of an event in the event map and an adjacency matrix representing a relationship between events into the four-tuple portal map neural network;
and the four-atom gate map neural network calculation sub-module is used for calculating the representation vector of the event and the adjacency matrix by the four-element gate map neural network to obtain the plurality of new background event vectors and the plurality of new candidate event vectors.
Optionally, the context fusion module based on the attention mechanism includes:
a second vector input sub-module for inputting the plurality of new background event vectors and the plurality of new candidate event vectors into the attention neural network;
the weight coefficient calculation sub-module is used for carrying out attention mechanism operation on each new background event vector in the new background event vectors aiming at each new event vector to be selected in the new event vectors to obtain the weight coefficient of each new background event vector in the new background event vectors relative to each new event vector to be selected;
And the whole vector obtaining sub-module is used for calculating and obtaining the whole vector of the background event according to the weight coefficient.
Optionally, the scoring module for the background event and the candidate event includes:
the Euclidean distance calculation sub-module is used for calculating the Euclidean distance between each new event vector to be selected and the whole vector of the background event according to the whole vector of the background event to obtain a plurality of Euclidean distance values;
and the prediction result obtaining sub-module selects a new candidate event vector corresponding to the minimum value in the values of the Euclidean distances as the candidate event vector with the highest score, and takes the candidate event corresponding to the candidate event vector with the highest score as the prediction result.
A third aspect of the embodiments of the present application provides a readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method as described in the first aspect of the present application.
A fourth aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the method described in the first aspect of the present application when the processor executes the computer program.
According to the four-component portal view neural network event prediction method, firstly, a collected event is formed into a situation map, the collected event comprises a background event and a to-be-selected event, four components in the vector of each event in the situation map are corresponding to four components of four-component data, the vector of each time is represented in a four-component mode, the vector of the event in the situation map is calculated by using a trained portal view neural network model to obtain a new event vector, the new background event vector and the new to-be-selected event vector are contained, the importance degree of each background event vector to each to-be-selected event vector is calculated by adopting an attention mechanism, the overall vector of the background event is obtained according to the importance degree of each background event vector to each to-be-selected event vector, the Euclidean distance between each to-be-selected event vector and the overall background event vector is calculated, and one to-be-selected event vector closest to the overall background event vector is selected to be the overall background event vector as a prediction result. The invention adopts the four-element group to represent the event, which exactly corresponds to the composition of the event, better captures the interaction between different composition components in the event, uses the gate map neural network to model the interaction between the events, can better capture the interaction between the events, adopts the attention mechanism to fuse the background events, calculates with the event to be selected, can consider the influence of each background event on the event to be selected, and has more accurate prediction.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments of the present application will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a four-tuple gate graph neural network event prediction method according to an embodiment of the present application;
FIG. 2 is a partial calculation flow of different components for Hamiltonian operation based on a four-tuple representation model according to an embodiment of the invention;
FIG. 3 is a schematic illustration of an event representation based on a four-tuple representation model according to an embodiment of the invention;
FIG. 4 is a schematic diagram illustrating an attention mechanism operation performed by a background event and a candidate event based on an attention mechanism according to an embodiment of the present invention;
FIG. 5 is a schematic diagram illustrating an attention mechanism operation performed by a background event and a candidate event based on an attention mechanism according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a scoring model for Euclidean distance calculation based on weighted and summed background events and candidate events according to an embodiment of the present application;
FIG. 7 is a training flow chart of a four-tuple portal map neural network according to an embodiment of the present application;
fig. 8 is a schematic diagram of a four-tuple gate graph neural network event prediction apparatus according to an embodiment of the disclosure.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. 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, are intended to be within the scope of the present application.
Referring to fig. 1, fig. 1 is a flowchart of a four-tuple gate graph neural network event prediction method according to an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
s11: and constructing a rational map by the initial background events and the candidate events.
In this embodiment, the initial background event may be understood as an event that has occurred, the initial candidate event is an event that may occur next corresponding to the initial background event, and the event map is a map formed by a plurality of events and relationships between the events.
In this embodiment, the specific steps of constructing a rational map from a plurality of initial background events and a plurality of candidate events include:
s11-1: the relation between a plurality of initial background events and a plurality of candidate events is set.
In this embodiment, a plurality of events including an initial background event and an initial candidate event are all interrelated, and have a certain relationship, and the relationship between the events needs to be preset.
By way of example, one event is "enter store", another is "shopping", then the "enter store" is aimed at "shopping", and "aim" may be noted as a relationship between "enter store" and "shopping".
S11-2: and forming a rational map by taking a plurality of initial background events and a plurality of events to be selected as nodes and taking the relation between the plurality of initial background events and the plurality of events to be selected as edges.
In this embodiment, the event map is a knowledge base including event logic, and describes evolution rules and evolution modes between events. The structure of the event map is a directed ring map, wherein nodes represent relations, and directed edges represent the event-to-event, causal, conditional, upper and lower and other event logic relations.
In this embodiment, all events including a plurality of initial background events and a plurality of events to be selected are taken as nodes of a rational map, and relationships among the events are taken as edges of the rational map to form the rational map, so that logical relationships among the events can be clearly expressed, and modeling and calculation of the events are facilitated.
S12: and representing vectors of the initial background events and the initial candidate events in the event map in a four-element mode to obtain initial background event vectors and initial candidate event vectors.
In this embodiment, all events including the plurality of initial background events and the plurality of initial candidate events are performedThe vector of v (e s ,e o ,e p ) Where v represents predicate verb e s Representing subject, e o Representing object, e p Representing an entity having a preposition relationship with the predicate verb.
In this embodiment, the four-tuple data structure is an extension of complex data, the complex data includes a real part and an imaginary part, the four-tuple data structure has a real part, three imaginary parts, i.e. q1=a1+b1i+c1j+d1k, where a1 is the real part, b1, c1, d1 are the imaginary parts, i, j, k represent the imaginary parts, and the general model of the event representation is also generally composed of four components, i.e. v (e s ,e o ,e p ) Wherein v represents predicate verb, e s Representing subject, e o Representing object, e p Representing an entity having a preposition relationship with the predicate verb. Let a1 correspond to v, b1, c1, d1 respectively correspond to e s 、e o 、e p Correspondingly, by using a four-tuple data structure to be similar in structure to the event representation model, modeling an event with a four-tuple data structure can capture relationships inside the event.
In this embodiment, as shown in fig. 2, fig. 2 is a calculation flow of different components for performing hamiltonian operation based on a four-tuple representation model according to an embodiment of the present invention, where four-tuple data is operated by using hamiltonian, and the influence of interaction between the event interiors can be captured well through weight sharing. In FIG. 2, Q in Representing input, Q out Represents the output, W represents the total weight, W s 、W o 、W p Is e s 、e o 、e p Corresponding weights, v ', e' s 、e’ o 、e’ p V and e respectively s 、e o 、e p Vector representations after combining the partial effects. The specific calculation flow can be described by the following formula:
Figure BDA0002890298930000081
wherein Q is 1 =a 1 +b 1 i+c 1 j+d 1 k,Q 2 =a 2 +b 2 i+c 2 j+d 2 k。
In this embodiment, as shown in fig. 3, fig. 3 is a schematic view of an event representation based on a four-tuple representation model according to an embodiment of the invention, in which the shades of color represent different components of each vector.
For example, one event in the incident map is "I go to mall to purchase clothing" where "I" is subject e s "clothes" is object e o "mall" is entity e having preposition relation with predicate verb p "go to purchase" is the predicate verb v.
S13: and performing graph network calculation on the event map by using a four-element portal graph neural network to obtain a plurality of new background event vectors and a plurality of new candidate event vectors.
In this embodiment, the four-element portal-map neural network is a novel neural network combining a portal structure in a cyclic neural network with a portal structure of a graph neural network, wherein the portal structure is similar to that of a GRU, and the graph neural network is a general neural network structure for processing data having a graph structure. Different script events have multiple interactions, and in order to combine the interactions of different events and the internal dependency relationship of the events, in this embodiment, the quaternion and the gating neural network are combined with the graph neural network to obtain a quaternion gating graph neural network, so that the feature representation of the events can be better learned.
In this embodiment, the specific steps of performing graph network calculation on the event map by using a four-element portal graph neural network to obtain a plurality of new background event vectors and a plurality of new candidate event vectors are as follows:
S13-1: the representation vector of the event in the event map and an adjacency matrix representing the relationship between events are input into the portal neural network.
In this embodiment, the four-tuple portal graph neural network is used to perform graph network calculation on the event map, and the vector h of the initial background event and the initial candidate event is needed first (0) And the adjacency matrix a is input into the neural network.
For example, let h be a total of 8 background events and 5 candidate events (0) An initial vector representing these 8 background events and 5 candidate events, adjacency matrix A ε R 13×13 Representing the interrelationship between these 13 events.
S13-2: and the portal map neural network calculates the representation vector of the event and the adjacency matrix to obtain the plurality of new background event vectors and the plurality of new candidate event vectors.
In this embodiment, as shown in fig. 4, fig. 4 is a schematic diagram illustrating an attention mechanism operation performed by a background event and a candidate event based on an attention mechanism according to an embodiment of the present invention, wherein a node e 1 、e 1 ……、e n Representing different event vectors, each edge representing a relationship between events.
The initial background event vector and the initial event vector to be selected are only expressed in the form of vectors, the relation between the events is not modeled, the background event vector and the event vector to be selected are input into a four-element group gate map neural network for calculation, the obtained new background event vector and the event vector to be selected are information fused between different nodes, and the new vector fused with the influence between the events is obtained.
In this embodiment, a four-element portal map neural network is used to calculate the representation vector and the adjacency matrix of the event to obtain a plurality of new background event vectors and a plurality of new candidate event vectors, and the specific calculation method is as follows:
a (t) =A T h (t-1) +b (2)
Figure BDA0002890298930000091
Figure BDA0002890298930000092
Figure BDA0002890298930000093
h t =(1-z t )⊙h (t-1) +z t ⊙c t (6)
wherein,,
Figure BDA0002890298930000094
indicating hamiltonian, +. (t) Is an intermediate quantity A T Represents the transpose of the adjacency matrix, h (t-1) The last vector representing the t-th vector, b representing the offset,/for>
Figure BDA0002890298930000101
Q 1 、Q 2 All represent quaternion values, σ () represents the sigmoid activation function of the quaternion partition, tanh () represents the tanh activation function of the quaternion partition, z t Representing an update gate, r t Representing a reset gate, c t Represents an intermediate quantity, h t Representing a new background event vector or a new candidate event vector.
In this embodiment, equation (2) represents the information passing process between different nodes of the four-element portal neural network, and equations (3) - (6) represent updating new vectors from the rest of the nodes and the previous vectors of the current node. The cyclic propagation process in the formula has a certain number of steps of K steps, and the number of steps is determined by the number of vectors. After the calculation of the formula, the tetrad portal graphic neural network outputs a new background event vector and a new candidate event vector, and the new background event vector can be expressed as h i Representing the new candidate event vector by h cj The representation is performed.
Illustratively, after the vectors of 8 initial background events and 5 initial background events and the adjacency matrix representing the interrelation between the 13 events are input into the four-tuple portal graphic neural network, a new background event vector h of the 8 background events can be obtained 1 ,h 2 ,……,h 8 And a new candidate event vector h of 5 candidate events c1 ,h c2 ,……,h c5
S14: and calculating the plurality of new background event vectors and the plurality of new candidate event vectors by using the attention neural network to obtain the overall vector of the background event.
In this embodiment, after obtaining a plurality of new background event vectors and a plurality of new candidate event vectors, the attention mechanism is used to calculate the background event vectors and the candidate event vectors, so that the influence of each background event on the candidate event can be considered. And fusing a plurality of background events into an integral vector of the background events, so that the next calculation is facilitated.
In this embodiment, the specific step of calculating the plurality of new background event vectors and the plurality of new candidate event vectors by using the attention neural network to obtain the overall vector of the background event includes:
s14-1: the plurality of new background event vectors and the plurality of new candidate event vectors are input into the attention neural network.
In this embodiment, the attention neural network is used to calculate the attention mechanism for the input new background event vector and the new candidate event vector.
S14-2: and carrying out attention mechanism operation on each new background event vector in the new background event vectors aiming at each new candidate event vector in the new candidate event vectors to obtain a weight coefficient of each new background event vector in the new background event vectors relative to each new candidate event vector.
In this embodiment, each background event has different degrees of influence on each candidate event, and in order to reflect this influence in vector calculation, the present embodiment uses the attention neural network to calculate a new background event vector and a new candidate event vector.
In this embodiment, for each new candidate event vector of the plurality of new candidate event vectors, performing an attention mechanism operation on each new background event vector of the plurality of new background event vectors and the new candidate event vector to obtain a weight of each new background event vector of the plurality of new background event vectors relative to each new candidate event vector, where a specific method is that:
u ij =tanh(W h h i +W c h cj +b u ) (7)
Figure BDA0002890298930000111
Wherein u is ij Representing the score between the ith new background event and the jth new candidate event, with higher scores representing greater degrees of association, tanh () representing the tanh activation function of the four-tuple partition, W h And W is c Representing weights, b u Representing the bias parameter, alpha ij Weight coefficient representing the ith background event for the jth candidate event, exp (u ij ) U represents e ij To the power, sigma k exp(u kj ) U represents e 1j To the power u kj And (5) sum of powers.
For example, as shown in fig. 5, fig. 5 is a schematic diagram illustrating an attention mechanism operation performed based on the background events and the candidate events of the attention mechanism according to an embodiment of the present invention, when 8 background events and 5 candidate events are input, the weight coefficient of the 8 background events for each candidate event is calculated.
S14-3: and calculating to obtain the integral vector of the background event according to the weight coefficient.
In this embodiment, the specific method for calculating the overall vector of the background event according to the weight coefficient is:
Figure BDA0002890298930000112
where h represents the overall vector of the background event, α ij Representing the ith background event for the jthWeight coefficient of event to be selected, h i Representing the ith background vector.
Illustratively, when 8 background events are input, the overall vector h is a weighted sum of the 8 background event vectors.
S15: and scoring the whole vector and each new event vector to be selected, and taking the event to be selected corresponding to the event vector to be selected with the highest score as a prediction result.
In this embodiment, after the overall vector of the background event is obtained, the prediction result, that is, the most likely occurrence, can be determined by scoring each new candidate event vector with the background event vector.
In this embodiment, the step of scoring the whole vector and each new candidate event vector, and taking the candidate event corresponding to the candidate event vector with the highest score as the prediction result includes:
s15-1: and calculating Euclidean distances between each new event vector to be selected and the whole vector of the background event according to the whole vector of the background event, and obtaining a plurality of Euclidean distance values.
In this embodiment, according to the overall vector of the background event, the euclidean distance between each new candidate event vector and the overall vector of the background event is calculated, so as to obtain a plurality of euclidean distance values, where the calculating method may be expressed as:
Figure BDA0002890298930000121
where g () represents the Euclidean distance of two events, s j The euclidean distance representing two events, i.e., euclidean distance.
For example, the euclidean distance of two events a, b may be expressed as:
g(a,b)=‖a-b‖ (11)
s15-2: and selecting a new candidate event vector corresponding to the minimum value in the plurality of Euclidean distances as the candidate event vector with the highest score, and taking the candidate event corresponding to the candidate event vector with the highest score as a prediction result.
In this embodiment, the value of the euclidean distance represents the distance between two vectors, the smaller the value of the euclidean distance is, the closer the distance between the two vectors is, the higher the score is, the lower the score is, and it can be seen that the candidate event corresponding to the candidate event vector with the nearest overall vector distance to the background event is the predicted event most likely to occur next, and is also the candidate event with the highest score, namely the predicted result.
As illustrated in fig. 6, fig. 6 is a schematic diagram of a scoring model for performing euclidean distance calculation based on a weighted and summed background event and a candidate event according to an embodiment of the present application, where euclidean distances between a background event overall vector and 5 candidate events are respectively obtained, 5 values are obtained, and 5 scores are given to the 5 candidate event vectors.
By way of example, the background events entered into the four-tuple portal map neural network are "i get up in the morning", "i wash the face and brush the teeth", "i eat breakfast", "i get on the school bag". The events to be selected are "I go to school", "I go to work", "I go to the movie". The four-element portal map neural network fuses the vectors of the background events into an integral vector, and the Euclidean distance between the vector corresponding to the 'I go to school' and the vector of the background event is found to be nearest through calculation, so that the predicted result is 'I go to school'.
As shown in fig. 7, fig. 7 is a training flowchart of a four-tuple portal neural network according to an embodiment of the present application. As shown in fig. 7, the method includes the steps of:
s21: and collecting a plurality of related events, and marking one part of the plurality of related events as background events and the other part of the plurality of related events as candidate events as a training set.
In this embodiment, a plurality of events need to be collected as a training set to train a four-element portal graphic neural network, wherein the four-element portal graphic neural network comprises background events and candidate events, the collected events are divided into a plurality of groups, each group comprises a plurality of background events and candidate events, the background events are marked, correct candidate events corresponding to the background events are marked as correct candidate events, and the rest of candidate events are not marked.
For example, the collected events are "small Li Xia lessons", "xiao Li schoolbag on back", "xiao Li basketball back to dormitory", "xiao Li basketball, which are classified into a group, labeled as background events, and candidate events" xiao Li "are added to the group to eat at dining room", "small Li Qu basketball on course", "xiao Li basketball on course", and "small Li Qu basketball on course" are labeled as correct candidate events.
S22: and inputting the training set into the four-element portal map neural network to train the four-element portal map neural network, so as to obtain a trained four-element portal map neural network.
In this embodiment, multiple groups of event packets in a training set are input into a four-element portal graph neural network, and the neural network is trained, where the objective optimization function is:
Figure BDA0002890298930000131
where N represents the number of background events, k represents the number of candidate events, s Ij Representing the relevance scores of the ith background event and the jth corresponding candidate event, y representing the index of the correct candidate event, margin being the parameter of the margin loss function, λ being the parameter of the L2 regularization, Θ representing the parameter of the model, the optimization of the model parameters being based on the RMSprop optimizer.
Based on the same inventive concept, an embodiment of the present application provides a four-tuple portal map neural network event prediction apparatus 300. Referring to fig. 8, fig. 8 is a schematic diagram of a four-tuple portal neural network event prediction apparatus according to an embodiment of the disclosure. As shown in fig. 8, the apparatus includes:
a fact map construction module 301, configured to construct a plurality of initial background events and a plurality of events to be selected into a fact map;
the quadruple event representation module 302 is configured to represent vectors of the plurality of initial background events and the plurality of initial candidate events in the event map in a quadruple form, so as to obtain an initial background event vector and an initial candidate event vector;
the four-element portal map neural network module 303 is configured to perform map network calculation on the event map by using a four-element portal map neural network, so as to obtain a plurality of new background event vectors and a plurality of new event vectors to be selected;
the attention mechanism-based context fusion module 304 is configured to calculate the plurality of new context event vectors and the plurality of new candidate event vectors by using an attention neural network, so as to obtain an overall vector of the context event;
and a scoring module 305 for scoring the whole vector and each new candidate event vector, and taking the candidate event corresponding to the candidate event vector with the highest score as a prediction result.
Optionally, the rational map construction module includes:
the relation setting sub-module is used for setting the relation between a plurality of initial background events and a plurality of events to be selected;
the event map is formed by a sub-module, which is used for forming the event map by taking a plurality of initial background events and a plurality of events to be selected as nodes and taking the relation between the initial background events and the events to be selected as edges.
Optionally, the four-tuple event representation module includes:
a quadruple event representation sub-module for representing vectors of all events including the plurality of initial background events and the plurality of initial candidate events by v (e) s ,e o ,e p ) Where v represents predicate verb e s Representing subject, e o Representing object, e p Representing an entity having a preposition relationship with the predicate verb.
Optionally, the apparatus further comprises:
the event collection module is used for collecting a plurality of related events, and marking one part of the plurality of related events as background events and the other part of the plurality of related events as to-be-selected events as training sets;
and the four-element portal map neural network training module is used for inputting the training set into the four-element portal map neural network to train the four-element portal map neural network, so as to obtain a trained four-element portal map neural network.
Optionally, the four-element portal map neural network module includes:
a first vector input sub-module for inputting a representation vector of an event in the event map and an adjacency matrix representing a relationship between events into the four-tuple portal map neural network;
and the four-atom gate map neural network calculation sub-module is used for calculating the representation vector of the event and the adjacency matrix by the four-element gate map neural network to obtain the plurality of new background event vectors and the plurality of new candidate event vectors.
Optionally, the context fusion module based on the attention mechanism includes:
a second vector input sub-module for inputting the plurality of new background event vectors and the plurality of new candidate event vectors into the attention neural network;
the weight coefficient calculation sub-module is used for carrying out attention mechanism operation on each new background event vector in the new background event vectors aiming at each new event vector to be selected in the new event vectors to obtain the weight coefficient of each new background event vector in the new background event vectors relative to each new event vector to be selected;
And the whole vector obtaining sub-module is used for calculating and obtaining the whole vector of the background event according to the weight coefficient.
Optionally, the scoring module for the background event and the candidate event includes:
the Euclidean distance calculation sub-module is used for calculating the Euclidean distance between each new event vector to be selected and the whole vector of the background event according to the whole vector of the background event to obtain a plurality of Euclidean distance values;
and the prediction result obtaining sub-module selects a new candidate event vector corresponding to the minimum value in the values of the Euclidean distances as the candidate event vector with the highest score, and takes the candidate event corresponding to the candidate event vector with the highest score as the prediction result.
Based on the same inventive concept, another embodiment of the present application provides a readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps in the four-tuple gate graph neural network event prediction method according to any of the embodiments of the present application.
Based on the same inventive concept, another embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor executes the steps in the four-tuple gate graph neural network event prediction method according to any one of the embodiments of the present application.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
It will be apparent to those skilled in the art that embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, the present embodiments may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (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 terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, 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.
While preferred embodiments of the present embodiments have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the present application.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal 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 terminal. 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 terminal device comprising the element.
The foregoing has described in detail the methods, apparatuses, devices and media for predicting events of a four-element portal map neural network provided in the present application, and specific examples have been applied to illustrate the principles and embodiments of the present application, where the foregoing examples are only for aiding in understanding the methods and core ideas of the present application; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (9)

1. A four-tuple portal map neural network event prediction method, the method comprising:
forming a rational map by a plurality of initial background events and a plurality of events to be selected;
representing vectors of the initial background events and the initial candidate events in the event map in a four-tuple form to obtain initial background event vectors and initial candidate event vectors, wherein the representation forms of the initial background event vectors and the initial candidate event vectors are v (e) s ,e o ,e p ) Wherein v represents predicate verb, e s Representing subject, e o Representing object, e p Representing an entity having preposition relation with the predicate verb;
using a four-element gate graph neural network, and performing graph network calculation on the event map according to the initial background event vector and the initial candidate event vector to obtain a plurality of new background event vectors and a plurality of new candidate event vectors;
calculating the plurality of new background event vectors and the plurality of new candidate event vectors by using an attention neural network to obtain an overall vector of the background event;
and scoring the event to be selected according to Euclidean distance between each new event vector to be selected and the whole vector, and taking the event to be selected with the highest score as a prediction result.
2. The method of claim 1, wherein constructing a rational map of a plurality of initial background events with a plurality of candidate events, comprises:
setting a relation between a plurality of initial background events and a plurality of events to be selected;
and forming a rational map by taking a plurality of initial background events and a plurality of events to be selected as nodes and taking the relation between the plurality of initial background events and the plurality of events to be selected as edges.
3. The method of claim 1, wherein prior to performing a graph network calculation on the event map based on the initial background event vector and the initial candidate event vector using a four-tuple gate graph neural network to obtain a plurality of new background event vectors and a plurality of new candidate event vectors, the method further comprises:
collecting a plurality of related events, marking one part of the plurality of related events as background events, and marking the other part of the plurality of related events as events to be selected as a training set;
and inputting the training set into the four-element portal map neural network to train the four-element portal map neural network, so as to obtain a trained four-element portal map neural network.
4. The method of claim 1, wherein performing a graph network calculation on the rational graph using a four-tuple gate graph neural network to obtain a plurality of new background event vectors and a plurality of new candidate event vectors, comprising:
Inputting a representation vector of the event in the event map and an adjacency matrix representing a relationship between the events into the four-tuple portal map neural network;
and the four-element gate map neural network calculates the representation vector of the event and the adjacency matrix to obtain the plurality of new background event vectors and the plurality of new candidate event vectors.
5. The method of claim 1, wherein calculating the plurality of new background event vectors and the plurality of new candidate event vectors using an attention neural network to obtain an overall vector of background events comprises:
inputting the plurality of new background event vectors and the plurality of new candidate event vectors into the attention neural network;
for each new candidate event vector of the plurality of new candidate event vectors, performing attention mechanism operation on each new background event vector of the plurality of new background event vectors to obtain a weight coefficient of each new background event vector of the plurality of new background event vectors relative to each new candidate event vector;
and calculating to obtain the integral vector of the background event according to the weight coefficient.
6. The method of claim 1, wherein scoring the candidate events based on euclidean distance between each of the new candidate event vectors and the overall vector, and taking the candidate event with the highest score as a prediction result comprises:
calculating Euclidean distances between each new event vector to be selected and the whole vector of the background event according to the whole vector of the background event to obtain a plurality of Euclidean distance values;
and selecting a new candidate event vector corresponding to the minimum value in the plurality of Euclidean distances as the candidate event vector with the highest score, and taking the candidate event corresponding to the candidate event vector with the highest score as a prediction result.
7. A four-tuple portal map neural network event prediction apparatus, the apparatus comprising:
the event map construction module is used for constructing event maps from a plurality of initial background events and a plurality of events to be selected;
the quadruple event representation module is used for representing vectors of the initial background events and the initial candidate events in the event map in a quadruple mode to obtain initial background event vectors and initial candidate event vectors, wherein the representation forms of the initial background event vectors and the initial candidate event vectors are v (e s ,e o ,e p ) Wherein v represents predicate verb, e s Representing subject, e o Representing object, e p Representing an entity having preposition relation with the predicate verb;
the four-element gate map neural network module is used for performing map network calculation on the event map according to the initial background event vector and the initial event vector to be selected by using the four-element gate map neural network to obtain a plurality of new background event vectors and a plurality of new event vectors to be selected;
the background fusion module is used for calculating the plurality of new background event vectors and the plurality of new candidate event vectors by using the attention neural network to obtain an overall vector of the background event;
and the background event and event scoring module is used for scoring the event to be selected according to Euclidean distance between each new event vector to be selected and the whole vector, and taking the event to be selected with the highest score as a prediction result.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any of claims 1 to 6.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 6 when executing the computer program.
CN202110026128.5A 2021-01-08 2021-01-08 Quaternary combination gate map neural network event prediction method, device, equipment and medium Active CN112633483B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110026128.5A CN112633483B (en) 2021-01-08 2021-01-08 Quaternary combination gate map neural network event prediction method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110026128.5A CN112633483B (en) 2021-01-08 2021-01-08 Quaternary combination gate map neural network event prediction method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN112633483A CN112633483A (en) 2021-04-09
CN112633483B true CN112633483B (en) 2023-05-30

Family

ID=75293864

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110026128.5A Active CN112633483B (en) 2021-01-08 2021-01-08 Quaternary combination gate map neural network event prediction method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN112633483B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020232943A1 (en) * 2019-05-23 2020-11-26 广州市香港科大霍英东研究院 Knowledge graph construction method for event prediction and event prediction method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080126399A1 (en) * 2006-06-29 2008-05-29 Macgregor Robert M Method and apparatus for optimizing data while preserving provenance information for the data
CN101937430B (en) * 2010-09-03 2015-04-15 清华大学 Method for extracting event sentence pattern from Chinese sentence
US10303999B2 (en) * 2011-02-22 2019-05-28 Refinitiv Us Organization Llc Machine learning-based relationship association and related discovery and search engines

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020232943A1 (en) * 2019-05-23 2020-11-26 广州市香港科大霍英东研究院 Knowledge graph construction method for event prediction and event prediction method

Also Published As

Publication number Publication date
CN112633483A (en) 2021-04-09

Similar Documents

Publication Publication Date Title
Stork et al. A new taxonomy of global optimization algorithms
Chen et al. Fuzzy time series forecasting based on optimal partitions of intervals and optimal weighting vectors
CN110490717B (en) Commodity recommendation method and system based on user session and graph convolution neural network
CN108095716B (en) Electrocardiosignal detection method based on confidence rule base and deep neural network
Chi et al. Learning of fuzzy cognitive maps with varying densities using a multiobjective evolutionary algorithm
Bouckaert Bayesian network classifiers in weka
Gol et al. A formal methods approach to pattern synthesis in reaction diffusion systems
CN112288086A (en) Neural network training method and device and computer equipment
CN108009593A (en) A kind of transfer learning optimal algorithm choosing method and system
CN109657792A (en) Construct the method, apparatus and computer-readable medium of neural network
CN112612903A (en) Interpretable knowledge graph embedding expression learning method capable of generating rules
JP2024526504A (en) Method, apparatus, device and computer program for training a lithography mask generation model
CN108062369A (en) A kind of ubiquitous education resource polymerization of polymorphism and system for integrating situation
Bukhtoyarov et al. A comprehensive evolutionary approach for neural network ensembles automatic design
CN112420125A (en) Molecular attribute prediction method and device, intelligent equipment and terminal
CN115062779A (en) Event prediction method and device based on dynamic knowledge graph
Costa et al. Demonstrating the evolution of GANs through t-SNE
CN110263136B (en) Method and device for pushing object to user based on reinforcement learning model
CN113065321B (en) User behavior prediction method and system based on LSTM model and hypergraph
CN112633483B (en) Quaternary combination gate map neural network event prediction method, device, equipment and medium
CN109559345B (en) Garment key point positioning system and training and positioning method thereof
Dikopoulou et al. From undirected structures to directed graphical lasso fuzzy cognitive maps using ranking-based approaches
CN115577180A (en) Sequence recommendation method considering course lead relation and course classification
CN112836805B (en) KRFPV algorithm, execution device, electronic device, storage medium, and neural network
Madeiro et al. Gradient-based algorithms for the automatic construction of fuzzy cognitive maps

Legal Events

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