WO2021139524A1 - Method and apparatus for processing interaction data by using lstm neural network model - Google Patents

Method and apparatus for processing interaction data by using lstm neural network model Download PDF

Info

Publication number
WO2021139524A1
WO2021139524A1 PCT/CN2020/138398 CN2020138398W WO2021139524A1 WO 2021139524 A1 WO2021139524 A1 WO 2021139524A1 CN 2020138398 W CN2020138398 W CN 2020138398W WO 2021139524 A1 WO2021139524 A1 WO 2021139524A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
vector
interaction
implicit
nodes
Prior art date
Application number
PCT/CN2020/138398
Other languages
French (fr)
Chinese (zh)
Inventor
常晓夫
文剑烽
刘旭钦
宋乐
Original Assignee
支付宝(杭州)信息技术有限公司
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 支付宝(杭州)信息技术有限公司 filed Critical 支付宝(杭州)信息技术有限公司
Publication of WO2021139524A1 publication Critical patent/WO2021139524A1/en

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/049Temporal neural networks, e.g. delay elements, oscillating neurons or pulsed inputs
    • 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

Definitions

  • One or more embodiments of this specification relate to the field of machine learning, and more particularly to methods and devices for processing interactive data using machine learning.
  • Interaction events are one of the basic elements of Internet events.
  • the click behavior of a user when browsing a page can be regarded as an interaction event between the user and the page content block
  • the purchase behavior in e-commerce can be regarded as the relationship between the user and the product.
  • Interaction events between users, and transfer behavior between accounts are interaction events between users.
  • a series of user interaction events contain the user's fine-grained habits and preferences, as well as the characteristics of interactive objects, which are important source of features for machine learning models. Therefore, in many scenarios, it is desirable to characterize and model interactive participants based on interactive events.
  • an interactive event involves both parties to the interaction, and the status of each participant itself can be dynamically changed. Therefore, it is very difficult to accurately express the characteristics of the interactive participants comprehensively considering the various characteristics of the interactive parties. Therefore, it is hoped that there will be an improved solution to more effectively analyze and process the interactive objects in the interactive events, so as to obtain feature vectors suitable for subsequent business analysis.
  • One or more embodiments of this specification describe methods and devices for processing interactive data, in which an LSTM neural network model is used to consider interactive events in which interactive objects participate and the influence of other objects in the interactive events, and process interactive objects as implicit features. So as to carry out subsequent business processing analysis.
  • a method for processing interaction data comprising: obtaining a dynamic interaction graph constructed according to an interaction event set, wherein the interaction event set includes a plurality of interaction events, and each interaction event includes at least , The two objects at which the interaction behavior occurs and the interaction time; the dynamic interaction graph includes any first node, and the first node corresponds to the first object in the interaction event that occurred at the first time, and the first node Pointing to the M associated nodes corresponding to the N associated events through the connecting edge, the N associated events all occur at the second time, and all include the first object as one of the interactive objects, and the second time is, Looking back from the first time forward, the time before the interaction behavior of the first object occurred; the dynamic interaction graph includes at least one multi-element node whose number of associated nodes is greater than 2; in the dynamic interaction graph, it is determined A current subgraph corresponding to the current node to be analyzed, where the current subgraph includes nodes within a predetermined range that start from the current node
  • the aforementioned object includes a user
  • the interaction event includes at least one of the following: a click event, a social event, and a transaction event.
  • the above-mentioned M associated nodes are 2N nodes, respectively corresponding to the two objects included in each associated event in the N associated events; or, in another embodiment, the M associated nodes are The N+1 nodes respectively correspond to the N other objects interacting with the first object in the N associated events, and the first object itself.
  • the nodes within the foregoing predetermined range may include nodes within a connecting edge of a preset order K; and/or nodes whose interaction time is within a preset time range.
  • each interaction event further includes the behavior characteristics of the interaction behavior; in this case, the node characteristics of the second node may include the attribute characteristics of the object corresponding to the second node, and the The behavior characteristics of the interaction event that the second node participates in the corresponding interaction time.
  • the implicit vector and the intermediate vector of the second node may be determined by the following method: combining the node characteristics of the second node with the k implicit vectors corresponding to the k associated nodes, respectively, Input the first transformation function and the second transformation function with the same algorithm and different parameters to obtain k first transformation vectors and k second transformation vectors respectively; and the intermediate vector of the i-th associated node among the k associated nodes, and The corresponding i-th first transform vector and the i-th second transform vector are combined to obtain k operation results, and the k operation results are summed to obtain the combined vector; the node characteristics of the second node are combined with The k implicit vectors are input into the third transformation function and the fourth transformation function respectively to obtain the third transformation vector and the fourth transformation vector; based on the combination vector and the third transformation vector, determine the value of the second node Intermediate vector; based on the intermediate vector of the second node and the fourth transform vector, the implicit vector of the second node is determined.
  • sequentially iteratively processing each node may include, according to the node characteristics of the second node, the respective intermediate vectors and implicit vectors of the k associated nodes pointed to by the second node, and the corresponding second node The time difference between the interaction time and the interaction time corresponding to the k associated nodes determines the implicit vector and the intermediate vector of the second node.
  • the implicit vector and the intermediate vector of the second node can be determined in the following manner: the node characteristics of the second node and the time difference are determined by k corresponding to the k associated nodes.
  • the implicit vectors are combined separately, and the first transformation function is input to obtain k first transformation vectors; the node characteristics of the second node and the k implicit vectors corresponding to the k associated nodes are respectively combined, and the second transformation is input Function to obtain k second transform vectors; combine the intermediate vector of the i-th associated node among the k associated nodes with the corresponding i-th first transform vector and the i-th second transform vector to obtain k operations
  • the k operation results are summed to obtain a combined vector;
  • the node feature of the second node and the k implicit vectors are input to the third transformation function and the fourth transformation function, respectively, to obtain the third transformation Vector and a fourth transformation vector; based on the combined vector and the third transformation vector, determine the intermediate vector of
  • the implicit vector and the intermediate vector of the second node can be determined in the following manner: the node characteristics of the second node and the time difference are determined by k corresponding to the k associated nodes. After the two implicit vectors are combined separately, the first transformation function and the second transformation function with the same algorithm and different parameters are input, and k first transformation vectors and k second transformation vectors are obtained respectively; The intermediate vector of the i-associated node is combined with the corresponding i-th first transform vector and the i-th second transform vector to obtain k operation results, and the k operation results are summed to obtain the combined vector; The node features of the two nodes and the k hidden vectors are input into the third transformation function and the fourth transformation function, respectively, to obtain the third transformation vector and the fourth transformation vector; based on the combination vector and the third transformation vector, determine The intermediate vector of the second node; based on the intermediate vector of the second node and the fourth transform vector, the implicit vector of the second node is determined.
  • the neural network model may include multiple LSTM layers, wherein the implicit vector of the second node determined by the previous LSTM layer is input to the next LSTM layer as the node feature of the second node.
  • the neural network model integrates the hidden vectors of the current node output by each of the multiple LSTM layers to obtain the final hidden vector of the current node.
  • the neural network model uses the implicit vector of the current node output by the last LSTM layer among the plurality of LSTM layers as the final implicit vector of the current node.
  • the neural network model is trained in the following manner: acquiring historical interaction events, including a first sample object and a second sample object; in the dynamic interaction graph, determining the relationship with the first sample The first subgraph corresponding to the object, and the second subgraph corresponding to the second sample object; the first subgraph and the second subgraph are respectively input to the neural network model to obtain the first subgraph respectively The hidden vector of the sample object and the hidden vector of the second sample object; according to the hidden vector of the first sample object and the hidden vector of the second sample object, predict the first sample object and the second sample object. Whether the two sample objects will interact to obtain a prediction result; determine the prediction loss according to the prediction result; and update the neural network model according to the prediction loss.
  • the neural network model is trained in the following manner: a sample object is selected from a plurality of sample objects involved in the interaction event set, and the classification label of the sample object is obtained; in the dynamic interaction diagram, Determine the sample subgraph corresponding to the sample object; input the sample subgraph into the neural network model to obtain the hidden vector of the sample object; predict the hidden vector of the sample object according to the hidden vector of the sample object Classify to obtain a prediction result; determine a prediction loss according to the prediction result and the classification label; and update the neural network model according to the prediction loss.
  • an apparatus for processing interaction data comprising: an interaction graph obtaining unit configured to obtain a dynamic interaction graph constructed according to an interaction event set, wherein the interaction event set includes a plurality of interaction events, Each interaction event includes at least two objects where the interaction behavior occurred and the interaction time; the dynamic interaction graph includes any first node, and the first node corresponds to the first object in the interaction event that occurred at the first time , The first node points to the M associated nodes corresponding to the N associated events through the connecting edge, and the N associated events all occur at the second time, and all include the first object as one of the interactive objects, so The second time is, going back from the first time, the time before the interaction of the first object occurs; the dynamic interaction graph includes at least one multi-node with more than 2 associated nodes; the subgraph is determined A unit configured to determine, in the dynamic interaction graph, a current subgraph corresponding to the current node to be analyzed, the current subgraph including nodes within a predetermined range starting from the current no
  • a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed in a computer, the computer is caused to execute the method of the first aspect.
  • a computing device including a memory and a processor, characterized in that executable code is stored in the memory, and when the processor executes the executable code, the method of the first aspect is implemented .
  • a dynamic interaction diagram is constructed based on a set of interaction events, and the dynamic interaction diagram reflects the timing relationship of each interaction event and the mutual influences between interactive objects transmitted through each interaction event.
  • the dynamic interaction graph allows nodes to be connected to an unlimited number of associated nodes, thereby forming a mixed and diverse interaction graph.
  • the hidden vector of the interactive object can be extracted.
  • the implicit vector thus obtained introduces the influence of other interactive objects in each interactive event on it, so that the in-depth characteristics of the interactive object can be expressed comprehensively and used for business processing.
  • Figure 1A shows a two-part diagram of the interaction relationship in an example
  • FIG. 1B shows an interactive relationship network diagram in another example
  • Fig. 2 shows a schematic diagram of an implementation scenario according to an embodiment
  • FIG. 3 shows a flowchart of a method for processing interactive data according to an embodiment
  • Figure 4 shows a dynamic interaction diagram constructed according to an embodiment
  • Figure 5 shows a dynamic interaction diagram constructed according to another embodiment
  • Figure 6 shows an example of the current subgraph in one embodiment
  • FIG. 7 shows an example of the current subgraph in another embodiment
  • Figure 8 shows a schematic diagram of the work of the LSTM layer
  • Figure 9 shows the structure of an LSTM layer according to an embodiment
  • FIG. 10 shows the structure of an LSTM layer according to another embodiment
  • FIG. 11 shows the structure of an LSTM layer according to another embodiment
  • Figure 12 shows a flowchart of training a neural network model in one embodiment
  • Figure 13 shows a flowchart of training a neural network model in another embodiment
  • Fig. 14 shows a schematic block diagram of an apparatus for processing interactive data according to an embodiment.
  • the participants in the interaction event that is, the interaction object, can be characterized and modeled.
  • a static interaction relationship network diagram is constructed based on historical interaction events, so that each interaction object is analyzed based on the interaction relationship network diagram.
  • participants in each historical event can be used as nodes, and connecting edges can be established between nodes that have an interactive relationship, so as to form the foregoing interactive network graph.
  • FIG. 1A and Fig. 1B respectively show the interactive relationship network diagram in a specific example. More specifically, Figure 1A shows a bipartite graph, which contains user nodes (U1-U4) and product nodes (V1-V3). If a user has purchased a product, it will be between the user and the product. Construct a connecting edge between.
  • Figure 1B shows a user transfer relationship diagram, in which each node represents a user, and there is a connecting edge between two users who have made transfer records.
  • FIG. 1A and FIG. 1B show the interaction relationship between objects, they do not contain the timing information of these interaction events.
  • Simply embedding the graph based on such an interactive relationship network graph the obtained feature vector does not express the influence of the time information of the interactive event on the node.
  • the scalability of such a static graph is not strong enough, and it is difficult to flexibly handle the situation of newly-added interactive events and newly-added nodes.
  • a behavior sequence of the object is constructed, and the characteristic expression of the object is extracted based on the behavior sequence.
  • a behavior sequence only characterizes the behavior of the object to be analyzed, and interactive events are events involving multiple parties, and the participants will indirectly transmit influence through the interaction events. Therefore, this method does not express the influence between the participating objects in the interaction event.
  • a dynamically changing set of interaction events is constructed into a dynamic interaction graph, wherein each interaction object involved in each interaction event corresponds to each node in the dynamic interaction graph.
  • An arbitrary node is connected to a number of associated nodes, where the associated node is the node corresponding to the interaction event that the object corresponding to the arbitrary node participated in last time.
  • the subgraph part related to the corresponding node is obtained from the dynamic interaction graph, and the subgraph part is input into the LSTM-based neural network model to obtain the feature vector expression of the interactive object.
  • Fig. 2 shows a schematic diagram of an implementation scenario according to an embodiment.
  • a dynamic interaction diagram 200 is constructed based on the set of interaction events.
  • the individual interactive objects each interaction event a i, b i represented by nodes, and establishes a connection between the edges containing the same event object. Since multiple interaction events are allowed to occur at the same time, the dynamic interaction graph 200 contains at least one multi-element node, and the multi-element node can be connected to 3 or more associated nodes. The structure of the dynamic interaction graph 200 will be described in more detail later.
  • the corresponding current node in the dynamic interaction graph can be determined, and the current subgraph related to the current node in the dynamic interaction graph can be obtained.
  • the current subgraph includes a certain range of nodes that can be reached from the current node through the connecting edge.
  • the current subgraph reflects the influence of other objects in the interaction event directly or indirectly associated with the current interaction object on the current node.
  • the current sub-image is input to the neural network model based on long and short-term memory LSTM, and the feature vector of the current interactive object is output through the model.
  • the feature vector obtained in this way can extract the time information of the associated interaction event and the influence between the interaction objects in each interaction event, so as to more accurately express the in-depth characteristics of the current interaction object.
  • Such feature vectors can be subsequently applied to various machine learning models and various business processing scenarios. For example, reinforcement learning can be performed based on the feature vector thus obtained, or cluster analysis can be performed based on the feature vector, for example, clustering users into groups of people.
  • Fig. 3 shows a flowchart of a method for processing interactive data according to an embodiment. It is understandable and understandable that the method can be executed by any device, device, platform, or device cluster with computing and processing capabilities. The following describes each step in the method for processing interactive data as shown in FIG. 3 in conjunction with specific embodiments.
  • step 31 a dynamic interaction graph constructed according to the set of interaction events is obtained.
  • the interaction event may be a user's purchase behavior, where the first object may be a certain user, and the second object may be a certain commodity.
  • the interaction event may be a user's click behavior on a page block, where the first object may be a certain user, and the second object may be a certain page block.
  • the interaction event may be a transaction event, for example, a user transfers money to another user, or a user makes a payment to a store or platform.
  • the interaction event may be a social event that a user occurs through a social platform, such as chatting, calling, sending red envelopes, and so on. In other business scenarios, interaction events can also be other interaction behaviors that occur between two objects.
  • the two objects interacting may be objects of different types, such as objects of the first type and objects of the second type.
  • the first type of object may be a certain user
  • the second type of object may be a certain commodity.
  • the two objects involved in the interaction event may be objects of the same type.
  • the interaction event may be an instant communication between two users. At this time, both the first object and the second object are users and belong to the same type of objects.
  • whether to distinguish the types of two interactive objects can be set according to the needs of the business.
  • the two users belong to the same type of object.
  • the user who transfers the amount may be regarded as an object of the first type, and the user who is the recipient is regarded as an object of the second type.
  • the interaction feature group corresponding to each interaction event may also include event feature or behavior feature f.
  • the event feature or behavior feature f may include background and context information of the occurrence of the interaction event, some attribute features of the interaction behavior, and so on.
  • the event feature f may include the type of terminal used by the user to click, browser type, app version, etc.; in the case where the interaction event is a transaction event, the event The feature f may include, for example, transaction type (commodity purchase transaction, transfer transaction, etc.), transaction amount, transaction channel, and so on.
  • the time is always measured and recorded in an appropriate duration unit.
  • the unit duration for recording the interaction time can be hours h or minutes m. Therefore, multiple interaction events are likely to occur within the unit duration. Even if it takes a short duration as a unit, such as seconds or even milliseconds, for some service platforms that interact very frequently, such as Alipay, there will inevitably be multiple interaction events within a unit of time.
  • the user edits a message in advance, selects a group of friends, and then performs a batch group sending operation. This is equivalent to initiating an interaction event with multiple friends at the same time.
  • a user adds multiple items to the shopping cart and then selects batch settlement, which is equivalent to simultaneously initiating interaction events with multiple items.
  • interaction event set S is obtained.
  • the interaction events in the interaction event set S are arranged in chronological order and expressed in the form of interaction feature groups, which can be recorded as follows:
  • a, b, c, d, e, f, u, v are interaction objects, interaction events E 2 and E 3 all occur at time t 2 and interaction events E 4 , E 5 and E 6 all occur at t 3 At time, the interaction events E 7 and E 8 both occurred at time t 4.
  • a dynamic interaction diagram can be constructed to depict the association relationships between interaction events and interaction objects.
  • the objects contained in the interaction events occurring at each time can be used as the nodes of the dynamic interaction graph.
  • a node can correspond to an object that interacts at a time, but the same entity object may correspond to multiple nodes.
  • the node v(t 6 ) can be constructed correspondingly, and the node v(t 5 ) can be constructed correspondingly by interacting with the object c at t 5 time. Therefore, it can be considered that the nodes in the dynamic interaction graph correspond to the interactive object at a certain interaction time, or in other words, correspond to the state of the interactive object at a certain interaction time.
  • the connecting edge For each node in the dynamic interaction graph, construct the connecting edge in the following way: For any node i, it is called the first node for simplicity; assuming that it corresponds to the first object at the first interaction time t, then in the interaction In the event sequence, backtracking from the first interaction time t, that is, backtracking in the direction earlier than the first interaction time t, it is determined that the last time when the first object interacted is the second time (t-), and The N interaction events that occur in the second time and the first object participates in are regarded as the N associated events of the first node, and the M nodes corresponding to the N associated events are regarded as the associated nodes, and it is established to point from the first node i to M The connecting edge of the associated node. Due to the possibility of multiple interaction events occurring at the same time, N may be greater than 1. In this way, the dynamic interaction graph may include multiple nodes, that is, nodes with more than two connected associated nodes.
  • corresponding nodes are respectively established for the two objects of each interaction event.
  • the aforementioned N associated events correspond to 2N nodes, and these 2N nodes are regarded as the aforementioned M associated nodes.
  • FIG. 4 shows a dynamic interaction diagram constructed according to an embodiment. Specifically, the left side of FIG. 4 shows a schematic diagram of an interaction sequence that organizes the foregoing interaction event set S in chronological order, and the right side shows a dynamic interaction diagram.
  • this dynamic interaction graph two interaction objects in each interaction event are respectively regarded as nodes. The following takes nodes u(t 6 ) and v(t 6 ) as examples to describe the construction of connecting edges.
  • the node u(t 6 ) represents the object u at time t 6. Therefore, starting from time t 6 and backtracking, it can be determined that the time when the object u had an interactive behavior last time is t 4 , during which time t 4 participated in two related events E 7 and E 8 , namely, the interaction event E 7 Both E and E 8 contain the object u as one of the interactive objects. Therefore, the four nodes corresponding to the associated events E 7 and E 8 are the associated nodes of the node u(t 6 ). In Fig. 4, in order to distinguish the object node u in the events E 7 and E 8 , they are denoted as u 1 (t 4 ) and u 2 (t 4 ). Thus, a connecting edge from the node u(t 6 ) to its 4 associated nodes is established.
  • the node v(t 6 ) represents the object v at time t 6. Therefore, starting from time t 6 and looking back forward, it can be determined that the time when the object v had an interactive behavior last time is t 5 , during which time t 5 participated in an associated event E 9 . Therefore, the two nodes v(t 5 ) and c(t 5 ) corresponding to the associated event E 9 are the associated nodes of node v(t 6 ). Then, a connecting edge from the node v(t 6 ) to the two associated nodes is established. For each other node, the above-mentioned method can be used to determine its associated event and associated node, so as to establish a connection edge to the associated node. In the dynamic interaction graph shown in Figure 4, the nodes u(t 6 ) and c(t 5 ) are all multi-element nodes.
  • a dynamic interaction graph when constructing a dynamic interaction graph, for multiple interaction events that occur at the same time, different interaction objects involved in the multiple interaction events are determined, and corresponding nodes are established for each different interaction object. In other words, if multiple interaction events that occur at the same time contain the same object, only one node is established for the same object. In this way, when establishing a connection edge, if there are N associated events corresponding to the first node of the first object, then these N associated events correspond to N+1 associated nodes, corresponding to the first object itself, and N N other objects interacting with the first object in the associated event.
  • Fig. 5 shows a dynamic interaction diagram constructed according to another embodiment. Specifically, the left side of FIG. 5 shows the aforementioned interaction event set S, and the right side shows a dynamic interaction diagram.
  • the dynamic interaction graph shows corresponding nodes are respectively established for different interaction objects in the interaction events that occur at the same time.
  • the difference between the dynamic interaction diagram of FIG. 5 and that of FIG. 4 is that the nodes of the same object in the multiple interaction events that occur at the same time in FIG. 4 are merged into one node.
  • the node u(t 6 ) represents the object u at time t 6. Starting from time t 6 and looking back, it can be determined that the time when the object u had an interactive behavior last time is t 4 , during which time t 4 participated in two related events E 7 and E 8 , namely, interactive events E 7 and E 8 all contain the object u as one of the interactive objects.
  • the three nodes a(t 4 ), b(t 4 ), and u(t 4 ) corresponding to the associated events E 7 and E 8 are associated nodes of the node u(t 6 ). Then, a connecting edge from the node u(t 6 ) to the three associated nodes is established.
  • a connecting edge pointing to the two nodes v(t 5 ) and c(t 5 ) corresponding to the associated event E 9 can be established. This process is the same as the description in conjunction with FIG. 4 and will not be repeated.
  • the above-mentioned methods can be used to determine the associated events and associated nodes, so as to establish a connection edge to the associated node.
  • the nodes u(t 6 ) and c(t 5 ) are all multi-element nodes.
  • step 31 a dynamic interaction diagram is constructed on-site according to the interaction event set.
  • the construction method is as described above.
  • a dynamic interaction graph may be constructed based on a set of interaction events in advance. In step 31, read or receive the formed dynamic interaction graph.
  • step 31 may also include a process of updating the dynamic interaction graph.
  • an existing dynamic interaction diagram constructed based on an existing interaction event set can be obtained, and then as time is updated, new interaction events that occur during the update time are continuously detected, and the existing dynamic interaction diagram is updated according to the new interaction events .
  • the existing dynamic interaction graph adopts the form of FIG. 4, and each interaction event corresponds to two nodes.
  • each interaction event corresponds to two nodes.
  • 2P new nodes are added to the existing dynamic interaction graph, and the 2P new nodes respectively correspond to P Two objects included in each of the new interactive events. Then, for each newly added node, find its associated events and associated nodes in the aforementioned manner. If there is an associated node, add a connecting edge from the newly added node to its associated node.
  • the existing dynamic interaction graph adopts the form of FIG. 5, and different objects in simultaneous interaction events correspond to different nodes.
  • first determine the Q different objects involved in the P newly-added interaction events. If the same interaction object does not exist in the P newly added interaction events, then Q 2P; if the same interaction object exists in the P newly added interaction events, then Q ⁇ 2P. Then, Q new nodes are added to the existing dynamic interaction graph, and the Q new nodes respectively correspond to Q different objects. Then, for each newly added node, find its associated events and associated nodes in the aforementioned manner. If there is an associated node, add a connecting edge from the newly added node to its associated node.
  • step 31 a dynamic interaction graph constructed based on the set of interaction events is obtained.
  • step 32 in the acquired dynamic interaction graph, a current subgraph corresponding to the current node to be analyzed is determined, and the current subgraph includes nodes within a predetermined range that start from the current node and reach through the connecting edge.
  • the current node is the node corresponding to the interactive object to be analyzed.
  • an entity object can correspond to multiple nodes, expressing the state of the entity object at different times.
  • such a node is selected as the current node, that is, in the dynamic interaction graph, there is no connecting edge pointing to the node.
  • the node u(t 6 ) when you want to analyze the interactive object u, you can select the node u(t 6 ) as the current node.
  • another node may be selected as the current node.
  • the node u(t 4 ) may also be selected as the current node.
  • the nodes within the predetermined range reached via the connecting edge constitute the current subgraph corresponding to the current node.
  • the nodes within the foregoing predetermined range may be nodes that are reachable by connecting edges of at most a preset order K.
  • the order K is a preset hyperparameter, which can be selected according to business conditions. It can be understood that the preset order K reflects the number of steps of historical interaction events that are traced forward when the information of the current node is expressed. The larger the number K is, the more historical interactive information of order is considered.
  • the nodes within the foregoing predetermined range may also be nodes whose interaction time is within the predetermined time range. For example, backtracking from the interaction time of the current node for a duration of T (for example, one day), the nodes within the range of duration that can be reached by connecting edges.
  • T for example, one day
  • the aforementioned predetermined range considers both the number of connected edges and the time range.
  • the nodes within the predetermined range refer to nodes whose connecting edges passing through the preset order K at most are reachable and whose interaction time is within the predetermined time range.
  • connection edge of the preset order K is taken as an example for description.
  • Figure 6 shows an example of the current subgraph in one embodiment.
  • the nodes that the edges can reach are shown in the gray nodes in the figure.
  • These gray nodes and the connection relationship between them are the current subgraph corresponding to the current node u(t 6 ).
  • Fig. 7 shows an example of the current subgraph in another embodiment.
  • u(t 6 ) in Figure 5 is the current node
  • the nodes that the edges can reach are shown in the gray nodes in the figure.
  • These gray nodes and the connection relationship between them are the current subgraph corresponding to the current node u(t 6 ).
  • the current sub-image is input to the neural network model, which includes the LSTM layer.
  • the second node for the convenience of expression
  • the LSTM layer performs the following processing: at least according to the node characteristics of the second node, the middle of each of the k associated nodes pointed to by the second node
  • the vector and the hidden vector are used to determine the hidden vector and the intermediate vector of the second node.
  • the LSTM layer iteratively processes each node in turn according to the direction relationship of the connecting edge between each node in the current subgraph, so as to obtain the implicit vector of the current node.
  • Figure 8 shows the working schematic diagram of the LSTM layer.
  • node Q points to k associated nodes: node J 1 to node J k . 8 at time T, were treated to give LSTM layer node to node J 1 J k represents a vector H 1 to H k, and a vector comprising an intermediate vector implicit; the next time T +, according to the node layer LSTM
  • the node characteristics of Q, the representation vectors H 1 to H k of J 1 to J k obtained by the previous processing, and the representation vector H Q of node Q is obtained. It can be understood that the representation vector of the node Q can be used to obtain the representation vector of the node pointing to the node Q at a subsequent time, so as to implement iterative processing.
  • node a(t 2 ) For each lowest-level node in the graph, for example, node a(t 2 ), its pointing node is not considered in the current subgraph, that is, it is considered that a(t 2 ) does not have associated nodes.
  • the intermediate vector c and the implicit vector h of the associated node pointed to by the node are generated by padding with a default value (for example, 0).
  • node features, LSTM layer based on the node a (t 2), and the default node associated intermediate vector c and vector H implied, determination node a (t 2) of the intermediate vector c (a (t 2)) And the implicit vector h(a(t 2 )). Do the same process for the other lowest-level nodes to get the corresponding intermediate vector and hidden vector.
  • the LSTM layer is based on the node characteristics of the node a(t 4 ) itself, and the respective intermediate and hidden vectors of the two associated nodes a(t 2 ) and f(t 2) it points to, namely c(a( t 2 )), h(a(t 2 )), c(f(t 2 )) and h(f(t 2 )), determine the intermediate vector c(a(t 4 )) of node a(t 4) And h(a(t 4 )). Do the same process for other middle layer nodes to get their corresponding middle vector and hidden vector.
  • the LSTM layer is based on the node characteristics of the node u(t 6 ) itself, and the respective intermediate vectors and implicit vectors of the three associated nodes a(t 4 ), u(t 4 ) and b(t 4) it points to , Namely c(a(t 4 )), h(a(t 4 )), c(u(t 4 )), h(u(t 4 )), c(b(t 4 )) and h(b (t 4 )), determine the intermediate vectors c(u(t 6 )) and h(u(t 6 )) of the node u(t 6 ).
  • Figure 9 shows the structure of the LSTM layer according to one embodiment.
  • the currently processed node is denoted as u(t), Indicates the node characteristics of the node u(t).
  • the node feature may include the user's attribute characteristics, such as age, occupation, education level, location, etc.; in the case of the node representing the commodity, the node feature may include the attribute feature of the commodity, such as a commodity Category, time on sale, sales volume, etc.
  • the original node characteristics can be obtained accordingly.
  • the feature group of the interaction event also includes the event feature or the behavior feature f
  • the node feature may also include the behavior feature f of each interaction event participating in the interaction time corresponding to the node.
  • each associated node has an intermediate vector c and a hidden vector h.
  • i is 1, 2, and 3 respectively.
  • a default value such as a zero vector
  • the LSTM layer performs the following operations on the input node features, intermediate vectors and hidden vectors.
  • Node feature K implicit vectors corresponding to k associated nodes respectively (Where i is from 1 to k) combination, respectively input the first transformation function g and the second transformation function f with the same algorithm and different parameters to obtain k first transformation vectors and k second transformation vectors respectively.
  • the first transformation function g and the second transformation function f are calculated using the following formula (1) and formula (2), respectively:
  • is the activation function, such as the sigmoid function, with Is the parameter matrix of the linear transformation, with Is the offset parameter. It can be seen that formulas (1) and (2) have the same algorithm, only the parameters are different. Through the above transformation function, k first transformation vectors and k second transformation vectors can be obtained.
  • transformation function forms can also be used, such as selecting different activation functions, modifying the form and number of parameters in the above formula, and so on.
  • the above-mentioned combination operation can be a bitwise multiplication between three vectors, namely The ⁇ symbol means bitwise multiplication.
  • the above-mentioned combination operation may also be other vector operations such as addition.
  • the combination operation is bitwise multiplication
  • the resulting combination vector V can be expressed as:
  • the node characteristics of the node With k implicit vectors input the third transformation function p and the fourth transformation function o, respectively, to obtain the third transformation vector p u (t) and the fourth transformation vector o u (t).
  • the third transformation function p can be obtained by first obtaining the vectors z u (t) and s u (t), and then performing z u (t) and s u (t) Combining operations, thereby obtaining the third transformation vector p u (t).
  • the third transformation function p can be obtained by first obtaining the vectors z u (t) and s u (t), and then performing z u (t) and s u (t) Combining operations, thereby obtaining the third transformation vector p u (t).
  • means bitwise multiplication.
  • z u (t) and s u (t) can be calculated according to the following formula:
  • W z , W s and Is the parameter matrix of linear transformation
  • b z and b s are offset parameters.
  • the fourth transformation function o can be obtained by obtaining the fourth transformation vector o u (t) through the following formula:
  • W o and I are the parameter matrix of linear transformation
  • b o is the offset parameter
  • the intermediate vector c u(t) of the node u(t) is determined.
  • the combined vector V and the third transformation vector p u (t) can be summed to obtain the intermediate vector c u(t) of u(t) .
  • the intermediate vector c u(t) can be expressed as:
  • combination methods such as weighted summation and bitwise multiplication, can be used to combine the combination vector V and the third transform vector, and the intermediate vector c u(t) can be obtained according to the combination result.
  • the implicit vector h u(t) of the node u(t) is determined.
  • the intermediate vector c u(t) can be combined with the fourth transformation vector o u (t) after performing the tanh function operation, such as bitwise multiplication, and the combined result is used as the node
  • the implicit vector h u(t) of u(t) namely:
  • the LSTM layer determines the node u(t) based on the node characteristics of the current processing node u(t), the intermediate vectors and hidden vectors of the k associated nodes pointed to by the node ) Is the intermediate vector c u(t) and the implicit vector h u(t) .
  • the interaction time corresponding to the current processing node u(t) and the k associated nodes pointed to are further introduced The time difference ⁇ between the corresponding interaction times.
  • the connected k associated nodes are: the object corresponding to node u(t) participated in the last time
  • the time when these interaction events occur simultaneously is recorded as the second interaction time t2.
  • the above-mentioned time difference ⁇ is the time difference between the first interaction time t1 and the second interaction time t2.
  • the LSTM layer can determine the node u(t) according to the node characteristics of the current processing node u(t), the respective intermediate vectors and hidden vectors of the k associated nodes pointed to by the node u(t), and the above-mentioned time difference ⁇ .
  • Implied vector h u(t) and intermediate vector c u(t) Implied vector h u(t) and intermediate vector c u(t) .
  • a processing process combining the time difference may include: combining the node characteristics of the second node u(t) and the time difference ⁇ with the k implicit vectors corresponding to the k associated nodes, respectively, and inputting the first transformation function g , Obtain k first transformation vectors; combine the node characteristics of the second node with the k implicit vectors corresponding to the k associated nodes, and input the second transformation function f to obtain k second transformation vectors; The intermediate vector of the i-th associated node among the k associated nodes is combined with the corresponding i-th first transform vector and the i-th second transform vector to obtain k operation results, and sum the k operation results , Obtain the combination vector; input the node feature of the second node together with the k implicit vectors, respectively, input the third transformation function and the
  • FIG. 10 shows the structure of an LSTM layer according to another embodiment. Comparing Fig. 10 and Fig. 9, it can be seen that the structure of Fig. 10 and the implemented algorithm are similar to Fig. 9, except that the time difference ⁇ (u, t) is further introduced on the basis of Fig. 9.
  • the time difference ⁇ (u,t) and the node characteristics of the node u(t) together, they are combined with the implicit vector of each associated node and input into the first transformation function g.
  • the first transformation function g can be modified to:
  • formula (10) further introduces the time term corresponding to the time difference ⁇ (u,t) on the basis of formula (1), correspondingly, It is a parameter for the time term, which can be embodied as a vector.
  • the process of combining the time difference may include the following steps: After the node characteristics of the second node u(t) and the time difference ⁇ are respectively combined with the k implicit vectors corresponding to the k associated nodes, Input the first transformation function g and the second transformation function f with the same algorithm and different parameters to obtain k first transformation vectors and k second transformation vectors respectively; compare the intermediate vector of the i-th associated node among the k associated nodes with The corresponding i-th first transform vector and the i-th second transform vector are combined to obtain k operation results, and the k operation results are summed to obtain the combined vector; the node feature of the second node is combined with the k implicit vectors, input the third transformation function and the fourth transformation function, respectively, to obtain the third transformation vector and the fourth transformation vector; based on the combination vector and the third transformation vector, determine the second node u(t ) C intermediate vector u (t); the second node based on C intermediate vector u (t) and
  • FIG. 11 shows the structure of an LSTM layer according to still another embodiment. It can be seen that the LSTM layer of Fig. 11 also introduces a time difference ⁇ (u, t), and, compared to Fig. 10, the time difference ⁇ (u, t) in Fig. 11 is further input to the second transformation function f. In other words, the time difference ⁇ (u,t) and the node characteristics of the node u(t) At the same time, they are combined with the implicit vector of each associated node and input into the first transformation function g and the second transformation function f.
  • the first transformation function g in FIG. 11 can still take the form of formula (10).
  • the second transformation function f may take the following form:
  • formula (11) further introduces the time term corresponding to the time difference ⁇ (u,t) on the basis of formula (2), correspondingly, It is a parameter for the time term, which can be embodied as a vector.
  • the above-mentioned time difference may be further input to the third transformation function p and/or the fourth transformation function o.
  • part or all of the aforementioned formulas (5), (6), (7) can be modified, and the time term for the time difference can be similarly introduced on the original basis, which will not be detailed here.
  • each node in the current subgraph is processed iteratively in order to obtain the intermediate vector and the implicit vector of the current node.
  • the hidden vector thus obtained can be used as the output of the neural network model to characterize the current node.
  • the above LSTM-based neural network model is different from the conventional LSTM network, but has been modified and optimized for the processing of multiple dynamic interactive graphs. It can be called the dynamic graph LSTM neural network model.
  • the dynamic graph LSTM neural network model may include multiple LSTM layers, where the implicit vector of a certain node determined by the previous LSTM layer is input to the next LSTM layer as the node Node characteristics.
  • each LSTM layer still processes each node iteratively, and determines the implicit vector of the node i according to the node characteristics of the current processing node i, the respective intermediate vectors and implicit vectors of the k associated nodes pointed to by the node i Vector and intermediate vector, but the bottom LSTM layer uses the original feature of node i as the node feature, and the subsequent LSTM layer uses the hidden vector h i of the node i determined by the previous LSTM layer as the node feature.
  • the above-mentioned multiple LSTM layers are stacked in a residual network manner to form a neural network model.
  • each LSTM layer can determine the hidden vector of the current node.
  • the neural network model synthesizes the hidden vectors of the current node output by each of the multiple LSTM layers to obtain the final hidden vector of the current node. More specifically, each implicit vector output by each LSTM layer can be weighted and combined to obtain the final implicit vector. The weight of the weighted combination can be simply set as each layer corresponds to a weight factor, and its size is adjusted through training. Alternatively, a more complex attention mechanism can also be used to determine the weight factor.
  • the neural network model may also use the hidden vector of the current node output by the last LSTM layer among the multiple LSTM layers as the final hidden vector of the current node.
  • the LSTM-based neural network model is based on the current subgraph corresponding to the current node to be analyzed, and obtains the hidden vector of the current node as its feature vector. Since the current subgraph reflects the time-series interaction history information related to the interactive object corresponding to the current node, the feature vector of the current node thus obtained not only expresses the characteristics of the interactive object itself, but also expresses the fact that the interactive object is in The impact of previous interaction events, which fully characterizes the characteristics of the interactive objects.
  • step 34 the business processing related to the current node is performed according to the implicit vector of the current node.
  • the foregoing business processing may be to predict the classification category of the object corresponding to the current node based on the implicit vector obtained above.
  • the user category of the user can be predicted based on the implicit vector, such as the category of the group to which it belongs, the category of risk level, and so on.
  • the category of the item can be predicted based on the implicit vector, such as the category of the business to which it belongs, the category of suitable people, the category of the scene being purchased, and so on.
  • the business processing may further include analyzing and predicting interaction events related to the current node. Since interaction events generally involve two objects, it is also necessary to analyze the feature vector of another node.
  • another node different from the aforementioned current node may be selected in the dynamic interaction graph, for example, v(t 6 ) in FIG. 4 and FIG. 5.
  • the hidden vector corresponding to the other node is determined.
  • the aforementioned current node and another node are two nodes corresponding to the first interaction event that has occurred. Then, the event category of the first interaction event can be predicted according to the implicit vectors corresponding to the two nodes respectively.
  • the user represented by the current node has confirmed to purchase the commodity represented by the other node, and the first interaction event is thus generated.
  • the implicit vector of the two nodes can be used to predict whether the first interaction event is a fraudulent transaction involving account embezzlement, so as to determine whether the payment is allowed.
  • the user represented by the current node has already performed a comment operation on an item (such as a movie) represented by another node, such as liking or posting a text comment, thereby generating the first interaction event. After that, it can be predicted whether the first interaction event is a real operation based on the implicit vectors of the two nodes.
  • the basis of the above-mentioned service processing is the implicit vector of the node determined by the LSTM neural network model based on the dynamic interaction graph.
  • the calculation process of the LSTM neural network model to determine the hidden vector of the node depends on a large number of parameters, such as the parameters in the aforementioned transformation functions. These parameters need to be determined by training the neural network model.
  • the neural network model can be trained through different tasks.
  • the neural network model is trained by predicting the interaction behavior.
  • Fig. 12 shows a flowchart of training a neural network model in this embodiment.
  • a historical interaction event is acquired, and the historical interaction event is an interaction event that has indeed occurred.
  • historical interaction events can be obtained from the aforementioned collection of interaction events.
  • the two objects included in the historical interaction event are called the first sample object and the second sample object.
  • step 122 in the dynamic interaction graph, a first subgraph corresponding to the first sample object and a second subgraph corresponding to the second sample object are respectively determined. Specifically, the first sample node corresponding to the first sample object and the second sample node corresponding to the second sample object are respectively determined in the dynamic interaction graph, and the first sample node and the second sample node are respectively taken as The current node determines the corresponding first sub-graph and second sub-graph in a similar manner to step 32 in FIG. 3.
  • step 123 the above-mentioned first subgraph and the second subgraph are respectively input into the neural network model, and the hidden vector of the first sample object and the hidden vector of the second sample object are obtained respectively.
  • the specific process of the neural network model to determine the hidden vector corresponding to the sample object based on the pointing relationship of the nodes in the subgraph is as described above in conjunction with step 33, and will not be repeated.
  • step 124 according to the implicit vector of the first sample object and the implicit vector of the second sample object, predict whether the first sample object and the second sample object will interact, and obtain the prediction result.
  • a two-class classifier can be used to predict whether two sample objects will interact, and the obtained prediction result is usually expressed as the probability of the two sample objects interacting.
  • the prediction loss is determined based on the above prediction result. It can be understood that the above-mentioned first sample object and second sample object come from historical interaction events, so the interaction has actually occurred, which is equivalent to knowing the relationship label between the two sample objects. According to the loss function form such as the cross entropy calculation method, the loss of this prediction can be determined based on the above prediction result.
  • the neural network model is updated based on the predicted loss.
  • methods such as gradient descent and back propagation can be used to adjust the parameters in the neural network to update the neural network model until the prediction accuracy of the neural network model reaches a certain requirement.
  • the foregoing uses two sample objects in historical interaction events to predict the relationship between objects, which is equivalent to using positive samples for training.
  • two sample objects that have not interacted with each other can also be found in the dynamic interaction graph as negative samples for further training, so as to achieve a better training effect.
  • the neural network model is trained by predicting the classification of interactive objects.
  • FIG. 13 shows a flowchart of training the neural network model in this embodiment.
  • a sample object is selected from each object involved in the interaction event set, and the classification label of the sample object is obtained.
  • the sample object may be any interaction object in any event included in the interaction event set, and the classification label for the sample object may be a label related to a business scenario.
  • the classification label may be a pre-set group classification label or a user risk level classification label; in the case where the sample object is a commodity, the classification label may be a commodity classification label.
  • Such labels can be generated by manual labeling, or generated through other business-related processing.
  • a sample subgraph corresponding to the sample object is determined.
  • the node corresponding to the sample object can be determined in the dynamic interaction graph, and the node is used as the current node to determine the corresponding sample subgraph in a similar manner to step 32 in FIG. 3.
  • step 133 the above-mentioned sample subgraph is input into the neural network model to obtain the hidden vector of the sample object. This process is the same as that described in step 33, and will not be repeated here.
  • step 134 the classification of the sample object is predicted according to the hidden vector of the sample object, and the prediction result is obtained.
  • a classifier can be used to predict each probability that the sample object belongs to each category as the prediction result.
  • the prediction loss is determined based on the prediction result and the classification label.
  • a cross-entropy calculation method can be used to predict each probability and classification label in the result, and determine the loss of this prediction.
  • step 136 the neural network model is updated based on the predicted loss. In this way, the neural network model is trained by predicting the task of classifying sample objects.
  • a dynamic interaction diagram is constructed based on a set of interaction events, and the dynamic interaction diagram can reflect the timing relationship of each interaction event and the mutual influence between interactive objects transmitted through each interaction event.
  • the dynamic interaction graph allows nodes to be connected to an unlimited number of associated nodes, thereby forming a mixed and diverse interaction graph.
  • the hidden vector of the interactive object can be extracted.
  • the implicit vector thus obtained introduces the influence of other interactive objects in each interactive event on it, so that the in-depth characteristics of the interactive object can be comprehensively expressed for business processing.
  • an apparatus for processing interactive data can be deployed in any device, platform, or device cluster with computing and processing capabilities.
  • Fig. 14 shows a schematic block diagram of an apparatus for processing interactive data according to an embodiment. As shown in FIG. 14, the processing device 140 includes the following units.
  • the interaction graph obtaining unit 141 is configured to obtain a dynamic interaction graph constructed according to an interaction event set, where the interaction event set includes a plurality of interaction events, and each interaction event includes at least two objects on which an interaction behavior occurs and an interaction time;
  • the dynamic interaction graph includes any first node, the first node corresponds to the first object in the interaction event that occurs at the first time, and the first node points to the M corresponding to the N associated events through the connecting edge.
  • Associated nodes, the N associated events all occur at a second time, and all include the first object as one of the interactive objects, and the second time is backtracking from the first time, the The time before the interaction behavior of the first object occurs;
  • the dynamic interaction graph includes at least one multi-element node whose number of associated nodes is greater than 2.
  • the subgraph determining unit 142 is configured to determine, in the dynamic interaction graph, a current subgraph corresponding to the current node to be analyzed, and the current subgraph includes nodes within a predetermined range that start from the current node and reach via the connecting edge. ;
  • the subgraph processing unit 143 is configured to input the current subgraph into a neural network model, the neural network model including an LSTM layer, and the LSTM layer is based on the direction relationship of the connecting edges between the nodes in the current subgraph, Iteratively process each node in turn to obtain the implicit vector of the current node; wherein each node includes a second node, and the iterative processing of each node in turn includes, at least according to the node characteristics of the second node, the second node The respective intermediate vectors and implicit vectors of the k associated nodes pointed to by the node determine the implicit vector and the intermediate vector of the second node.
  • the service processing unit 144 is configured to perform service processing related to the current node according to the implicit vector of the current node.
  • the object includes a user
  • the interaction event includes at least one of the following: a click event, a social event, and a transaction event.
  • the above-mentioned M associated nodes may be 2N nodes, respectively corresponding to the two objects included in each associated event in the N associated events; or, there may be N+1 nodes, respectively corresponding to N other objects interacting with the first object in the N associated events, and the first object itself.
  • the nodes within the predetermined range may include: nodes within a connecting edge of a preset order K; and/or nodes whose interaction time is within a preset time range.
  • the aforementioned current node is a node: in the dynamic interaction graph, there is no connecting edge pointing to the node.
  • each interaction event further includes the behavior characteristics of the interaction behavior; in this case, the node characteristics of the second node may include the attribute characteristics of the object corresponding to the second node, and the The behavior characteristics of the interaction event that the second node participates in the corresponding interaction time.
  • the LSTM layer in the neural network model used by the subgraph processing unit 143 is specifically used to: use the node characteristics of the second node to k implicit vectors corresponding to the k associated nodes. Combine, input the first transformation function and the second transformation function with the same algorithm and different parameters to obtain k first transformation vectors and k second transformation vectors respectively; the intermediate vector of the i-th associated node among the k associated nodes , Perform a combination operation with the corresponding i-th first transform vector and the i-th second transform vector to obtain k operation results, and sum the k operation results to obtain the combined vector; and the node of the second node
  • the features together with the k hidden vectors are input into the third transformation function and the fourth transformation function respectively to obtain the third transformation vector and the fourth transformation vector; based on the combination vector and the third transformation vector, the second transformation vector is determined
  • the intermediate vector of the node; based on the intermediate vector of the second node and the fourth transform vector, the implicit vector of the second node is determined.
  • the LSTM layer in the neural network model used by the subgraph processing unit 143 is used to: according to the node characteristics of the second node, the respective intermediate vectors of the k associated nodes pointed to by the second node and The implicit vector and the time difference between the interaction time corresponding to the second node and the interaction time corresponding to the k associated nodes determine the implicit vector and the intermediate vector of the second node.
  • the above-mentioned LSTM layer is specifically configured to: combine the node characteristics of the second node and the time difference with the k implicit vectors corresponding to the k associated nodes, respectively, and input the first A transformation function to obtain k first transformation vectors; respectively combine the node characteristics of the second node with the k implicit vectors corresponding to the k associated nodes, and input the second transformation function to obtain k second transformations Vector; Combine the intermediate vector of the i-th associated node among the k associated nodes with the corresponding i-th first transform vector and the i-th second transform vector to obtain k operation results, and the k operation results Sum to obtain a combined vector; input the node feature of the second node together with the k hidden vectors into the third transform function and the fourth transform function, respectively, to obtain the third transform vector and the fourth transform vector; based on The combined vector and the third transformation vector determine the intermediate vector of the second node; and the implicit vector of the second node is determined based on the
  • the above-mentioned LSTM layer is specifically used to: after the node characteristics of the second node and the time difference are combined with the k implicit vectors corresponding to the k associated nodes, the input algorithm is the same, The first transformation function and the second transformation function with different parameters respectively obtain k first transformation vectors and k second transformation vectors; compare the intermediate vector of the i-th associated node among the k associated nodes with the corresponding i-th The first transform vector and the i-th second transform vector are combined to obtain k operation results, and the k operation results are summed to obtain a combined vector; the node feature of the second node is combined with the k implicit Vector, input the third transformation function and the fourth transformation function respectively to obtain the third transformation vector and the fourth transformation vector; based on the combination vector and the third transformation vector, determine the intermediate vector of the second node; based on the The intermediate vector and the fourth transform vector of the second node determine the implicit vector of the second node.
  • the neural network model includes multiple LSTM layers, wherein the implicit vector of the second node determined by the previous LSTM layer is input to the next LSTM layer as the node feature of the second node.
  • the neural network model synthesizes the hidden vectors of the current node output by each of the multiple LSTM layers to obtain the final hidden vector of the current node.
  • the neural network model uses the hidden vector of the current node output by the last LSTM layer in the plurality of LSTM layers as the final hidden vector of the current node.
  • the neural network model is trained by the model training unit 145.
  • the model training unit 145 may be included in the device 140 or located outside it.
  • the model training unit 145 may include (not shown): a sample acquisition module configured to acquire historical interaction events, which includes a first sample object and a second sample object; and a sub-picture determining module, configured to be in the dynamic interaction diagram , Respectively determine a first sub-picture corresponding to the first sample object and a second sub-picture corresponding to the second sample object;
  • the vector acquisition module is configured to combine the first sub-picture and the first sub-picture The two sub-images are input into the neural network model respectively to obtain the implicit vector of the first sample object and the implicit vector of the second sample object;
  • the prediction module is configured to be based on the implicit vector of the first sample object
  • the vector and the implicit vector of the second sample object predict whether the first sample object and the second sample object will interact to obtain the prediction result;
  • the loss determination module is configured to determine the prediction loss according to the
  • the model training unit 145 may include (not shown): a sample acquisition module configured to select a sample object from a plurality of sample objects involved in the set of interaction events, and obtain a classification label of the sample object A subgraph determining module, configured to determine a sample subgraph corresponding to the sample object in the dynamic interaction graph; a vector acquisition module, configured to input the sample subgraph into the neural network model to obtain the sample A hidden vector of the object; a prediction module configured to predict the classification of the sample object according to the hidden vector of the sample object to obtain a prediction result; a loss determination module configured to according to the prediction result and the classification label, Determine the prediction loss; an update module configured to update the neural network model according to the prediction loss.
  • the neural network model is used to process the interactive objects, and feature vectors suitable for subsequent analysis are obtained.
  • a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed in a computer, the computer is caused to execute the method described in conjunction with FIG. 3.
  • a computing device including a memory and a processor, the memory is stored with executable code, and when the processor executes the executable code, it implements the method described in conjunction with FIG. 3 method.
  • the functions described in the present invention can be implemented by hardware, software, firmware, or any combination thereof.
  • these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on the computer-readable medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A method and an apparatus for processing interaction data. The method comprises: first acquiring a dynamic interaction diagram (200) constructed according to an interaction event set, any node i in the diagram pointing to, by means of connection edges, M associated nodes corresponding to N associated events in which an object represented by the node i last participated (31), the object being allowed to participate in a plurality of associated events at the same time, and the node being allowed to be connected to more than two associated nodes; then, in the dynamic interaction diagram (200), determining a current sub-diagram corresponding to the current node to be analyzed (32), and inputting the current sub-diagram into a neural network model for processing, the neural network model comprising an LSTM layer; and the LSTM layer successively and iteratively processing the nodes according to the pointing relationship of connecting edges between the nodes in the current sub-diagram, so as to obtain an implicit vector of the current node (33).

Description

利用LSTM神经网络模型处理交互数据的方法及装置Method and device for processing interactive data using LSTM neural network model 技术领域Technical field
本说明书一个或多个实施例涉及机器学习领域,尤其涉及利用机器学习处理交互数据的方法和装置。One or more embodiments of this specification relate to the field of machine learning, and more particularly to methods and devices for processing interactive data using machine learning.
背景技术Background technique
在许多场景下,需要对用户交互事件进行分析和处理。交互事件是互联网事件的基本组成元素之一,例如,用户浏览页面时的点击行为,可以视为用户与页面内容区块之间的交互事件,电商中的购买行为可以视为用户与商品之间的交互事件,账户间转账行为则是用户与用户之间的交互事件。用户的一系列交互事件中蕴含了用户的细粒度习惯偏好等特点,以及交互对象的特点,是机器学习模型的重要特征来源。因此,在许多场景下,希望根据交互事件对交互参与方进行特征表达和建模。In many scenarios, user interaction events need to be analyzed and processed. Interaction events are one of the basic elements of Internet events. For example, the click behavior of a user when browsing a page can be regarded as an interaction event between the user and the page content block, and the purchase behavior in e-commerce can be regarded as the relationship between the user and the product. Interaction events between users, and transfer behavior between accounts are interaction events between users. A series of user interaction events contain the user's fine-grained habits and preferences, as well as the characteristics of interactive objects, which are important source of features for machine learning models. Therefore, in many scenarios, it is desirable to characterize and model interactive participants based on interactive events.
然而,交互事件涉及交互双方,并且各个参与方本身的状态可以是动态变化的,因此,综合考虑交互参与方的多方面特点对其进行准确的特征表达非常困难。由此,希望能有改进的方案,更为有效地对交互事件中的交互对象进行分析处理,以得到适于后续业务分析的特征向量。However, an interactive event involves both parties to the interaction, and the status of each participant itself can be dynamically changed. Therefore, it is very difficult to accurately express the characteristics of the interactive participants comprehensively considering the various characteristics of the interactive parties. Therefore, it is hoped that there will be an improved solution to more effectively analyze and process the interactive objects in the interactive events, so as to obtain feature vectors suitable for subsequent business analysis.
发明内容Summary of the invention
本说明书一个或多个实施例描述了处理交互数据的方法和装置,其中利用LSTM神经网络模型,考虑交互对象参与的交互事件以及交互事件中其他对象的影响,将交互对象处理为隐含特征,从而进行后续业务处理分析。One or more embodiments of this specification describe methods and devices for processing interactive data, in which an LSTM neural network model is used to consider interactive events in which interactive objects participate and the influence of other objects in the interactive events, and process interactive objects as implicit features. So as to carry out subsequent business processing analysis.
根据第一方面,提供了一种处理交互数据的方法,所述方法包括:获取根据交互事件集构建的动态交互图,其中,所述交互事件集包括多个交互事件,每个交互事件至少包括,发生交互行为的两个对象和交互时间;所述动态交互图包括任意的第一节点,所述第一节点对应于发生在第一时间的交互事件中的第一对象,所述第一节点通过连接边指向N个关联事件所对应的M个关联节点,所述N个关联事件均发生于第二时间,且均包含所述第一对象作为交互对象之一,所述第二时间为,从所述第一时间向前回溯,所述第一对象发生交互行为的前一时间;所述动态交互图中包括至少一个关联节点数目大于2的多元节点;在所述动态交互图中,确定与待分析的当前节点对应的当前子图, 所述当前子图包括从当前节点出发,经由连接边到达的预定范围内的节点;将所述当前子图输入神经网络模型,所述神经网络模型包括LSTM层,所述LSTM层根据所述当前子图中各个节点之间的连接边的指向关系,依次迭代处理各个节点,从而得到所述当前节点的隐含向量;其中所述各个节点包括第二节点,所述依次迭代处理各个节点包括,至少根据所述第二节点的节点特征,该第二节点所指向的k个关联节点各自的中间向量和隐含向量,确定所述第二节点的隐含向量和中间向量;根据所述当前节点的隐含向量,进行与所述当前节点相关的业务处理。According to a first aspect, there is provided a method for processing interaction data, the method comprising: obtaining a dynamic interaction graph constructed according to an interaction event set, wherein the interaction event set includes a plurality of interaction events, and each interaction event includes at least , The two objects at which the interaction behavior occurs and the interaction time; the dynamic interaction graph includes any first node, and the first node corresponds to the first object in the interaction event that occurred at the first time, and the first node Pointing to the M associated nodes corresponding to the N associated events through the connecting edge, the N associated events all occur at the second time, and all include the first object as one of the interactive objects, and the second time is, Looking back from the first time forward, the time before the interaction behavior of the first object occurred; the dynamic interaction graph includes at least one multi-element node whose number of associated nodes is greater than 2; in the dynamic interaction graph, it is determined A current subgraph corresponding to the current node to be analyzed, where the current subgraph includes nodes within a predetermined range that start from the current node and reach via connecting edges; the current subgraph is input into a neural network model, and the neural network model Including the LSTM layer, the LSTM layer sequentially iteratively process each node according to the direction relationship of the connecting edge between each node in the current subgraph, so as to obtain the implicit vector of the current node; wherein each node includes the first Two nodes, the sequential iterative processing of each node includes, at least according to the node characteristics of the second node, the respective intermediate vectors and implicit vectors of the k associated nodes pointed to by the second node, determining the value of the second node Hidden vector and intermediate vector; according to the hidden vector of the current node, perform business processing related to the current node.
根据一种实施方式,上述对象包括用户,所述交互事件包括以下中的至少一种:点击事件,社交事件,交易事件。According to an embodiment, the aforementioned object includes a user, and the interaction event includes at least one of the following: a click event, a social event, and a transaction event.
在一个实施例中,上述M个关联节点为2N个节点,分别对应于所述N个关联事件中各个关联事件所包括的两个对象;或者,在另一实施例中,M个关联节点为N+1个节点,分别对应于所述N个关联事件中与所述第一对象交互的N个其他对象,以及所述第一对象自身。In one embodiment, the above-mentioned M associated nodes are 2N nodes, respectively corresponding to the two objects included in each associated event in the N associated events; or, in another embodiment, the M associated nodes are The N+1 nodes respectively correspond to the N other objects interacting with the first object in the N associated events, and the first object itself.
在不同实施方式中,上述预定范围内的节点可以包括,预设阶数K的连接边之内的节点;和/或,交互时间在预设时间范围内的节点。In different implementation manners, the nodes within the foregoing predetermined range may include nodes within a connecting edge of a preset order K; and/or nodes whose interaction time is within a preset time range.
在一个实施例中,每个交互事件还包括,交互行为的行为特征;在这样的情况下,所述第二节点的节点特征可以包括,第二节点所对应的对象的属性特征,以及所述第二节点在所对应的交互时间中参与的交互事件的行为特征。In an embodiment, each interaction event further includes the behavior characteristics of the interaction behavior; in this case, the node characteristics of the second node may include the attribute characteristics of the object corresponding to the second node, and the The behavior characteristics of the interaction event that the second node participates in the corresponding interaction time.
在一个实施例中,可以通过以下方式,确定第二节点的隐含向量和中间向量:将所述第二节点的节点特征,分别与所述k个关联节点对应的k个隐含向量组合,输入算法相同、参数不同的第一变换函数和第二变换函数,分别得到k个第一变换向量和k个第二变换向量;将所述k个关联节点中第i关联节点的中间向量,与对应的第i个第一变换向量,第i个第二变换向量进行组合操作,得到k个操作结果,将该k个操作结果求和,得到组合向量;将所述第二节点的节点特征连同所述k个隐含向量,分别输入第三变换函数和第四变换函数,分别得到第三变换向量和第四变换向量;基于所述组合向量和第三变换向量,确定所述第二节点的中间向量;基于所述第二节点的中间向量和第四变换向量,确定所述第二节点的隐含向量。In an embodiment, the implicit vector and the intermediate vector of the second node may be determined by the following method: combining the node characteristics of the second node with the k implicit vectors corresponding to the k associated nodes, respectively, Input the first transformation function and the second transformation function with the same algorithm and different parameters to obtain k first transformation vectors and k second transformation vectors respectively; and the intermediate vector of the i-th associated node among the k associated nodes, and The corresponding i-th first transform vector and the i-th second transform vector are combined to obtain k operation results, and the k operation results are summed to obtain the combined vector; the node characteristics of the second node are combined with The k implicit vectors are input into the third transformation function and the fourth transformation function respectively to obtain the third transformation vector and the fourth transformation vector; based on the combination vector and the third transformation vector, determine the value of the second node Intermediate vector; based on the intermediate vector of the second node and the fourth transform vector, the implicit vector of the second node is determined.
根据一种实施方式,依次迭代处理各个节点可以包括,根据所述第二节点的节点特征,该第二节点所指向的k个关联节点各自的中间向量和隐含向量,以及该第二节点对 应的交互时间与所述k个关联节点对应的交互时间之间的时间差,确定所述第二节点的隐含向量和中间向量。According to an embodiment, sequentially iteratively processing each node may include, according to the node characteristics of the second node, the respective intermediate vectors and implicit vectors of the k associated nodes pointed to by the second node, and the corresponding second node The time difference between the interaction time and the interaction time corresponding to the k associated nodes determines the implicit vector and the intermediate vector of the second node.
在上述实施方式的一个实施例中,可以通过以下方式,确定第二节点的隐含向量和中间向量:将第二节点的节点特征和所述时间差,与所述k个关联节点对应的k个隐含向量分别组合,输入第一变换函数,得到k个第一变换向量;将所述第二节点的节点特征与所述k个关联节点对应的k个隐含向量分别组合,输入第二变换函数,得到k个第二变换向量;将所述k个关联节点中第i关联节点的中间向量,与对应的第i第一变换向量,第i第二变换向量进行组合操作,得到k个操作结果,将该k个操作结果求和,得到组合向量;将所述第二节点的节点特征连同所述k个隐含向量,分别输入第三变换函数和第四变换函数,分别得到第三变换向量和第四变换向量;基于所述组合向量和第三变换向量,确定所述第二节点的中间向量;基于所述第二节点的中间向量和第四变换向量,确定所述第二节点的隐含向量。In an example of the foregoing implementation manner, the implicit vector and the intermediate vector of the second node can be determined in the following manner: the node characteristics of the second node and the time difference are determined by k corresponding to the k associated nodes. The implicit vectors are combined separately, and the first transformation function is input to obtain k first transformation vectors; the node characteristics of the second node and the k implicit vectors corresponding to the k associated nodes are respectively combined, and the second transformation is input Function to obtain k second transform vectors; combine the intermediate vector of the i-th associated node among the k associated nodes with the corresponding i-th first transform vector and the i-th second transform vector to obtain k operations As a result, the k operation results are summed to obtain a combined vector; the node feature of the second node and the k implicit vectors are input to the third transformation function and the fourth transformation function, respectively, to obtain the third transformation Vector and a fourth transformation vector; based on the combined vector and the third transformation vector, determine the intermediate vector of the second node; based on the intermediate vector and the fourth transformation vector of the second node, determine the intermediate vector of the second node Implied vector.
在上述实施方式的另一实施例中,可以通过以下方式,确定第二节点的隐含向量和中间向量:将第二节点的节点特征和所述时间差,与所述k个关联节点对应的k个隐含向量分别组合后,输入算法相同、参数不同的第一变换函数和第二变换函数,分别得到k个第一变换向量和k个第二变换向量;将所述k个关联节点中第i关联节点的中间向量,与对应的第i第一变换向量,第i第二变换向量进行组合操作,得到k个操作结果,将该k个操作结果求和,得到组合向量;将所述第二节点的节点特征连同所述k个隐含向量,分别输入第三变换函数和第四变换函数,分别得到第三变换向量和第四变换向量;基于所述组合向量和第三变换向量,确定所述第二节点的中间向量;基于所述第二节点的中间向量和第四变换向量,确定所述第二节点的隐含向量。In another embodiment of the foregoing implementation manner, the implicit vector and the intermediate vector of the second node can be determined in the following manner: the node characteristics of the second node and the time difference are determined by k corresponding to the k associated nodes. After the two implicit vectors are combined separately, the first transformation function and the second transformation function with the same algorithm and different parameters are input, and k first transformation vectors and k second transformation vectors are obtained respectively; The intermediate vector of the i-associated node is combined with the corresponding i-th first transform vector and the i-th second transform vector to obtain k operation results, and the k operation results are summed to obtain the combined vector; The node features of the two nodes and the k hidden vectors are input into the third transformation function and the fourth transformation function, respectively, to obtain the third transformation vector and the fourth transformation vector; based on the combination vector and the third transformation vector, determine The intermediate vector of the second node; based on the intermediate vector of the second node and the fourth transform vector, the implicit vector of the second node is determined.
根据一种实施方式,神经网络模型可以包括多个LSTM层,其中,上一LSTM层确定出的所述第二节点的隐含向量,输入到下一LSTM层作为该第二节点的节点特征。According to an embodiment, the neural network model may include multiple LSTM layers, wherein the implicit vector of the second node determined by the previous LSTM layer is input to the next LSTM layer as the node feature of the second node.
在上述实施方式的一个实施例中,所述神经网络模型将所述多个LSTM层各自输出的当前节点的隐含向量进行综合,得到所述当前节点的最终隐含向量。In an example of the foregoing implementation manner, the neural network model integrates the hidden vectors of the current node output by each of the multiple LSTM layers to obtain the final hidden vector of the current node.
在上述实施方式的另一实施例中,所述神经网络模型将所述多个LSTM层中最后一个LSTM层输出的当前节点的隐含向量,作为所述当前节点的最终隐含向量。In another example of the foregoing implementation manner, the neural network model uses the implicit vector of the current node output by the last LSTM layer among the plurality of LSTM layers as the final implicit vector of the current node.
根据一个实施例,所述神经网络模型通过以下方式训练:获取历史交互事件,其中包括第一样本对象和第二样本对象;在所述动态交互图中,分别确定与所述第一样本对 象对应的第一子图,和与所述第二样本对象对应的第二子图;将所述第一子图和所述第二子图分别输入所述神经网络模型,分别得到所述第一样本对象的隐含向量和第二样本对象的隐含向量;根据所述第一样本对象的隐含向量和第二样本对象的隐含向量,预测所述第一样本对象和第二样本对象是否会发生交互,得到预测结果;根据所述预测结果,确定预测损失;根据所述预测损失,更新所述神经网络模型。According to one embodiment, the neural network model is trained in the following manner: acquiring historical interaction events, including a first sample object and a second sample object; in the dynamic interaction graph, determining the relationship with the first sample The first subgraph corresponding to the object, and the second subgraph corresponding to the second sample object; the first subgraph and the second subgraph are respectively input to the neural network model to obtain the first subgraph respectively The hidden vector of the sample object and the hidden vector of the second sample object; according to the hidden vector of the first sample object and the hidden vector of the second sample object, predict the first sample object and the second sample object. Whether the two sample objects will interact to obtain a prediction result; determine the prediction loss according to the prediction result; and update the neural network model according to the prediction loss.
根据另一实施例,所述神经网络模型通过以下方式训练:从所述交互事件集涉及的多个样本对象中选择样本对象,并获取该样本对象的分类标签;在所述动态交互图中,确定与该样本对象对应的样本子图;将所述样本子图输入所述神经网络模型,得到所述样本对象的隐含向量;根据所述样本对象的隐含向量,预测所述样本对象的分类,得到预测结果;根据所述预测结果和所述分类标签,确定预测损失;根据所述预测损失,更新所述神经网络模型。According to another embodiment, the neural network model is trained in the following manner: a sample object is selected from a plurality of sample objects involved in the interaction event set, and the classification label of the sample object is obtained; in the dynamic interaction diagram, Determine the sample subgraph corresponding to the sample object; input the sample subgraph into the neural network model to obtain the hidden vector of the sample object; predict the hidden vector of the sample object according to the hidden vector of the sample object Classify to obtain a prediction result; determine a prediction loss according to the prediction result and the classification label; and update the neural network model according to the prediction loss.
根据第二方面,提供一种处理交互数据的装置,所述装置包括:交互图获取单元,配置为获取根据交互事件集构建的动态交互图,其中,所述交互事件集包括多个交互事件,每个交互事件至少包括,发生交互行为的两个对象和交互时间;所述动态交互图包括任意的第一节点,所述第一节点对应于发生在第一时间的交互事件中的第一对象,所述第一节点通过连接边指向N个关联事件所对应的M个关联节点,所述N个关联事件均发生于第二时间,且均包含所述第一对象作为交互对象之一,所述第二时间为,从所述第一时间向前回溯,所述第一对象发生交互行为的前一时间;所述动态交互图中包括至少一个关联节点数目大于2的多元节点;子图确定单元,配置为在所述动态交互图中,确定与待分析的当前节点对应的当前子图,所述当前子图包括从当前节点出发,经由连接边到达的预定范围内的节点;子图处理单元,配置为将所述当前子图输入神经网络模型,所述神经网络模型包括LSTM层,所述LSTM层根据所述当前子图中各个节点之间的连接边的指向关系,依次迭代处理各个节点,从而得到所述当前节点的隐含向量;其中所述各个节点包括第二节点,所述依次迭代处理各个节点包括,至少根据所述第二节点的节点特征,该第二节点所指向的k个关联节点各自的中间向量和隐含向量,确定所述第二节点的隐含向量和中间向量;业务处理单元,配置为根据所述当前节点的隐含向量,进行与所述当前节点相关的业务处理。According to a second aspect, there is provided an apparatus for processing interaction data, the apparatus comprising: an interaction graph obtaining unit configured to obtain a dynamic interaction graph constructed according to an interaction event set, wherein the interaction event set includes a plurality of interaction events, Each interaction event includes at least two objects where the interaction behavior occurred and the interaction time; the dynamic interaction graph includes any first node, and the first node corresponds to the first object in the interaction event that occurred at the first time , The first node points to the M associated nodes corresponding to the N associated events through the connecting edge, and the N associated events all occur at the second time, and all include the first object as one of the interactive objects, so The second time is, going back from the first time, the time before the interaction of the first object occurs; the dynamic interaction graph includes at least one multi-node with more than 2 associated nodes; the subgraph is determined A unit configured to determine, in the dynamic interaction graph, a current subgraph corresponding to the current node to be analyzed, the current subgraph including nodes within a predetermined range starting from the current node and arriving via a connecting edge; subgraph processing Unit, configured to input the current subgraph into a neural network model, the neural network model including an LSTM layer, and the LSTM layer sequentially iteratively processes each node according to the direction relationship of the connecting edges between the nodes in the current subgraph Node, thereby obtaining the implicit vector of the current node; wherein each node includes a second node, and the sequential iterative processing of each node includes, at least according to the node characteristics of the second node, the second node points to The respective intermediate vectors and implicit vectors of the k associated nodes determine the implicit vector and the intermediate vector of the second node; the service processing unit is configured to perform correlation with the current node according to the implicit vector of the current node Business processing.
根据第三方面,提供了一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行第一方面的方法。According to a third aspect, there is provided a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed in a computer, the computer is caused to execute the method of the first aspect.
根据第四方面,提供了一种计算设备,包括存储器和处理器,其特征在于,所述存 储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现第一方面的方法。According to a fourth aspect, there is provided a computing device, including a memory and a processor, characterized in that executable code is stored in the memory, and when the processor executes the executable code, the method of the first aspect is implemented .
根据本说明书实施例提供的方法和装置,基于交互事件集构建动态交互图,该动态交互图反映了各个交互事件的时序关系,以及交互对象之间通过各个交互事件传递的相互影响。考虑实践操作中交互事件同时发生的可能性,该动态交互图允许节点连接到不限数目的关联节点,由此形成混合多元的交互图。利用训练的LSTM神经网络模型,基于该动态交互图中与待分析交互对象相关的子图,可以提取得到该交互对象的隐含向量。如此得到的隐含向量中引入了各个交互事件中其他交互对象对其的影响,从而可以综合全面地表达该交互对象的深层特征,用于进行业务处理。According to the method and device provided in the embodiments of this specification, a dynamic interaction diagram is constructed based on a set of interaction events, and the dynamic interaction diagram reflects the timing relationship of each interaction event and the mutual influences between interactive objects transmitted through each interaction event. Considering the possibility of simultaneous occurrence of interaction events in practical operations, the dynamic interaction graph allows nodes to be connected to an unlimited number of associated nodes, thereby forming a mixed and diverse interaction graph. Using the trained LSTM neural network model, based on the subgraphs related to the interactive object to be analyzed in the dynamic interaction graph, the hidden vector of the interactive object can be extracted. The implicit vector thus obtained introduces the influence of other interactive objects in each interactive event on it, so that the in-depth characteristics of the interactive object can be expressed comprehensively and used for business processing.
附图说明Description of the drawings
为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to explain the technical solutions of the embodiments of the present invention more clearly, the following will briefly introduce the drawings used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. A person of ordinary skill in the art can obtain other drawings based on these drawings without creative work.
图1A示出在一个例子中的交互关系二部图;Figure 1A shows a two-part diagram of the interaction relationship in an example;
图1B示出在另一例子中的交互关系网络图;FIG. 1B shows an interactive relationship network diagram in another example;
图2示出根据一个实施例的实施场景示意图;Fig. 2 shows a schematic diagram of an implementation scenario according to an embodiment;
图3示出根据一个实施例的处理交互数据的方法流程图;Fig. 3 shows a flowchart of a method for processing interactive data according to an embodiment;
图4示出根据一个实施例构建的动态交互图;Figure 4 shows a dynamic interaction diagram constructed according to an embodiment;
图5示出根据另一个实施例构建的动态交互图;Figure 5 shows a dynamic interaction diagram constructed according to another embodiment;
图6示出在一个实施例中当前子图的示例;Figure 6 shows an example of the current subgraph in one embodiment;
图7示出在另一个实施例中当前子图的示例;FIG. 7 shows an example of the current subgraph in another embodiment;
图8示出LSTM层的工作示意图;Figure 8 shows a schematic diagram of the work of the LSTM layer;
图9示出根据一个实施例LSTM层的结构;Figure 9 shows the structure of an LSTM layer according to an embodiment;
图10示出根据另一实施例的LSTM层的结构;FIG. 10 shows the structure of an LSTM layer according to another embodiment;
图11示出根据又一实施例的LSTM层的结构;FIG. 11 shows the structure of an LSTM layer according to another embodiment;
图12示出在一个实施例中训练神经网络模型的流程图;Figure 12 shows a flowchart of training a neural network model in one embodiment;
图13示出在另一实施例中训练神经网络模型的流程图;Figure 13 shows a flowchart of training a neural network model in another embodiment;
图14示出根据一个实施例的处理交互数据的装置的示意性框图。Fig. 14 shows a schematic block diagram of an apparatus for processing interactive data according to an embodiment.
具体实施方式Detailed ways
下面结合附图,对本说明书提供的方案进行描述。The following describes the solutions provided in this specification with reference to the accompanying drawings.
如前所述,希望能够基于交互事件,对交互事件的参与方,即交互对象进行特征表达和建模。As mentioned above, it is hoped that based on the interaction event, the participants in the interaction event, that is, the interaction object, can be characterized and modeled.
在一种方案中,基于历史交互事件构建静态的交互关系网络图,从而基于该交互关系网络图,分析各个交互对象。具体地,可以以各个历史事件的参与者作为节点,在存在交互关系的节点之间建立连接边,从而形成上述交互网络图。In one solution, a static interaction relationship network diagram is constructed based on historical interaction events, so that each interaction object is analyzed based on the interaction relationship network diagram. Specifically, participants in each historical event can be used as nodes, and connecting edges can be established between nodes that have an interactive relationship, so as to form the foregoing interactive network graph.
图1A和图1B分别示出在具体例子中的交互关系网络图。更具体而言,图1A示出一个二部图,其中包含用户节点(U1-U4)和商品节点(V1-V3),如果某个用户购买过某件商品,则在该用户和该商品之间构建一条连接边。图1B示出一个用户转账关系图,其中每个节点代表一个用户,发生过转账记录的两个用户之间存在连接边。Fig. 1A and Fig. 1B respectively show the interactive relationship network diagram in a specific example. More specifically, Figure 1A shows a bipartite graph, which contains user nodes (U1-U4) and product nodes (V1-V3). If a user has purchased a product, it will be between the user and the product. Construct a connecting edge between. Figure 1B shows a user transfer relationship diagram, in which each node represents a user, and there is a connecting edge between two users who have made transfer records.
然而,可以看到,图1A和图1B尽管示出了对象之间的交互关系,但是没有包含这些交互事件的时序信息。简单地基于这样的交互关系网络图进行图嵌入,获得的特征向量也没有表达出交互事件的时间信息对节点的影响。并且,这样的静态图可扩展性不够强,对于新增交互事件和新增节点的情况,难以灵活进行处理。However, it can be seen that although FIG. 1A and FIG. 1B show the interaction relationship between objects, they do not contain the timing information of these interaction events. Simply embedding the graph based on such an interactive relationship network graph, the obtained feature vector does not express the influence of the time information of the interactive event on the node. Moreover, the scalability of such a static graph is not strong enough, and it is difficult to flexibly handle the situation of newly-added interactive events and newly-added nodes.
在另一方案中,对于各个待分析的交互对象,构建该对象的行为序列,基于该行为序列,提取该对象的特征表达。然而,这样的行为序列仅表征了待分析对象本身的行为,而交互事件是多方参与的事件,参与者之间会通过交互事件间接传递影响。因此,这样的方式没有表达出交互事件中的参与对象之间的影响。In another solution, for each interactive object to be analyzed, a behavior sequence of the object is constructed, and the characteristic expression of the object is extracted based on the behavior sequence. However, such a behavior sequence only characterizes the behavior of the object to be analyzed, and interactive events are events involving multiple parties, and the participants will indirectly transmit influence through the interaction events. Therefore, this method does not express the influence between the participating objects in the interaction event.
综合考虑以上因素,根据本说明书的一个或多个实施例,将动态变化的交互事件集合构建成动态交互图,其中各个交互事件中涉及的各个交互对象对应于该动态交互图中的各个节点。任意节点连接到若干关联节点,其中关联节点为该任意节点所对应的对象上次参与的交互事件对应的节点。对于待分析的交互对象,从该动态交互图中得到对应节点相关的子图部分,将该子图部分输入基于LSTM的神经网络模型,得到该交互对象的特征向量表达。Taking the above factors into consideration, according to one or more embodiments of this specification, a dynamically changing set of interaction events is constructed into a dynamic interaction graph, wherein each interaction object involved in each interaction event corresponds to each node in the dynamic interaction graph. An arbitrary node is connected to a number of associated nodes, where the associated node is the node corresponding to the interaction event that the object corresponding to the arbitrary node participated in last time. For the interactive object to be analyzed, the subgraph part related to the corresponding node is obtained from the dynamic interaction graph, and the subgraph part is input into the LSTM-based neural network model to obtain the feature vector expression of the interactive object.
图2示出根据一个实施例的实施场景示意图。如图2所示,可以获取发生的多个交 互事件所构成的交互事件集。更具体的,该交互事件集可以是将多个交互事件按时间顺序组织成的交互事件序列<E 1,E 2,…,E N>,其中每个元素E i表示一个交互事件,可以表示为交互特征组的形式E i=(a i,b i,t i),其中a i和b i是事件E i的两个交互对象,t i是交互时间。由于时间测量的精度等因素,允许在同一时间发生多个交互事件。 Fig. 2 shows a schematic diagram of an implementation scenario according to an embodiment. As shown in Figure 2, the set of interaction events composed of multiple interaction events can be obtained. More particularly, the interaction may be a set of events more interaction events chronologically organized into a sequence of interactive events <E 1, E 2, ... , E N>, where each element represents an interactive event E i, may be expressed is a form of interactive features set E i = (a i, b i, t i), where a i and b i are the two objects interact in the event E i, t i is the time of interaction. Due to factors such as the accuracy of time measurement, multiple interaction events are allowed to occur at the same time.
根据本说明书的实施例,基于该交互事件集构建动态交互图200。在图200中,将各个交互事件中的各个交互对象a i,b i用节点表示,并在包含同一对象的事件之间建立连接边。由于允许同时发生多个交互事件,动态交互图200中包含至少一个多元节点,该多元节点可以连接到3个或更多的关联节点。动态交互图200的结构将在后续进行更具体的描述。 According to an embodiment of the present specification, a dynamic interaction diagram 200 is constructed based on the set of interaction events. In FIG. 200, the individual interactive objects each interaction event a i, b i represented by nodes, and establishes a connection between the edges containing the same event object. Since multiple interaction events are allowed to occur at the same time, the dynamic interaction graph 200 contains at least one multi-element node, and the multi-element node can be connected to 3 or more associated nodes. The structure of the dynamic interaction graph 200 will be described in more detail later.
对于某个待分析的交互对象,可以确定出其在动态交互图中对应的当前节点,并得到动态交互图中与该当前节点有关的当前子图。一般地,当前子图包括从当前节点出发,经过连接边可以达到的一定范围的节点。当前子图反映了,与当前交互对象直接或间接关联的交互事件中的其他对象对当前节点带来的影响。For a certain interactive object to be analyzed, the corresponding current node in the dynamic interaction graph can be determined, and the current subgraph related to the current node in the dynamic interaction graph can be obtained. Generally, the current subgraph includes a certain range of nodes that can be reached from the current node through the connecting edge. The current subgraph reflects the influence of other objects in the interaction event directly or indirectly associated with the current interaction object on the current node.
然后,将当前子图输入到基于长短期记忆LSTM的神经网络模型,通过该模型,输出得到当前交互对象的特征向量。如此得到的特征向量,可以抽取出相关联的交互事件的时间信息和各交互事件中的交互对象之间的影响,从而更准确地表达当前交互对象的深层特征。这样的特征向量可以在后续应用于各种机器学习模型和各种业务处理场景。例如,可以基于如此得到的特征向量进行强化学习,也可以基于该特征向量进行聚类分析,例如,将用户聚类为人群。还可以基于这样的特征向量进行分类预测,例如,预测两个对象之间是否会发生交互(比如某个用户是否会购买某个商品),预测某个对象的业务类型(比如某个用户的风险层级),等等。Then, the current sub-image is input to the neural network model based on long and short-term memory LSTM, and the feature vector of the current interactive object is output through the model. The feature vector obtained in this way can extract the time information of the associated interaction event and the influence between the interaction objects in each interaction event, so as to more accurately express the in-depth characteristics of the current interaction object. Such feature vectors can be subsequently applied to various machine learning models and various business processing scenarios. For example, reinforcement learning can be performed based on the feature vector thus obtained, or cluster analysis can be performed based on the feature vector, for example, clustering users into groups of people. You can also perform classification prediction based on such feature vectors, for example, predict whether there will be interaction between two objects (such as whether a user will buy a certain product), and predict the business type of a certain object (such as the risk of a certain user). Level), etc.
下面描述以上构思的具体实现方式。The specific implementation of the above concept is described below.
图3示出根据一个实施例的处理交互数据的方法流程图。可以理解,可以理解,该方法可以通过任何具有计算、处理能力的装置、设备、平台、设备集群来执行。下面结合具体实施例,对如图3所示的处理交互数据的方法中的各个步骤进行描述。Fig. 3 shows a flowchart of a method for processing interactive data according to an embodiment. It is understandable and understandable that the method can be executed by any device, device, platform, or device cluster with computing and processing capabilities. The following describes each step in the method for processing interactive data as shown in FIG. 3 in conjunction with specific embodiments.
首先,在步骤31,获取根据交互事件集构建的动态交互图。First, in step 31, a dynamic interaction graph constructed according to the set of interaction events is obtained.
如前所述,可以获取多个交互事件构成的交互事件集,其中每个交互事件具有两个交互对象和交互时间。因此,任意交互事件E i可以表示为一个交互特征组E i=(a i,b i,t i),其中a i和b i是事件E i的两个交互对象,例如称为第一对象和第二对象,t i是交互时间。 As mentioned above, it is possible to obtain an interaction event set composed of multiple interaction events, where each interaction event has two interaction objects and interaction time. Thus, any interaction events E i may be expressed as a set of interactive features E i = (a i, b i, t i), where a i and b i are two events E i interactive object, such as a first target With the second object, t i is the interaction time.
例如,在电商平台中,交互事件可以是用户的购买行为,其中的第一对象可以是某个用户,第二对象可以是某个商品。在另一例子中,交互事件可以是用户对页面区块的点击行为,其中的第一对象可以是某个用户,第二对象可以是某个页面区块。在又一例子中,交互事件可以是交易事件,例如一个用户向另一用户转账,或者一个用户向一个店铺或平台进行支付。在另外一个例子中,交互事件可以是用户通过社交平台发生的社交事件,例如聊天、通话、发红包等等。在其他业务场景中,交互事件还可以是其他在两个对象之间发生的交互行为。For example, in an e-commerce platform, the interaction event may be a user's purchase behavior, where the first object may be a certain user, and the second object may be a certain commodity. In another example, the interaction event may be a user's click behavior on a page block, where the first object may be a certain user, and the second object may be a certain page block. In another example, the interaction event may be a transaction event, for example, a user transfers money to another user, or a user makes a payment to a store or platform. In another example, the interaction event may be a social event that a user occurs through a social platform, such as chatting, calling, sending red envelopes, and so on. In other business scenarios, interaction events can also be other interaction behaviors that occur between two objects.
在一个实施例中,根据交互事件的特点,发生交互的两个对象可以是不同类型的对象,例如称为第一类对象和第二类对象。例如,在交互事件为电商平台中的购买行为时,其中的第一类对象可以是某个用户,第二类对象可以是某个商品。在另一些实施例中,交互事件涉及的两个对象可以是同类对象。例如,在即时通讯场景中,交互事件可以是两个用户之间进行了一次即时通讯。此时,第一对象和第二对象均为用户,属于同类对象。在又一些实施例中,可以根据业务的需要,来设定是否区分两个交互对象的类型。例如,对于转账交互事件,在前述例子中,可以认为两个用户属于同类对象。在其他例子中,也可以根据业务需要,将金额转出方用户认为是第一类对象,将接收方用户认为是第二类对象。In one embodiment, according to the characteristics of the interaction event, the two objects interacting may be objects of different types, such as objects of the first type and objects of the second type. For example, when the interaction event is a purchase behavior in an e-commerce platform, the first type of object may be a certain user, and the second type of object may be a certain commodity. In other embodiments, the two objects involved in the interaction event may be objects of the same type. For example, in an instant messaging scenario, the interaction event may be an instant communication between two users. At this time, both the first object and the second object are users and belong to the same type of objects. In still other embodiments, whether to distinguish the types of two interactive objects can be set according to the needs of the business. For example, for the transfer interaction event, in the foregoing example, it can be considered that the two users belong to the same type of object. In other examples, according to business needs, the user who transfers the amount may be regarded as an object of the first type, and the user who is the recipient is regarded as an object of the second type.
进一步的,在一个实施例中,每个交互事件对应的交互特征组还可以包括事件特征或行为特征f,如此,每个交互特征组可以表示为X i=(a i,b i,t i,f)。具体的,事件特征或行为特征f可以包括交互事件发生的背景和上下文信息,交互行为的一些属性特征,等等。 Further, in an embodiment, the interaction feature group corresponding to each interaction event may also include event feature or behavior feature f. In this way, each interaction feature group can be expressed as X i = (a i , b i , t i ,f). Specifically, the event feature or behavior feature f may include background and context information of the occurrence of the interaction event, some attribute features of the interaction behavior, and so on.
例如,在交互事件为用户点击事件的情况下,事件特征f可以包括,用户进行点击所使用的终端的类型,浏览器类型,app版本,等等;在交互事件为交易事件的情况下,事件特征f可以包括,例如,交易类型(商品购买交易、转账交易等),交易金额,交易渠道等等。For example, in the case where the interaction event is a user click event, the event feature f may include the type of terminal used by the user to click, browser type, app version, etc.; in the case where the interaction event is a transaction event, the event The feature f may include, for example, transaction type (commodity purchase transaction, transfer transaction, etc.), transaction amount, transaction channel, and so on.
以上描述了交互事件以及事件中的交互对象a i,b i的举例。 Interactivity events described above as well as in the event interactive objects a i, b i of example.
对于交互时间t i,需要理解,实际操作中总是会以一个适当的时长为单位对时间进行测量和记录。例如,在一些服务平台,记录交互时间的单位时长可以是小时h,或者分钟m。于是,在该单位时长之内很可能会发生多个交互事件。即使是以较短的时长为单位,例如秒s甚至毫秒ms,对于一些交互非常频繁的服务平台,例如支付宝,仍然会不可避免地出现,单位时长内多个交互事件的情况。 For the interaction time t i , it needs to be understood that in actual operation, the time is always measured and recorded in an appropriate duration unit. For example, in some service platforms, the unit duration for recording the interaction time can be hours h or minutes m. Therefore, multiple interaction events are likely to occur within the unit duration. Even if it takes a short duration as a unit, such as seconds or even milliseconds, for some service platforms that interact very frequently, such as Alipay, there will inevitably be multiple interaction events within a unit of time.
此外,还存在一些批量交互的情况。例如,用户预先编辑了一条消息,并选中了一个好友群,然后进行批量群发的操作。这相当于同时发起与多个好友的交互事件。又例如,用户在购物车中添加了多件商品,然后选择了批量结算,这相当于同时发起与多个商品的交互事件。In addition, there are some cases of batch interaction. For example, the user edits a message in advance, selects a group of friends, and then performs a batch group sending operation. This is equivalent to initiating an interaction event with multiple friends at the same time. For another example, a user adds multiple items to the shopping cart and then selects batch settlement, which is equivalent to simultaneously initiating interaction events with multiple items.
至少出于以上两个方面的原因,往往会出现多个交互事件所记录的交互时间相同的情况。对于这样的情况,本文中有时简称为同时发生的多个交互事件,而不区分其精确的时刻和先后。For at least the above two reasons, it is often the case that the interaction time recorded by multiple interaction events is the same. For such situations, this article is sometimes referred to as multiple interactive events occurring at the same time, without distinguishing their precise time and sequence.
在一个具体例子中,假定获取到了一个交互事件集S,该交互事件集S中的交互事件按照时间顺序排列,并以交互特征组的形式表示,可以记录为如下:In a specific example, it is assumed that an interaction event set S is obtained. The interaction events in the interaction event set S are arranged in chronological order and expressed in the form of interaction feature groups, which can be recorded as follows:
Figure PCTCN2020138398-appb-000001
Figure PCTCN2020138398-appb-000001
其中,a,b,c,d,e,f,u,v为交互对象,交互事件E 2和E 3均发生于t 2时间,交互事件E 4,E 5和E 6均发生于t 3时间,交互事件E 7和E 8均发生于t 4时间。 Among them, a, b, c, d, e, f, u, v are interaction objects, interaction events E 2 and E 3 all occur at time t 2 and interaction events E 4 , E 5 and E 6 all occur at t 3 At time, the interaction events E 7 and E 8 both occurred at time t 4.
对于以上所述的交互事件集,可以构建动态交互图,来刻画各个交互事件以及交互对象之间的关联关系。具体的,可以将各个时间发生的交互事件中包含的对象作为动态交互图的节点。如此,一个节点可以对应在一个时间下发生交互行为的一个对象,但是同一实体对象可能对应到多个节点。例如,实体对象v在t 6时间与对象u进行交互,可以对应构建节点v(t 6),在t 5时间与对象c进行交互,可以对应构建节点v(t 5)。因此可以认为,动态交互图中的节点对应于在一定交互时间下的交互对象,或者说,对应于该交互对象在一定交互时间下的状态。 For the set of interaction events described above, a dynamic interaction diagram can be constructed to depict the association relationships between interaction events and interaction objects. Specifically, the objects contained in the interaction events occurring at each time can be used as the nodes of the dynamic interaction graph. In this way, a node can correspond to an object that interacts at a time, but the same entity object may correspond to multiple nodes. For example, if the entity object v interacts with the object u at time t 6 , the node v(t 6 ) can be constructed correspondingly, and the node v(t 5 ) can be constructed correspondingly by interacting with the object c at t 5 time. Therefore, it can be considered that the nodes in the dynamic interaction graph correspond to the interactive object at a certain interaction time, or in other words, correspond to the state of the interactive object at a certain interaction time.
对于动态交互图中的每个节点,按照以下方式构建连接边:对于任意节点i,简单起见将其称为第一节点;假定其对应于第一交互时间t下的第一对象,那么在交互事件序列中,从第一交互时间t向前回溯,也就是向早于第一交互时间t的方向回溯,确定出第一对象发生交互行为的上一时间为第二时间(t-),将第二时间中发生的、该第一对象参与的N个交互事件作为第一节点的N个关联事件,将N个关联事件对应的M个节点作为关联节点,建立从第一节点i指向M个关联节点的连接边。由于存在同一时间发生多个交互事件的可能,因此,N可能大于1。如此,动态交互图中可以包括多元节点,即,所连接的关联节点数目大于2的节点。For each node in the dynamic interaction graph, construct the connecting edge in the following way: For any node i, it is called the first node for simplicity; assuming that it corresponds to the first object at the first interaction time t, then in the interaction In the event sequence, backtracking from the first interaction time t, that is, backtracking in the direction earlier than the first interaction time t, it is determined that the last time when the first object interacted is the second time (t-), and The N interaction events that occur in the second time and the first object participates in are regarded as the N associated events of the first node, and the M nodes corresponding to the N associated events are regarded as the associated nodes, and it is established to point from the first node i to M The connecting edge of the associated node. Due to the possibility of multiple interaction events occurring at the same time, N may be greater than 1. In this way, the dynamic interaction graph may include multiple nodes, that is, nodes with more than two connected associated nodes.
在一个实施例中,在构建动态交互图时,为每个交互事件的两个对象都分别建立对 应节点。如此,前述的N个关联事件对应2N个节点,这2N个节点即作为前述M个关联节点。In one embodiment, when constructing the dynamic interaction graph, corresponding nodes are respectively established for the two objects of each interaction event. In this way, the aforementioned N associated events correspond to 2N nodes, and these 2N nodes are regarded as the aforementioned M associated nodes.
图4示出根据一个实施例构建的动态交互图。具体的,图4左侧示出将前述交互事件集S按照时间顺序组织的交互序列示意图,右侧示出一个动态交互图。在该动态交互图中,将各个交互事件中的两个交互对象分别作为节点。下面以节点u(t 6)和v(t 6)为例,描述连接边的构建。 Fig. 4 shows a dynamic interaction diagram constructed according to an embodiment. Specifically, the left side of FIG. 4 shows a schematic diagram of an interaction sequence that organizes the foregoing interaction event set S in chronological order, and the right side shows a dynamic interaction diagram. In this dynamic interaction graph, two interaction objects in each interaction event are respectively regarded as nodes. The following takes nodes u(t 6 ) and v(t 6 ) as examples to describe the construction of connecting edges.
可以理解,该节点u(t 6)表示时间t 6下的对象u。于是,从时间t 6出发向前回溯,可以确定出对象u上一次发生交互行为的时间为t 4,在该时间t 4中参与了2个关联事件E 7和E 8,即交互事件E 7和E 8均包含对象u作为交互对象之一。因此,关联事件E 7和E 8所对应的4个节点,即为节点u(t 6)的关联节点。在图4中,为了区分事件E 7和E 8中的对象节点u,将其记为u 1(t 4)和u 2(t 4)。于是,建立从节点u(t 6)指向其4个关联节点的连接边。 It can be understood that the node u(t 6 ) represents the object u at time t 6. Therefore, starting from time t 6 and backtracking, it can be determined that the time when the object u had an interactive behavior last time is t 4 , during which time t 4 participated in two related events E 7 and E 8 , namely, the interaction event E 7 Both E and E 8 contain the object u as one of the interactive objects. Therefore, the four nodes corresponding to the associated events E 7 and E 8 are the associated nodes of the node u(t 6 ). In Fig. 4, in order to distinguish the object node u in the events E 7 and E 8 , they are denoted as u 1 (t 4 ) and u 2 (t 4 ). Thus, a connecting edge from the node u(t 6 ) to its 4 associated nodes is established.
节点v(t 6)表示时间t 6下的对象v。于是,从时间t 6出发向前回溯,可以确定出对象v上一次发生交互行为的时间为t 5,在该时间t 5中参与了1个关联事件E 9。因此,关联事件E 9所对应的2个节点v(t 5)和c(t 5),即为节点v(t 6)的关联节点。于是,建立从节点v(t 6)指向该2个关联节点的连接边。对于其他各个节点,均可以采用上述方式,确定出其关联事件和关联节点,从而建立指向关联节点的连接边。在图4所示的动态交互图中,节点u(t 6),c(t 5)都是多元节点。 The node v(t 6 ) represents the object v at time t 6. Therefore, starting from time t 6 and looking back forward, it can be determined that the time when the object v had an interactive behavior last time is t 5 , during which time t 5 participated in an associated event E 9 . Therefore, the two nodes v(t 5 ) and c(t 5 ) corresponding to the associated event E 9 are the associated nodes of node v(t 6 ). Then, a connecting edge from the node v(t 6 ) to the two associated nodes is established. For each other node, the above-mentioned method can be used to determine its associated event and associated node, so as to establish a connection edge to the associated node. In the dynamic interaction graph shown in Figure 4, the nodes u(t 6 ) and c(t 5 ) are all multi-element nodes.
在另一个实施例中,在构建动态交互图时,对于发生于同一时间的多个交互事件,确定出该多个交互事件所涉及的不同交互对象,为各个不同交互对象分别建立对应节点。也就是说,如果同一时间发生的多个交互事件中包含同样的对象,则仅为该同样的对象建立一个节点。如此,在建立连接边时,如果对应于第一对象的第一节点存在N个关联事件,那么这N个关联事件则对应N+1个关联节点,分别对应于第一对象自身,以及N个关联事件中与第一对象交互的N个其他对象。In another embodiment, when constructing a dynamic interaction graph, for multiple interaction events that occur at the same time, different interaction objects involved in the multiple interaction events are determined, and corresponding nodes are established for each different interaction object. In other words, if multiple interaction events that occur at the same time contain the same object, only one node is established for the same object. In this way, when establishing a connection edge, if there are N associated events corresponding to the first node of the first object, then these N associated events correspond to N+1 associated nodes, corresponding to the first object itself, and N N other objects interacting with the first object in the associated event.
图5示出根据另一个实施例构建的动态交互图。具体的,图5左侧示出前述交互事件集S,右侧示出一个动态交互图。在该动态交互图中,为同时发生的交互事件中不同的交互对象分别建立对应节点。图5的动态交互图与图4的相比,区别在于,将图4中发生于同一时间的多个交互事件中相同对象的节点合并为一个节点。例如,对于均发生于时间t 4的两个交互事件E 7,E 8,其中涉及3个不同交互对象a,b,u,则为该时间下的交互事件建立3个节点a(t 4),b(t 4),u(t 4)。这相当于将图4中的u 1(t 4)和u 2(t 4)合并为一个节点u(t 4)。在这样的情况下,在一个示例中,可以通过节点之间的虚线双向箭头示出 发生的交互关系,例如通过图5的虚线双向箭头可以示出,在t 4时间,对象a与u存在交互行为,对象b与u存在交互行为,但是对象a和b之间没有交互行为。 Fig. 5 shows a dynamic interaction diagram constructed according to another embodiment. Specifically, the left side of FIG. 5 shows the aforementioned interaction event set S, and the right side shows a dynamic interaction diagram. In the dynamic interaction graph, corresponding nodes are respectively established for different interaction objects in the interaction events that occur at the same time. The difference between the dynamic interaction diagram of FIG. 5 and that of FIG. 4 is that the nodes of the same object in the multiple interaction events that occur at the same time in FIG. 4 are merged into one node. For example, for two interaction events E 7 , E 8 that both occur at time t 4 , which involve three different interaction objects a, b, u, then three nodes a(t 4 ) are established for the interaction event at that time , B(t 4 ), u(t 4 ). This is equivalent to merging u 1 (t 4 ) and u 2 (t 4 ) in Fig. 4 into one node u(t 4 ). In this case, in one example, can be shown by the dashed double arrows between the nodes of the interactions occur, for example, shown by the dashed double arrow in FIG. 5, at time t 4, there is an interaction with a target u Behavior, there is interaction between objects b and u, but there is no interaction between objects a and b.
下面仍以节点u(t 6)和v(t 6)为例,描述连接边的构建。 The following still takes the nodes u(t 6 ) and v(t 6 ) as examples to describe the construction of connecting edges.
如前所述,节点u(t 6)表示时间t 6下的对象u。从时间t 6出发向前回溯,可以确定出对象u上一次发生交互行为的时间为t 4,在该时间t 4中参与了2个关联事件E 7和E 8,即交互事件E 7和E 8均包含对象u作为交互对象之一。关联事件E 7和E 8对应的3个节点a(t 4),b(t 4),u(t 4),为节点u(t 6)的关联节点。于是,建立从节点u(t 6)指向该3个关联节点的连接边。 As mentioned earlier, the node u(t 6 ) represents the object u at time t 6. Starting from time t 6 and looking back, it can be determined that the time when the object u had an interactive behavior last time is t 4 , during which time t 4 participated in two related events E 7 and E 8 , namely, interactive events E 7 and E 8 all contain the object u as one of the interactive objects. The three nodes a(t 4 ), b(t 4 ), and u(t 4 ) corresponding to the associated events E 7 and E 8 are associated nodes of the node u(t 6 ). Then, a connecting edge from the node u(t 6 ) to the three associated nodes is established.
从节点v(t 6),可以建立指向关联事件E 9所对应的2个节点v(t 5)和c(t 5)的连接边,该过程与结合图4的描述相同,不再赘述。对于图5中的其他各个节点,均可以采用上述方式,确定出其关联事件和关联节点,从而建立指向关联节点的连接边。在图5所示的动态交互图中,节点u(t 6),c(t 5)都是多元节点。 From the node v(t 6 ), a connecting edge pointing to the two nodes v(t 5 ) and c(t 5 ) corresponding to the associated event E 9 can be established. This process is the same as the description in conjunction with FIG. 4 and will not be repeated. For each of the other nodes in Figure 5, the above-mentioned methods can be used to determine the associated events and associated nodes, so as to establish a connection edge to the associated node. In the dynamic interaction graph shown in Figure 5, the nodes u(t 6 ) and c(t 5 ) are all multi-element nodes.
以上描述了基于交互事件集构建动态交互图的方式和过程。对于图3所示的处理交互数据的方法而言,构建动态交互图的过程可以预先进行也可以现场进行。相应地,在一个实施例中,在步骤31,根据交互事件集现场构建动态交互图。构建方式如以上所述。在另一实施例中,可以预先基于交互事件集构建形成动态交互图。在步骤31,读取或接收已形成的动态交互图。The above describes the method and process of constructing a dynamic interaction graph based on the set of interaction events. For the method of processing interactive data shown in FIG. 3, the process of constructing a dynamic interactive graph can be performed in advance or on site. Correspondingly, in one embodiment, in step 31, a dynamic interaction diagram is constructed on-site according to the interaction event set. The construction method is as described above. In another embodiment, a dynamic interaction graph may be constructed based on a set of interaction events in advance. In step 31, read or receive the formed dynamic interaction graph.
可以理解,按照以上方式构建的动态交互图具有很强的可扩展性,可以非常容易地根据新增的交互事件进行动态更新。相应地,步骤31还可以包括更新动态交互图的过程。It can be understood that the dynamic interaction graph constructed in the above manner has strong scalability and can be dynamically updated according to newly added interaction events very easily. Correspondingly, step 31 may also include a process of updating the dynamic interaction graph.
具体地,可以获取基于已有交互事件集构建的已有动态交互图,然后随着时间的更新,不断检测更新时间中发生的新增交互事件,根据新增交互事件,更新已有动态交互图。Specifically, an existing dynamic interaction diagram constructed based on an existing interaction event set can be obtained, and then as time is updated, new interaction events that occur during the update time are continuously detected, and the existing dynamic interaction diagram is updated according to the new interaction events .
在一个实施例中,已有动态交互图采用图4的形式,每个交互事件对应两个节点。在这样的情况下,假定获取到第一更新时间发生的P个新增交互事件,那么,就在已有动态交互图中添加2P个新增节点,所述2P个新增节点分别对应于P个新增交互事件中各个新增交互事件包括的两个对象。然后,对于每个新增节点,按照前述方式,寻找其关联事件和关联节点。如果其存在关联节点,则添加从该新增节点指向其关联节点的连接边。In one embodiment, the existing dynamic interaction graph adopts the form of FIG. 4, and each interaction event corresponds to two nodes. In this case, assuming that P new interaction events that occurred at the first update time are obtained, then 2P new nodes are added to the existing dynamic interaction graph, and the 2P new nodes respectively correspond to P Two objects included in each of the new interactive events. Then, for each newly added node, find its associated events and associated nodes in the aforementioned manner. If there is an associated node, add a connecting edge from the newly added node to its associated node.
在另一实施例中,已有动态交互图采用图5的形式,同时发生的交互事件中不同对象对应不同节点。在这样的情况下,在获取到第一更新时间发生的P个新增交互事件后,首先确定该P个新增交互事件所涉及的Q个不同对象。如果P个新增交互事件中不存在相同的交互对象,那么Q=2P;如果P个新增交互事件中存在相同的交互对象,那么Q<2P。接着,在已有动态交互图中添加Q个新增节点,所述Q个新增节点分别对应于Q个不同对象。然后,对于每个新增节点,按照前述方式,寻找其关联事件和关联节点。如果其存在关联节点,则添加从该新增节点指向其关联节点的连接边。In another embodiment, the existing dynamic interaction graph adopts the form of FIG. 5, and different objects in simultaneous interaction events correspond to different nodes. In this case, after acquiring the P newly-added interaction events that occurred at the first update time, first determine the Q different objects involved in the P newly-added interaction events. If the same interaction object does not exist in the P newly added interaction events, then Q=2P; if the same interaction object exists in the P newly added interaction events, then Q<2P. Then, Q new nodes are added to the existing dynamic interaction graph, and the Q new nodes respectively correspond to Q different objects. Then, for each newly added node, find its associated events and associated nodes in the aforementioned manner. If there is an associated node, add a connecting edge from the newly added node to its associated node.
综合以上,在步骤31,获取到基于交互事件集构建的动态交互图。In summary, in step 31, a dynamic interaction graph constructed based on the set of interaction events is obtained.
接着,在步骤32,在获取的动态交互图中,确定与待分析的当前节点对应的当前子图,所述当前子图包括从当前节点出发,经由连接边到达的预定范围内的节点。Next, in step 32, in the acquired dynamic interaction graph, a current subgraph corresponding to the current node to be analyzed is determined, and the current subgraph includes nodes within a predetermined range that start from the current node and reach through the connecting edge.
当前节点是与待分析的交互对象对应的节点。然而如前所述,一个实体对象可以对应多个节点,表达该实体对象在不同时间下的状态。为了表达出待分析的交互对象的最新状态,在一个实施例中,选择这样的节点作为当前节点,即在动态交互图中,不存在指向该节点的连接边。也就是说,选择待分析对象最近发生交互行为的时间下对应的节点作为当前节点。例如,在图4和图5所示的动态交互图中,当想要分析交互对象u时,可以选择节点u(t 6)作为当前节点。然而,这并不是必须的。在其他实施例中,例如为了训练的目的,也可以选择其他节点作为当前节点,例如,为了分析对象u也可以选择节点u(t 4)作为当前节点。 The current node is the node corresponding to the interactive object to be analyzed. However, as mentioned earlier, an entity object can correspond to multiple nodes, expressing the state of the entity object at different times. In order to express the latest state of the interaction object to be analyzed, in one embodiment, such a node is selected as the current node, that is, in the dynamic interaction graph, there is no connecting edge pointing to the node. In other words, select the node corresponding to the time when the object to be analyzed recently interacted as the current node. For example, in the dynamic interaction diagrams shown in Figs. 4 and 5, when you want to analyze the interactive object u, you can select the node u(t 6 ) as the current node. However, this is not required. In other embodiments, for example, for training purposes, another node may be selected as the current node. For example, in order to analyze the object u, the node u(t 4 ) may also be selected as the current node.
从当前节点出发,经由连接边到达的预定范围内的节点,构成当前节点对应的当前子图。在一个实施例中,上述预定范围内的节点可以是,至多经过预设阶数K的连接边可达的节点。这里阶数K为预设的超参数,可以根据业务情况选取。可以理解,该预设阶数K体现了,在表达当前节点的信息时,向前回溯的历史交互事件的步数。数目K越大,则考虑越多阶次的历史交互信息。Starting from the current node, the nodes within the predetermined range reached via the connecting edge constitute the current subgraph corresponding to the current node. In an embodiment, the nodes within the foregoing predetermined range may be nodes that are reachable by connecting edges of at most a preset order K. Here, the order K is a preset hyperparameter, which can be selected according to business conditions. It can be understood that the preset order K reflects the number of steps of historical interaction events that are traced forward when the information of the current node is expressed. The larger the number K is, the more historical interactive information of order is considered.
在另一实施例中,上述预定范围内的节点还可以是,交互时间在预定时间范围内的节点。例如,从当前节点的交互时间向前回溯T时长(例如一天),在该时长范围内、且可通过连接边达到的节点。In another embodiment, the nodes within the foregoing predetermined range may also be nodes whose interaction time is within the predetermined time range. For example, backtracking from the interaction time of the current node for a duration of T (for example, one day), the nodes within the range of duration that can be reached by connecting edges.
在又一实施例中,上述预定范围既考虑连接边的数目,又考虑时间范围。换而言之,该预定范围内的节点是指,至多经过预设阶数K的连接边可达、且交互时间在预定时间范围内的节点。In another embodiment, the aforementioned predetermined range considers both the number of connected edges and the time range. In other words, the nodes within the predetermined range refer to nodes whose connecting edges passing through the preset order K at most are reachable and whose interaction time is within the predetermined time range.
简单起见,下面的例子中,以预设阶数K的连接边为例进行描述。For simplicity, in the following example, the connection edge of the preset order K is taken as an example for description.
图6示出在一个实施例中当前子图的示例。在图6的例子中,假定图4中的u(t 6)为当前节点,预设阶数K=2,那么从u(t 6)出发,沿连接边的指向进行遍历,经由2级连接边可以达到的节点如图中灰色节点所示。这些灰色节点以及其间的连接关系即为当前节点u(t 6)对应的当前子图。 Figure 6 shows an example of the current subgraph in one embodiment. In the example in Figure 6, suppose that u(t 6 ) in Figure 4 is the current node, and the preset order K=2, then starting from u(t 6 ), traverse along the direction of the connecting edge, and connect via 2 levels The nodes that the edges can reach are shown in the gray nodes in the figure. These gray nodes and the connection relationship between them are the current subgraph corresponding to the current node u(t 6 ).
图7示出在另一个实施例中当前子图的示例。在图7的例子中,假定图5中的u(t 6)为当前节点,预设阶数K=2,那么从u(t 6)出发,沿连接边的指向进行遍历,经由2级连接边可以达到的节点如图中灰色节点所示。这些灰色节点以及其间的连接关系即为当前节点u(t 6)对应的当前子图。 Fig. 7 shows an example of the current subgraph in another embodiment. In the example in Figure 7, suppose u(t 6 ) in Figure 5 is the current node, and the preset order K=2, then starting from u(t 6 ), traverse along the direction of the connecting edge, and connect via 2 levels The nodes that the edges can reach are shown in the gray nodes in the figure. These gray nodes and the connection relationship between them are the current subgraph corresponding to the current node u(t 6 ).
接着,在步骤33,将当前子图输入神经网络模型,该神经网络模型包括LSTM层。对于当前子图中的任意一个节点,为了表述的方便称为第二节点,LSTM层进行以下处理:至少根据该第二节点的节点特征,该第二节点所指向的k个关联节点各自的中间向量和隐含向量,确定该第二节点的隐含向量和中间向量。如此,LSTM层根据当前子图中各个节点之间的连接边的指向关系,依次迭代处理各个节点,从而得到当前节点的隐含向量。Next, in step 33, the current sub-image is input to the neural network model, which includes the LSTM layer. For any node in the current subgraph, it is called the second node for the convenience of expression, and the LSTM layer performs the following processing: at least according to the node characteristics of the second node, the middle of each of the k associated nodes pointed to by the second node The vector and the hidden vector are used to determine the hidden vector and the intermediate vector of the second node. In this way, the LSTM layer iteratively processes each node in turn according to the direction relationship of the connecting edge between each node in the current subgraph, so as to obtain the implicit vector of the current node.
图8示出LSTM层的工作示意图。假定节点Q指向k个关联节点:节点J 1到节点J k。如图8所示,在T时刻,LSTM层分别处理得到节点J 1到节点J k的表示向量H 1到H k,包括中间向量和隐含向量;在接下来的T+时刻,LSTM层根据节点Q的节点特征,之前处理得到的J 1到J k的表示向量H 1到H k,得到节点Q的表示向量H Q。可以理解,该节点Q的表示向量可以在后续时刻,用于处理得到指向节点Q的节点的表示向量,如此实现迭代处理。 Figure 8 shows the working schematic diagram of the LSTM layer. Assume that node Q points to k associated nodes: node J 1 to node J k . 8, at time T, were treated to give LSTM layer node to node J 1 J k represents a vector H 1 to H k, and a vector comprising an intermediate vector implicit; the next time T +, according to the node layer LSTM The node characteristics of Q, the representation vectors H 1 to H k of J 1 to J k obtained by the previous processing, and the representation vector H Q of node Q is obtained. It can be understood that the representation vector of the node Q can be used to obtain the representation vector of the node pointing to the node Q at a subsequent time, so as to implement iterative processing.
结合图7的当前子图描述这一过程。对于图中各个最下层的节点,例如节点a(t 2),在该当前子图中不考虑其指向节点,也就是认为a(t 2)不具有关联节点。在这样的情况下,通过用缺省值(例如0)填补(padding)的方式产生该节点所指向的关联节点各自的中间向量c和隐含向量h。于是,LSTM层基于该节点a(t 2)的节点特征,以及缺省的关联节点的中间向量c和隐含向量h,确定节点a(t 2)的中间向量c(a(t 2))和隐含向量h(a(t 2))。对于其他最下层节点也做同样的处理,得到其对应的中间向量和隐含向量。 This process is described in conjunction with the current sub-figure of FIG. 7. For each lowest-level node in the graph, for example, node a(t 2 ), its pointing node is not considered in the current subgraph, that is, it is considered that a(t 2 ) does not have associated nodes. In this case, the intermediate vector c and the implicit vector h of the associated node pointed to by the node are generated by padding with a default value (for example, 0). Thus node features, LSTM layer based on the node a (t 2), and the default node associated intermediate vector c and vector H implied, determination node a (t 2) of the intermediate vector c (a (t 2)) And the implicit vector h(a(t 2 )). Do the same process for the other lowest-level nodes to get the corresponding intermediate vector and hidden vector.
对于中间层节点a(t 4),其指向2个关联节点a(t 2)和f(t 2)。因此,LSTM层根据该节点a(t 4)本身的节点特征,以及其指向的2个关联节点a(t 2)和f(t 2)各自 的中间向量和隐含向量,即c(a(t 2)),h(a(t 2)),c(f(t 2))和h(f(t 2)),确定节点a(t 4)的中间向量c(a(t 4))和h(a(t 4))。对于其他中间层节点也做同样的处理,得到其对应的中间向量和隐含向量。 For the intermediate node a(t 4 ), it points to two associated nodes a(t 2 ) and f(t 2 ). Therefore, the LSTM layer is based on the node characteristics of the node a(t 4 ) itself, and the respective intermediate and hidden vectors of the two associated nodes a(t 2 ) and f(t 2) it points to, namely c(a( t 2 )), h(a(t 2 )), c(f(t 2 )) and h(f(t 2 )), determine the intermediate vector c(a(t 4 )) of node a(t 4) And h(a(t 4 )). Do the same process for other middle layer nodes to get their corresponding middle vector and hidden vector.
对于节点u(t 6),其指向3个关联节点a(t 4),u(t 4)和b(t 4)。因此,LSTM层根据该节点u(t 6)本身的节点特征,以及其指向的3个关联节点a(t 4),u(t 4)和b(t 4)各自的中间向量和隐含向量,即c(a(t 4)),h(a(t 4)),c(u(t 4)),h(u(t 4)),c(b(t 4))和h(b(t 4)),确定节点u(t 6)的中间向量c(u(t 6))和h(u(t 6))。 For node u(t 6 ), it points to three associated nodes a(t 4 ), u(t 4 ) and b(t 4 ). Therefore, the LSTM layer is based on the node characteristics of the node u(t 6 ) itself, and the respective intermediate vectors and implicit vectors of the three associated nodes a(t 4 ), u(t 4 ) and b(t 4) it points to , Namely c(a(t 4 )), h(a(t 4 )), c(u(t 4 )), h(u(t 4 )), c(b(t 4 )) and h(b (t 4 )), determine the intermediate vectors c(u(t 6 )) and h(u(t 6 )) of the node u(t 6 ).
如此,层层迭代处理,可以得到当前节点u(t 6)的中间向量和隐含向量。 In this way, iterative processing can obtain the intermediate vector and implicit vector of the current node u(t 6 ).
下面描述为了实现以上的迭代处理,LSTM层的内部结构和算法。The following describes the internal structure and algorithm of the LSTM layer in order to achieve the above iterative processing.
图9示出根据一个实施例LSTM层的结构。在图9的示例中,当前处理的节点记为u(t),
Figure PCTCN2020138398-appb-000002
表示该节点u(t)的节点特征。在节点表示用户的情况下,节点特征可以包括用户的属性特征,例如年龄、职业、教育程度、所在地区,等等;在节点表示商品的情况下,节点特征可以包括商品的属性特征,例如商品类别、上架时间、销量等等。在节点表示其他交互对象的情况下,可以相应的获取到原始的节点特征。在交互事件的特征组中还包括事件特征或行为特征f的情况下,也可以在节点特征中包含该节点所对应的交互时间中所参与的各个交互事件的行为特征f。
Figure 9 shows the structure of the LSTM layer according to one embodiment. In the example in Figure 9, the currently processed node is denoted as u(t),
Figure PCTCN2020138398-appb-000002
Indicates the node characteristics of the node u(t). In the case where the node represents the user, the node feature may include the user's attribute characteristics, such as age, occupation, education level, location, etc.; in the case of the node representing the commodity, the node feature may include the attribute feature of the commodity, such as a commodity Category, time on sale, sales volume, etc. In the case where the node represents other interactive objects, the original node characteristics can be obtained accordingly. In the case that the feature group of the interaction event also includes the event feature or the behavior feature f, the node feature may also include the behavior feature f of each interaction event participating in the interaction time corresponding to the node.
假定节点u(t)指向k个关联节点,记为u 1(t),u 2(t),…,u k(t),每个关联节点对应具有中间向量c和隐含向量h。图9中示例性示出了k=3的例子,相应的,
Figure PCTCN2020138398-appb-000003
表示关联节点的中间向量,
Figure PCTCN2020138398-appb-000004
表示关联节点的隐含向量,在图9中i分别为1,2,3。但是可以理解,图9所示的计算关系可以适用于k为其他值的情况。例如,如果节点u(t)不具有真实的关联节点,则k=0,此时可以用缺省值,例如零向量,作为关联节点的中间向量和隐含向量;如果节点u(t)为二元节点,则k=2,此时可以将例如零向量的缺省值作为第三个关联节点u 3(t)对应的中间节点和隐含向量;如果节点u(t)的关联节点数目大于3,则在图9所示的基础上进一步添加更多关联节点对应的中间向量和隐含向量作为输入。
Assuming that the node u(t) points to k associated nodes, denoted as u 1 (t), u 2 (t),..., u k (t), each associated node has an intermediate vector c and a hidden vector h. Fig. 9 exemplarily shows an example of k=3, correspondingly,
Figure PCTCN2020138398-appb-000003
Represents the intermediate vector of the associated node,
Figure PCTCN2020138398-appb-000004
Represents the implicit vector of the associated node. In Figure 9, i is 1, 2, and 3 respectively. However, it can be understood that the calculation relationship shown in FIG. 9 can be applied to the case where k is other values. For example, if the node u(t) does not have a real associated node, then k=0. At this time, a default value, such as a zero vector, can be used as the intermediate vector and implicit vector of the associated node; if the node u(t) is Binary node, then k=2, at this time, for example, the default value of the zero vector can be used as the intermediate node and implicit vector corresponding to the third associated node u 3 (t); if the number of associated nodes of node u(t) If it is greater than 3, then add more intermediate vectors and hidden vectors corresponding to the associated nodes as input on the basis of FIG. 9.
LSTM层对于输入其中的节点特征、中间向量和隐含向量进行以下运算。The LSTM layer performs the following operations on the input node features, intermediate vectors and hidden vectors.
将节点特征
Figure PCTCN2020138398-appb-000005
分别与k个关联节点对应的k个隐含向量
Figure PCTCN2020138398-appb-000006
(其中i为从1到k)组合,分别输入算法相同、参数不同的第一变换函数g和第二变换函数f,分别得到k个第一变换向量和k个第二变换向量。
Node feature
Figure PCTCN2020138398-appb-000005
K implicit vectors corresponding to k associated nodes respectively
Figure PCTCN2020138398-appb-000006
(Where i is from 1 to k) combination, respectively input the first transformation function g and the second transformation function f with the same algorithm and different parameters to obtain k first transformation vectors and k second transformation vectors respectively.
更具体的,在一个例子中,第一变换函数g和第二变换函数f分别采用以下公式(1)和公式(2)计算:More specifically, in an example, the first transformation function g and the second transformation function f are calculated using the following formula (1) and formula (2), respectively:
Figure PCTCN2020138398-appb-000007
Figure PCTCN2020138398-appb-000007
Figure PCTCN2020138398-appb-000008
Figure PCTCN2020138398-appb-000008
以上公式(1)和公式(2)中,σ为激活函数,例如是sigmoid函数,
Figure PCTCN2020138398-appb-000009
Figure PCTCN2020138398-appb-000010
Figure PCTCN2020138398-appb-000011
为线性变换的参数矩阵,
Figure PCTCN2020138398-appb-000012
Figure PCTCN2020138398-appb-000013
为偏移量参数。可以看到,公式(1)和(2)算法相同,仅参数不同。通过以上的变换函数,可以得到k个第一变换向量和k个第二变换向量。
In the above formula (1) and formula (2), σ is the activation function, such as the sigmoid function,
Figure PCTCN2020138398-appb-000009
Figure PCTCN2020138398-appb-000010
with
Figure PCTCN2020138398-appb-000011
Is the parameter matrix of the linear transformation,
Figure PCTCN2020138398-appb-000012
with
Figure PCTCN2020138398-appb-000013
Is the offset parameter. It can be seen that formulas (1) and (2) have the same algorithm, only the parameters are different. Through the above transformation function, k first transformation vectors and k second transformation vectors can be obtained.
当然,在其他例子中,也可以采用类似但不同的变换函数形式,例如选择不同的激活函数,修改以上公式中参数的形式和数目,等等。Of course, in other examples, similar but different transformation function forms can also be used, such as selecting different activation functions, modifying the form and number of parameters in the above formula, and so on.
然后,将k个关联节点中第i关联节点u i(t)的中间向量
Figure PCTCN2020138398-appb-000014
与对应的第i个第一变换向量
Figure PCTCN2020138398-appb-000015
和第i个第二变换向量
Figure PCTCN2020138398-appb-000016
进行组合操作,于是得到k个操作结果,将该k个操作结果求和,得到组合向量V。
Then, take the intermediate vector of the i-th associated node u i (t) among the k associated nodes
Figure PCTCN2020138398-appb-000014
And the corresponding i-th first transformation vector
Figure PCTCN2020138398-appb-000015
And the i-th second transform vector
Figure PCTCN2020138398-appb-000016
The combination operation is performed, and then k operation results are obtained, and the k operation results are summed to obtain the combined vector V.
具体的,在一个例子中,上述组合操作可以是,三个向量之间的按位相乘,即
Figure PCTCN2020138398-appb-000017
其中⊙符号表示按位相乘。在其他例子中,上述组合操作也可以是相加等其他向量操作。在组合操作为按位相乘的情况下,得到的组合向量V可以表示为:
Specifically, in an example, the above-mentioned combination operation can be a bitwise multiplication between three vectors, namely
Figure PCTCN2020138398-appb-000017
The ⊙ symbol means bitwise multiplication. In other examples, the above-mentioned combination operation may also be other vector operations such as addition. When the combination operation is bitwise multiplication, the resulting combination vector V can be expressed as:
Figure PCTCN2020138398-appb-000018
Figure PCTCN2020138398-appb-000018
此外,还将节点的节点特征
Figure PCTCN2020138398-appb-000019
连同k个隐含向量
Figure PCTCN2020138398-appb-000020
(其中i为从1到k),分别输入第三变换函数p和第四变换函数o,分别得到第三变换向量p u(t)和第四变换向量o u(t)。
In addition, the node characteristics of the node
Figure PCTCN2020138398-appb-000019
With k implicit vectors
Figure PCTCN2020138398-appb-000020
(Where i is from 1 to k), input the third transformation function p and the fourth transformation function o, respectively, to obtain the third transformation vector p u (t) and the fourth transformation vector o u (t).
具体的,在图9所示的例子中,第三变换函数p可以是,先求得向量z u(t)和s u(t),再将z u(t)和s u(t)进行组合操作,由此得到第三变换向量p u(t)。例如,在一个具体例子中: Specifically, in the example shown in Figure 9, the third transformation function p can be obtained by first obtaining the vectors z u (t) and s u (t), and then performing z u (t) and s u (t) Combining operations, thereby obtaining the third transformation vector p u (t). For example, in a specific example:
p u(t)=z u(t)⊙s u(t)       (4) p u (t) = z u (t)⊙s u (t) (4)
其中,⊙表示按位相乘。Among them, ⊙ means bitwise multiplication.
更具体的,z u(t)和s u(t)可以按照以下公式计算: More specifically, z u (t) and s u (t) can be calculated according to the following formula:
Figure PCTCN2020138398-appb-000021
Figure PCTCN2020138398-appb-000021
Figure PCTCN2020138398-appb-000022
Figure PCTCN2020138398-appb-000022
其中,W z
Figure PCTCN2020138398-appb-000023
W s
Figure PCTCN2020138398-appb-000024
为线性变换的参数矩阵,b z和b s为偏移量参数。
Among them, W z ,
Figure PCTCN2020138398-appb-000023
W s and
Figure PCTCN2020138398-appb-000024
Is the parameter matrix of linear transformation, and b z and b s are offset parameters.
第四变换函数o可以是,通过以下公式得到第四变换向量o u(t): The fourth transformation function o can be obtained by obtaining the fourth transformation vector o u (t) through the following formula:
Figure PCTCN2020138398-appb-000025
Figure PCTCN2020138398-appb-000025
其中,W o
Figure PCTCN2020138398-appb-000026
为线性变换的参数矩阵,b o为偏移量参数。
Among them, W o and
Figure PCTCN2020138398-appb-000026
Is the parameter matrix of linear transformation, and b o is the offset parameter.
接着,基于上述组合向量V和第三变换向量p u(t),确定节点u(t)的中间向量c u(t)。例如,可以将组合向量V和第三变换向量p u(t)求和,得到u(t)的中间向量c u(t)。在一个具体的例子中,中间向量c u(t)可以表示为: Next, based on the above-mentioned combination vector V and the third transformation vector p u (t), the intermediate vector c u(t) of the node u(t) is determined. For example, the combined vector V and the third transformation vector p u (t) can be summed to obtain the intermediate vector c u(t) of u(t) . In a specific example, the intermediate vector c u(t) can be expressed as:
Figure PCTCN2020138398-appb-000027
Figure PCTCN2020138398-appb-000027
在其他例子中,也可以通过其他组合方式,例如加权求和,按位相乘,将组合向量V和第三变换向量进行组合,并根据组合结果得到中间向量c u(t)In other examples, other combination methods, such as weighted summation and bitwise multiplication, can be used to combine the combination vector V and the third transform vector, and the intermediate vector c u(t) can be obtained according to the combination result.
此外,基于如此得到的节点u(t)的中间向量c u(t)和第四变换向量o u(t),确定该节点u(t)的隐含向量h u(t)In addition, based on the intermediate vector c u(t) and the fourth transformation vector o u (t) of the node u(t) thus obtained, the implicit vector h u(t) of the node u(t) is determined.
在图9所示的具体例子中,可以将中间向量c u(t)进行tanh函数运算后,与第四变换向量o u(t)进行组合,例如按位相乘,将组合结果作为该节点u(t)的隐含向量h u(t),即: In the specific example shown in Figure 9, the intermediate vector c u(t) can be combined with the fourth transformation vector o u (t) after performing the tanh function operation, such as bitwise multiplication, and the combined result is used as the node The implicit vector h u(t) of u(t) , namely:
h u(t)=o u(t)⊙tanh(c u(t))      (9) h u(t) = o u(t) ⊙tanh(c u(t) ) (9)
于是,根据图9所示的结构和算法,LSTM层根据当前处理节点u(t)的节点特征,该节点所指向的k个关联节点各自的中间向量和隐含向量,确定该节点u(t)的中间向量c u(t)和隐含向量h u(t)Therefore, according to the structure and algorithm shown in Figure 9, the LSTM layer determines the node u(t) based on the node characteristics of the current processing node u(t), the intermediate vectors and hidden vectors of the k associated nodes pointed to by the node ) Is the intermediate vector c u(t) and the implicit vector h u(t) .
在一个实施例中,在迭代处理各个节点u(t)以确定其中间向量和隐含向量过程中,还进一步引入该当前处理节点u(t)对应的交互时间与所指向的k个关联节点对应的交互时间之间的时间差Δ。具体的,假定当前处理节点u(t)对应于第一交互时间t1,那么,根据之前对动态交互图的描述,其连接的k个关联节点为,节点u(t)对应的对象上次参与的同时发生的若干交互事件对应的节点,该若干交互事件同时发生的时间记为第二交互时间t2。那么,上述时间差Δ即为该第一交互时间t1和第二交互时间t2之间的时间差。如此,LSTM层可以根据当前处理节点u(t)的节点特征,该节点u(t)所指向的k个关联节点各自的中间向量和隐含向量,以及上述时间差Δ,确定该节点u(t)的隐含向量h u(t)和中间向量c u(t)In one embodiment, in the process of iteratively processing each node u(t) to determine its intermediate vector and implicit vector, the interaction time corresponding to the current processing node u(t) and the k associated nodes pointed to are further introduced The time difference Δ between the corresponding interaction times. Specifically, assuming that the current processing node u(t) corresponds to the first interaction time t1, then, according to the previous description of the dynamic interaction graph, the connected k associated nodes are: the object corresponding to node u(t) participated in the last time For nodes corresponding to several interaction events that occur at the same time, the time when these interaction events occur simultaneously is recorded as the second interaction time t2. Then, the above-mentioned time difference Δ is the time difference between the first interaction time t1 and the second interaction time t2. In this way, the LSTM layer can determine the node u(t) according to the node characteristics of the current processing node u(t), the respective intermediate vectors and hidden vectors of the k associated nodes pointed to by the node u(t), and the above-mentioned time difference Δ. ) Implied vector h u(t) and intermediate vector c u(t) .
更具体的,可以在图9所示的方式基础上,引入时间差Δ的因素,类似的得到节点u(t)的隐含向量和中间向量。具体的,结合时间差的一种处理过程可以包括:将第二节点u(t)的节点特征和上述时间差Δ,与k个关联节点对应的k个隐含向量分别组合,输入第一变换函数g,得到k个第一变换向量;将第二节点的节点特征分别与所述k个关联节点对应的k个隐含向量组合,输入第二变换函数f,得到k个第二变换向量;将所述k个关联节点中第i关联节点的中间向量,与对应的第i个第一变换向量,第i个第二变换向量进行组合操作,得到k个操作结果,将该k个操作结果求和,得到组合向量;将第二节点的节点特征连同所述k个隐含向量,分别输入第三变换函数和第四变换函数,分别得到第三变换向量和第四变换向量;基于所述组合向量和第三变换向量,确定所述第二节点u(t)的中间向量c u(t);基于所述第二节点的中间向量c u(t)和第四变换向量,确定第二节点u(t)的隐含向量h u(t)More specifically, on the basis of the method shown in FIG. 9, the factor of the time difference Δ can be introduced to similarly obtain the hidden vector and the intermediate vector of the node u(t). Specifically, a processing process combining the time difference may include: combining the node characteristics of the second node u(t) and the time difference Δ with the k implicit vectors corresponding to the k associated nodes, respectively, and inputting the first transformation function g , Obtain k first transformation vectors; combine the node characteristics of the second node with the k implicit vectors corresponding to the k associated nodes, and input the second transformation function f to obtain k second transformation vectors; The intermediate vector of the i-th associated node among the k associated nodes is combined with the corresponding i-th first transform vector and the i-th second transform vector to obtain k operation results, and sum the k operation results , Obtain the combination vector; input the node feature of the second node together with the k implicit vectors, respectively, input the third transformation function and the fourth transformation function to obtain the third transformation vector and the fourth transformation vector; based on the combination vector and the third transformation vectors, determining a second point u (t) of the intermediate vector C u (t); the second node based on C intermediate vector u (t) and a fourth transformation vectors, determining a second point u The implicit vector h u(t) of (t) .
图10示出根据另一实施例的LSTM层的结构。对比图10和图9可以看到,图10的结构和实现的算法与图9相似,只是在图9的基础上进一步引入了时间差Δ(u,t)。在图10的例子中,时间差Δ(u,t)和节点u(t)的节点特征
Figure PCTCN2020138398-appb-000028
一起,分别与各个关联节点的隐含向量组合,输入到第一变换函数g中。相应的,第一变换函数g可以修改为:
FIG. 10 shows the structure of an LSTM layer according to another embodiment. Comparing Fig. 10 and Fig. 9, it can be seen that the structure of Fig. 10 and the implemented algorithm are similar to Fig. 9, except that the time difference Δ(u, t) is further introduced on the basis of Fig. 9. In the example in Figure 10, the time difference Δ(u,t) and the node characteristics of the node u(t)
Figure PCTCN2020138398-appb-000028
Together, they are combined with the implicit vector of each associated node and input into the first transformation function g. Correspondingly, the first transformation function g can be modified to:
Figure PCTCN2020138398-appb-000029
Figure PCTCN2020138398-appb-000029
其中,公式(10)在公式(1)基础上进一步引入了对应于时间差Δ(u,t)的时间 项,相应的,
Figure PCTCN2020138398-appb-000030
为针对时间项的参数,可以体现为一个向量。
Among them, formula (10) further introduces the time term corresponding to the time difference Δ(u,t) on the basis of formula (1), correspondingly,
Figure PCTCN2020138398-appb-000030
It is a parameter for the time term, which can be embodied as a vector.
图10中的其他变换函数,以及函数之间的运算过程,可以与结合图9所述的例子相同。The other transformation functions in FIG. 10 and the calculation process between the functions can be the same as the example described in conjunction with FIG. 9.
根据另一种实施方式,结合时间差的处理过程可以包括以下步骤:将第二节点u(t)的节点特征和所述时间差Δ,与k个关联节点对应的k个隐含向量分别组合后,输入算法相同、参数不同的第一变换函数g和第二变换函数f,分别得到k个第一变换向量和k个第二变换向量;将k个关联节点中第i关联节点的中间向量,与对应的第i个第一变换向量,第i个第二变换向量进行组合操作,得到k个操作结果,将该k个操作结果求和,得到组合向量;将第二节点的节点特征连同所述k个隐含向量,分别输入第三变换函数和第四变换函数,分别得到第三变换向量和第四变换向量;基于所述组合向量和第三变换向量,确定所述第二节点u(t)的中间向量c u(t);基于所述第二节点的中间向量c u(t)和第四变换向量,确定第二节点u(t)的隐含向量h u(t)According to another embodiment, the process of combining the time difference may include the following steps: After the node characteristics of the second node u(t) and the time difference Δ are respectively combined with the k implicit vectors corresponding to the k associated nodes, Input the first transformation function g and the second transformation function f with the same algorithm and different parameters to obtain k first transformation vectors and k second transformation vectors respectively; compare the intermediate vector of the i-th associated node among the k associated nodes with The corresponding i-th first transform vector and the i-th second transform vector are combined to obtain k operation results, and the k operation results are summed to obtain the combined vector; the node feature of the second node is combined with the k implicit vectors, input the third transformation function and the fourth transformation function, respectively, to obtain the third transformation vector and the fourth transformation vector; based on the combination vector and the third transformation vector, determine the second node u(t ) C intermediate vector u (t); the second node based on C intermediate vector u (t) and a fourth transformation vectors, determining a second point u (t) implicit vector h u (t).
图11示出根据又一实施例的LSTM层的结构。可以看到,图11的LSTM层同样引入了时间差Δ(u,t),并且,对比于图10,图11中的时间差Δ(u,t)还进一步输入到了第二变换函数f。也就是说,时间差Δ(u,t)和节点u(t)的节点特征
Figure PCTCN2020138398-appb-000031
一起,分别与各个关联节点的隐含向量组合,分别输入到第一变换函数g和第二变换函数f中。
FIG. 11 shows the structure of an LSTM layer according to still another embodiment. It can be seen that the LSTM layer of Fig. 11 also introduces a time difference Δ(u, t), and, compared to Fig. 10, the time difference Δ(u, t) in Fig. 11 is further input to the second transformation function f. In other words, the time difference Δ(u,t) and the node characteristics of the node u(t)
Figure PCTCN2020138398-appb-000031
At the same time, they are combined with the implicit vector of each associated node and input into the first transformation function g and the second transformation function f.
更具体的,图11中的第一变换函数g仍然可以采取公式(10)的形式。进一步的,第二变换函数f可以采取以下形式:More specifically, the first transformation function g in FIG. 11 can still take the form of formula (10). Further, the second transformation function f may take the following form:
Figure PCTCN2020138398-appb-000032
Figure PCTCN2020138398-appb-000032
其中,公式(11)在公式(2)基础上进一步引入了对应于时间差Δ(u,t)的时间项,相应的,
Figure PCTCN2020138398-appb-000033
为针对时间项的参数,可以体现为一个向量。
Among them, formula (11) further introduces the time term corresponding to the time difference Δ(u,t) on the basis of formula (2), correspondingly,
Figure PCTCN2020138398-appb-000033
It is a parameter for the time term, which can be embodied as a vector.
图11中的其他变换函数,以及函数之间的运算过程,可以与结合图9所述的例子相同。The other transformation functions in FIG. 11 and the operation process between the functions can be the same as the example described in conjunction with FIG. 9.
在更多实施例中,还可以将上述时间差进一步输入到第三变换函数p和/或第四变换函数o。在这样的情况下,可以对前述的公式(5),(6),(7)的一部分或全部进行修改,在原有基础上类似的引入针对时间差的时间项,在此不一一详述。In more embodiments, the above-mentioned time difference may be further input to the third transformation function p and/or the fourth transformation function o. In this case, part or all of the aforementioned formulas (5), (6), (7) can be modified, and the time term for the time difference can be similarly introduced on the original basis, which will not be detailed here.
通过以上结合图9-图11所述的LSTM层,依次迭代地处理当前子图中各个节点,可以得到当前节点的中间向量和隐含向量。在一个实施例中,如此得到的隐含向量即可 作为神经网络模型的输出,用于表征当前节点。Through the LSTM layer described above in conjunction with Figures 9-11, each node in the current subgraph is processed iteratively in order to obtain the intermediate vector and the implicit vector of the current node. In one embodiment, the hidden vector thus obtained can be used as the output of the neural network model to characterize the current node.
可以看到,以上基于LSTM的神经网络模型,不同于常规LSTM网络,而是针对多元动态交互图的处理进行了功能和结构的修改和优化,可以将其称为动态图LSTM神经网络模型。It can be seen that the above LSTM-based neural network model is different from the conventional LSTM network, but has been modified and optimized for the processing of multiple dynamic interactive graphs. It can be called the dynamic graph LSTM neural network model.
根据一种实施方式,为了进一步提升效果,动态图LSTM神经网络模型可以包括多个LSTM层,其中,上一LSTM层确定出的某个节点的隐含向量,输入到下一LSTM层作为该节点的节点特征。也就是说,每个LSTM层仍然迭代地处理各个节点,根据当前处理节点i的节点特征、该节点i所指向的k个关联节点各自的中间向量和隐含向量,确定该节点i的隐含向量和中间向量,只是最底层的LSTM层采用节点i的原始特征作为节点特征,后续的LSTM层采用前一LSTM层确定出的该节点i的隐含向量h i作为节点特征。在一个实施例中,上述多个LSTM层采用残差网络的方式堆叠形成神经网络模型。 According to an embodiment, in order to further improve the effect, the dynamic graph LSTM neural network model may include multiple LSTM layers, where the implicit vector of a certain node determined by the previous LSTM layer is input to the next LSTM layer as the node Node characteristics. In other words, each LSTM layer still processes each node iteratively, and determines the implicit vector of the node i according to the node characteristics of the current processing node i, the respective intermediate vectors and implicit vectors of the k associated nodes pointed to by the node i Vector and intermediate vector, but the bottom LSTM layer uses the original feature of node i as the node feature, and the subsequent LSTM layer uses the hidden vector h i of the node i determined by the previous LSTM layer as the node feature. In one embodiment, the above-mentioned multiple LSTM layers are stacked in a residual network manner to form a neural network model.
在神经网络模型具有多个LSTM层的情况下,可以理解,每个LSTM层均可以确定出当前节点的隐含向量。在一个实施例中,神经网络模型将多个LSTM层各自输出的当前节点的隐含向量进行综合,得到当前节点的最终隐含向量。更具体的,可以对各个LSTM层输出的各个隐含向量进行加权组合,从而得到最终隐含向量。加权组合的权重,可以简单地设定为每层对应一个权重因子,其大小通过训练调整。或者,也可以通过更加复杂的注意力(attention)机制确定权重因子。In the case that the neural network model has multiple LSTM layers, it can be understood that each LSTM layer can determine the hidden vector of the current node. In one embodiment, the neural network model synthesizes the hidden vectors of the current node output by each of the multiple LSTM layers to obtain the final hidden vector of the current node. More specifically, each implicit vector output by each LSTM layer can be weighted and combined to obtain the final implicit vector. The weight of the weighted combination can be simply set as each layer corresponds to a weight factor, and its size is adjusted through training. Alternatively, a more complex attention mechanism can also be used to determine the weight factor.
在另一实施例中,神经网络模型还可以将多个LSTM层中最后一个LSTM层输出的当前节点的隐含向量,作为当前节点的最终隐含向量。In another embodiment, the neural network model may also use the hidden vector of the current node output by the last LSTM layer among the multiple LSTM layers as the final hidden vector of the current node.
如此,通过多种方式,基于LSTM的神经网络模型基于与待分析的当前节点对应的当前子图,得到当前节点的隐含向量作为其特征向量。由于当前子图中反映了与当前节点对应的交互对象有关的时序性交互历史的信息,因此,如此得到的当前节点的特征向量,不仅表达出交互对象本身的特征,还可以表达出交互对象在历次交互事件中所受到的影响,从而全面表征交互对象的特点。In this way, in a variety of ways, the LSTM-based neural network model is based on the current subgraph corresponding to the current node to be analyzed, and obtains the hidden vector of the current node as its feature vector. Since the current subgraph reflects the time-series interaction history information related to the interactive object corresponding to the current node, the feature vector of the current node thus obtained not only expresses the characteristics of the interactive object itself, but also expresses the fact that the interactive object is in The impact of previous interaction events, which fully characterizes the characteristics of the interactive objects.
于是,在步骤34,根据当前节点的隐含向量,进行与该当前节点相关的业务处理。Therefore, in step 34, the business processing related to the current node is performed according to the implicit vector of the current node.
在一个实施例中,上述业务处理可以是,根据以上得到的隐含向量,预测当前节点对应的对象的分类类别。In an embodiment, the foregoing business processing may be to predict the classification category of the object corresponding to the current node based on the implicit vector obtained above.
例如,在当前节点对应的对象为用户的情况下,可以基于该隐含向量预测该用户的用户类别,例如所属的人群类别,风险等级类别,等等。在当前节点对应的对象为物品的情况下,可以基于该隐含向量预测该物品的类别,例如所属业务类别,适合的人群类别,被购买的场景类别,等等。For example, in the case where the object corresponding to the current node is a user, the user category of the user can be predicted based on the implicit vector, such as the category of the group to which it belongs, the category of risk level, and so on. In the case where the object corresponding to the current node is an item, the category of the item can be predicted based on the implicit vector, such as the category of the business to which it belongs, the category of suitable people, the category of the scene being purchased, and so on.
在一种实施方案中,业务处理还可以包括,对与当前节点相关的交互事件进行分析和预测。由于交互事件一般涉及两个对象,因此还需要分析另一节点的特征向量。In an embodiment, the business processing may further include analyzing and predicting interaction events related to the current node. Since interaction events generally involve two objects, it is also necessary to analyze the feature vector of another node.
具体地,可以在动态交互图中选取与前述的当前节点不同的另一节点,例如图4和图5中的v(t 6)。采用与图3中的步骤32和33类似的方式,确定出该另一节点对应的隐含向量。在一个实施例中,可以基于当前节点和该另一节点分别对应的隐含向量,预测这两个节点代表的对象是否会发生交互。在另一个实施例中,前述当前节点和另一节点是已经发生的第一交互事件对应的两个节点。那么可以根据这两个节点分别对应的隐含向量,预测该第一交互事件的事件类别。 Specifically, another node different from the aforementioned current node may be selected in the dynamic interaction graph, for example, v(t 6 ) in FIG. 4 and FIG. 5. In a manner similar to steps 32 and 33 in FIG. 3, the hidden vector corresponding to the other node is determined. In one embodiment, it is possible to predict whether the objects represented by the two nodes will interact based on the implicit vectors respectively corresponding to the current node and the other node. In another embodiment, the aforementioned current node and another node are two nodes corresponding to the first interaction event that has occurred. Then, the event category of the first interaction event can be predicted according to the implicit vectors corresponding to the two nodes respectively.
例如,在一个例子中,当前节点代表的用户已经确认购买上述另一节点代表的商品,由此产生第一交互事件。在用户请求支付时,可以根据两个节点的隐含向量,预测该第一交互事件是否为涉嫌账号盗用的欺诈性交易,从而确定是否允许本次支付。在又一例子中,当前节点代表的用户已经针对另一节点代表的物品(例如电影)进行评论操作,例如点赞或发布文字评论,由此产生第一交互事件。在这之后,可以根据两个节点的隐含向量,预测该第一交互事件是否为真实操作。For example, in an example, the user represented by the current node has confirmed to purchase the commodity represented by the other node, and the first interaction event is thus generated. When the user requests payment, the implicit vector of the two nodes can be used to predict whether the first interaction event is a fraudulent transaction involving account embezzlement, so as to determine whether the payment is allowed. In another example, the user represented by the current node has already performed a comment operation on an item (such as a movie) represented by another node, such as liking or posting a text comment, thereby generating the first interaction event. After that, it can be predicted whether the first interaction event is a real operation based on the implicit vectors of the two nodes.
可以理解,上述业务处理的依据为LSTM神经网络模型基于动态交互图确定的节点的隐含向量。如前所述,LSTM神经网络模型确定节点的隐含向量的计算过程,依赖于大量的参数,例如前述各个变换函数中的参数。这些参数需要通过对该神经网络模型进行训练而确定。在不同实施例中,可以通过不同的任务,训练该神经网络模型。It can be understood that the basis of the above-mentioned service processing is the implicit vector of the node determined by the LSTM neural network model based on the dynamic interaction graph. As mentioned above, the calculation process of the LSTM neural network model to determine the hidden vector of the node depends on a large number of parameters, such as the parameters in the aforementioned transformation functions. These parameters need to be determined by training the neural network model. In different embodiments, the neural network model can be trained through different tasks.
在一个实施例中,通过预测交互行为来训练神经网络模型。图12示出在该实施例中训练神经网络模型的流程图。如图12所示,在步骤121,获取历史交互事件,该历史交互事件是确已发生的交互事件。在一个具体例子中,可以从前述交互事件集中获取历史交互事件。将该历史交互事件中包括的两个对象称为第一样本对象和第二样本对象。In one embodiment, the neural network model is trained by predicting the interaction behavior. Fig. 12 shows a flowchart of training a neural network model in this embodiment. As shown in FIG. 12, in step 121, a historical interaction event is acquired, and the historical interaction event is an interaction event that has indeed occurred. In a specific example, historical interaction events can be obtained from the aforementioned collection of interaction events. The two objects included in the historical interaction event are called the first sample object and the second sample object.
在步骤122,在动态交互图中,分别确定与第一样本对象对应的第一子图,和与第二样本对象对应的第二子图。具体的,在动态交互图中分别确定出与第一样本对象对应的第一样本节点和与第二样本对象对应的第二样本节点,分别以第一样本节点和第二 样本节点作为当前节点,按照图3的步骤32类似的方式,确定出对应的第一子图和第二子图。In step 122, in the dynamic interaction graph, a first subgraph corresponding to the first sample object and a second subgraph corresponding to the second sample object are respectively determined. Specifically, the first sample node corresponding to the first sample object and the second sample node corresponding to the second sample object are respectively determined in the dynamic interaction graph, and the first sample node and the second sample node are respectively taken as The current node determines the corresponding first sub-graph and second sub-graph in a similar manner to step 32 in FIG. 3.
然后,在步骤123,将上述第一子图和第二子图分别输入神经网络模型,分别得到第一样本对象的隐含向量和第二样本对象的隐含向量。神经网络模型基于子图中节点的指向关系确定出对应样本对象的隐含向量的具体过程如前结合步骤33所述,不再赘述。Then, in step 123, the above-mentioned first subgraph and the second subgraph are respectively input into the neural network model, and the hidden vector of the first sample object and the hidden vector of the second sample object are obtained respectively. The specific process of the neural network model to determine the hidden vector corresponding to the sample object based on the pointing relationship of the nodes in the subgraph is as described above in conjunction with step 33, and will not be repeated.
接着,在步骤124,根据第一样本对象的隐含向量和第二样本对象的隐含向量,预测第一样本对象和第二样本对象是否会发生交互,得到预测结果。通常,可以采用一个二分类的分类器,预测两个样本对象是否会发生交互,得到的预测结果通常表现为,这两个样本对象发生交互的概率。Next, in step 124, according to the implicit vector of the first sample object and the implicit vector of the second sample object, predict whether the first sample object and the second sample object will interact, and obtain the prediction result. Generally, a two-class classifier can be used to predict whether two sample objects will interact, and the obtained prediction result is usually expressed as the probability of the two sample objects interacting.
于是,在步骤125,根据上述预测结果,确定预测损失。可以理解,上述第一样本对象和第二样本对象来自历史交互事件,因此实际上已经发生交互,这相当于已知这两个样本对象之间的关系标签。根据例如交叉熵计算方式等损失函数形式,可以基于上述预测结果确定出本次预测的损失。Therefore, in step 125, the prediction loss is determined based on the above prediction result. It can be understood that the above-mentioned first sample object and second sample object come from historical interaction events, so the interaction has actually occurred, which is equivalent to knowing the relationship label between the two sample objects. According to the loss function form such as the cross entropy calculation method, the loss of this prediction can be determined based on the above prediction result.
然后,在步骤126,根据预测损失,更新神经网络模型。具体的,可以采用梯度下降、反向传播等方式,调整神经网络中的参数,以更新神经网络模型,直到神经网络模型的预测准确率达到一定要求。Then, in step 126, the neural network model is updated based on the predicted loss. Specifically, methods such as gradient descent and back propagation can be used to adjust the parameters in the neural network to update the neural network model until the prediction accuracy of the neural network model reaches a certain requirement.
以上采用历史交互事件中的两个样本对象来进行对象关系的预测,相当于利用了正样本进行训练。在一个实施例中,还可以在动态交互图中找到未发生交互关系的两个样本对象作为负样本进行进一步训练,从而达到更好的训练效果。The foregoing uses two sample objects in historical interaction events to predict the relationship between objects, which is equivalent to using positive samples for training. In an embodiment, two sample objects that have not interacted with each other can also be found in the dynamic interaction graph as negative samples for further training, so as to achieve a better training effect.
根据另一实施方式,通过预测交互对象的分类来训练神经网络模型。图13示出该实施例中训练神经网络模型的流程图。如图13所示,在步骤131,从交互事件集涉及的各个对象中选择样本对象,并获取该样本对象的分类标签。该样本对象可以是交互事件集包含的任意事件中的任意交互对象,针对该样本对象的分类标签可以是与业务场景相关的标签。例如,在样本对象是用户的情况下,分类标签可以是预先设定的人群分类的标签,或用户风险程度分类的标签;在样本对象是商品的情况下,分类标签可以是商品分类的标签。这样的标签可以由人工标注产生,或通过其他业务相关处理而产生。According to another embodiment, the neural network model is trained by predicting the classification of interactive objects. FIG. 13 shows a flowchart of training the neural network model in this embodiment. As shown in FIG. 13, in step 131, a sample object is selected from each object involved in the interaction event set, and the classification label of the sample object is obtained. The sample object may be any interaction object in any event included in the interaction event set, and the classification label for the sample object may be a label related to a business scenario. For example, in the case where the sample object is a user, the classification label may be a pre-set group classification label or a user risk level classification label; in the case where the sample object is a commodity, the classification label may be a commodity classification label. Such labels can be generated by manual labeling, or generated through other business-related processing.
在步骤132,在动态交互图中,确定与该样本对象对应的样本子图。具体的,可以在动态交互图中确定出与该样本对象对应的节点,以该节点作为当前节点,按照图3 的步骤32类似的方式,确定出对应的样本子图。In step 132, in the dynamic interaction graph, a sample subgraph corresponding to the sample object is determined. Specifically, the node corresponding to the sample object can be determined in the dynamic interaction graph, and the node is used as the current node to determine the corresponding sample subgraph in a similar manner to step 32 in FIG. 3.
然后,在步骤133,将上述样本子图输入神经网络模型,得到样本对象的隐含向量。该过程如前结合步骤33所述,不再赘述。Then, in step 133, the above-mentioned sample subgraph is input into the neural network model to obtain the hidden vector of the sample object. This process is the same as that described in step 33, and will not be repeated here.
接着,在步骤134,根据样本对象的隐含向量,预测该样本对象的分类,得到预测结果。可以采用分类器,预测样本对象属于各个分类的各个概率,作为预测结果。Next, in step 134, the classification of the sample object is predicted according to the hidden vector of the sample object, and the prediction result is obtained. A classifier can be used to predict each probability that the sample object belongs to each category as the prediction result.
然后,在步骤135,根据预测结果和分类标签,确定预测损失。具体的,可以采用例如交叉熵计算方式,可以预测结果中的各个概率和分类标签,确定出本次预测的损失。Then, in step 135, the prediction loss is determined based on the prediction result and the classification label. Specifically, for example, a cross-entropy calculation method can be used to predict each probability and classification label in the result, and determine the loss of this prediction.
在步骤136,根据预测损失,更新神经网络模型。如此,通过预测样本对象分类的任务,训练神经网络模型。In step 136, the neural network model is updated based on the predicted loss. In this way, the neural network model is trained by predicting the task of classifying sample objects.
综合以上,在本说明书实施例的方案中,基于交互事件集构建动态交互图,该动态交互图可以反映各个交互事件的时序关系,以及交互对象之间通过各个交互事件传递的相互影响。考虑交互事件同时发生的可能性,该动态交互图允许节点连接到不限数目的关联节点,由此形成混合多元的交互图。利用训练的LSTM神经网络模型,基于该动态交互图中与待分析交互对象相关的子图,可以提取得到该交互对象的隐含向量。如此得到的隐含向量中引入了各个交互事件中其他交互对象对其的影响,从而可以综合全面地表达该交互对象的深层特征用于进行业务处理。In summary, in the solution of the embodiment of the present specification, a dynamic interaction diagram is constructed based on a set of interaction events, and the dynamic interaction diagram can reflect the timing relationship of each interaction event and the mutual influence between interactive objects transmitted through each interaction event. Considering the possibility of interaction events occurring at the same time, the dynamic interaction graph allows nodes to be connected to an unlimited number of associated nodes, thereby forming a mixed and diverse interaction graph. Using the trained LSTM neural network model, based on the subgraphs related to the interactive object to be analyzed in the dynamic interaction graph, the hidden vector of the interactive object can be extracted. The implicit vector thus obtained introduces the influence of other interactive objects in each interactive event on it, so that the in-depth characteristics of the interactive object can be comprehensively expressed for business processing.
根据另一方面的实施例,提供了一种处理交互数据的装置,该装置可以部署在任何具有计算、处理能力的设备、平台或设备集群中。图14示出根据一个实施例的处理交互数据的装置的示意性框图。如图14所示,该处理装置140包括以下单元。According to another embodiment, an apparatus for processing interactive data is provided. The apparatus can be deployed in any device, platform, or device cluster with computing and processing capabilities. Fig. 14 shows a schematic block diagram of an apparatus for processing interactive data according to an embodiment. As shown in FIG. 14, the processing device 140 includes the following units.
交互图获取单元141,配置为获取根据交互事件集构建的动态交互图,其中,所述交互事件集包括多个交互事件,每个交互事件至少包括,发生交互行为的两个对象和交互时间;所述动态交互图包括任意的第一节点,所述第一节点对应于发生在第一时间的交互事件中的第一对象,所述第一节点通过连接边指向N个关联事件所对应的M个关联节点,所述N个关联事件均发生于第二时间,且均包含所述第一对象作为交互对象之一,所述第二时间为,从所述第一时间向前回溯,所述第一对象发生交互行为的前一时间;所述动态交互图中包括至少一个关联节点数目大于2的多元节点。The interaction graph obtaining unit 141 is configured to obtain a dynamic interaction graph constructed according to an interaction event set, where the interaction event set includes a plurality of interaction events, and each interaction event includes at least two objects on which an interaction behavior occurs and an interaction time; The dynamic interaction graph includes any first node, the first node corresponds to the first object in the interaction event that occurs at the first time, and the first node points to the M corresponding to the N associated events through the connecting edge. Associated nodes, the N associated events all occur at a second time, and all include the first object as one of the interactive objects, and the second time is backtracking from the first time, the The time before the interaction behavior of the first object occurs; the dynamic interaction graph includes at least one multi-element node whose number of associated nodes is greater than 2.
子图确定单元142,配置为在所述动态交互图中,确定与待分析的当前节点对应的当前子图,所述当前子图包括从当前节点出发,经由连接边到达的预定范围内的节点;The subgraph determining unit 142 is configured to determine, in the dynamic interaction graph, a current subgraph corresponding to the current node to be analyzed, and the current subgraph includes nodes within a predetermined range that start from the current node and reach via the connecting edge. ;
子图处理单元143,配置为将所述当前子图输入神经网络模型,所述神经网络模型包括LSTM层,所述LSTM层根据所述当前子图中各个节点之间的连接边的指向关系,依次迭代处理各个节点,从而得到所述当前节点的隐含向量;其中所述各个节点包括第二节点,所述依次迭代处理各个节点包括,至少根据所述第二节点的节点特征,该第二节点所指向的k个关联节点各自的中间向量和隐含向量,确定所述第二节点的隐含向量和中间向量。The subgraph processing unit 143 is configured to input the current subgraph into a neural network model, the neural network model including an LSTM layer, and the LSTM layer is based on the direction relationship of the connecting edges between the nodes in the current subgraph, Iteratively process each node in turn to obtain the implicit vector of the current node; wherein each node includes a second node, and the iterative processing of each node in turn includes, at least according to the node characteristics of the second node, the second node The respective intermediate vectors and implicit vectors of the k associated nodes pointed to by the node determine the implicit vector and the intermediate vector of the second node.
业务处理单元144,配置为根据所述当前节点的隐含向量,进行与所述当前节点相关的业务处理。The service processing unit 144 is configured to perform service processing related to the current node according to the implicit vector of the current node.
在一个实施例中,所述对象包括用户,所述交互事件包括以下中的至少一种:点击事件,社交事件,交易事件。In one embodiment, the object includes a user, and the interaction event includes at least one of the following: a click event, a social event, and a transaction event.
在不同实施方式中,上述M个关联节可以点为2N个节点,分别对应于所述N个关联事件中各个关联事件所包括的两个对象;或者,可以为N+1个节点,分别对应于所述N个关联事件中与所述第一对象交互的N个其他对象,以及所述第一对象自身。In different implementations, the above-mentioned M associated nodes may be 2N nodes, respectively corresponding to the two objects included in each associated event in the N associated events; or, there may be N+1 nodes, respectively corresponding to N other objects interacting with the first object in the N associated events, and the first object itself.
在不同实施例中,所述预定范围内的节点可以包括:预设阶数K的连接边之内的节点;和/或,交互时间在预设时间范围内的节点。In different embodiments, the nodes within the predetermined range may include: nodes within a connecting edge of a preset order K; and/or nodes whose interaction time is within a preset time range.
根据一种实施方式,前述当前节点是这样的节点:在所述动态交互图中,不存在指向该节点的连接边。According to an embodiment, the aforementioned current node is a node: in the dynamic interaction graph, there is no connecting edge pointing to the node.
在一个实施例中,每个交互事件还包括,交互行为的行为特征;在这样的情况下,第二节点的节点特征可以包括,所述第二节点所对应的对象的属性特征,以及所述第二节点在所对应的交互时间中参与的交互事件的行为特征。In an embodiment, each interaction event further includes the behavior characteristics of the interaction behavior; in this case, the node characteristics of the second node may include the attribute characteristics of the object corresponding to the second node, and the The behavior characteristics of the interaction event that the second node participates in the corresponding interaction time.
在一个实施例中,子图处理单元143所利用的神经网络模型中的LSTM层具体用于:将所述第二节点的节点特征,分别与所述k个关联节点对应的k个隐含向量组合,输入算法相同、参数不同的第一变换函数和第二变换函数,分别得到k个第一变换向量和k个第二变换向量;将所述k个关联节点中第i关联节点的中间向量,与对应的第i个第一变换向量,第i个第二变换向量进行组合操作,得到k个操作结果,将该k个操作结果求和,得到组合向量;将所述第二节点的节点特征连同所述k个隐含向量,分别输入第三变换函数和第四变换函数,分别得到第三变换向量和第四变换向量;基于所述组合向量和第三变换向量,确定所述第二节点的中间向量;基于所述第二节点的中间向量和第四变换向量,确定所述第二节点的隐含向量。In one embodiment, the LSTM layer in the neural network model used by the subgraph processing unit 143 is specifically used to: use the node characteristics of the second node to k implicit vectors corresponding to the k associated nodes. Combine, input the first transformation function and the second transformation function with the same algorithm and different parameters to obtain k first transformation vectors and k second transformation vectors respectively; the intermediate vector of the i-th associated node among the k associated nodes , Perform a combination operation with the corresponding i-th first transform vector and the i-th second transform vector to obtain k operation results, and sum the k operation results to obtain the combined vector; and the node of the second node The features together with the k hidden vectors are input into the third transformation function and the fourth transformation function respectively to obtain the third transformation vector and the fourth transformation vector; based on the combination vector and the third transformation vector, the second transformation vector is determined The intermediate vector of the node; based on the intermediate vector of the second node and the fourth transform vector, the implicit vector of the second node is determined.
根据一种实施方式,子图处理单元143所利用的神经网络模型中的LSTM层用于:根据所述第二节点的节点特征,该第二节点所指向的k个关联节点各自的中间向量和隐含向量,以及该第二节点对应的交互时间与所述k个关联节点对应的交互时间之间的时间差,确定所述第二节点的隐含向量和中间向量。According to an embodiment, the LSTM layer in the neural network model used by the subgraph processing unit 143 is used to: according to the node characteristics of the second node, the respective intermediate vectors of the k associated nodes pointed to by the second node and The implicit vector and the time difference between the interaction time corresponding to the second node and the interaction time corresponding to the k associated nodes determine the implicit vector and the intermediate vector of the second node.
更具体地,在一个实施例中,上述LSTM层具体用于:将所述第二节点的节点特征和所述时间差,与所述k个关联节点对应的k个隐含向量分别组合,输入第一变换函数,得到k个第一变换向量;将所述第二节点的节点特征与所述k个关联节点对应的k个隐含向量分别组合,输入第二变换函数,得到k个第二变换向量;将所述k个关联节点中第i关联节点的中间向量,与对应的第i第一变换向量,第i第二变换向量进行组合操作,得到k个操作结果,将该k个操作结果求和,得到组合向量;将所述第二节点的节点特征连同所述k个隐含向量,分别输入第三变换函数和第四变换函数,分别得到第三变换向量和第四变换向量;基于所述组合向量和第三变换向量,确定所述第二节点的中间向量;基于所述第二节点的中间向量和第四变换向量,确定所述第二节点的隐含向量。More specifically, in an embodiment, the above-mentioned LSTM layer is specifically configured to: combine the node characteristics of the second node and the time difference with the k implicit vectors corresponding to the k associated nodes, respectively, and input the first A transformation function to obtain k first transformation vectors; respectively combine the node characteristics of the second node with the k implicit vectors corresponding to the k associated nodes, and input the second transformation function to obtain k second transformations Vector; Combine the intermediate vector of the i-th associated node among the k associated nodes with the corresponding i-th first transform vector and the i-th second transform vector to obtain k operation results, and the k operation results Sum to obtain a combined vector; input the node feature of the second node together with the k hidden vectors into the third transform function and the fourth transform function, respectively, to obtain the third transform vector and the fourth transform vector; based on The combined vector and the third transformation vector determine the intermediate vector of the second node; and the implicit vector of the second node is determined based on the intermediate vector and the fourth transformation vector of the second node.
在另一实施例中,上述LSTM层具体用于:将所述第二节点的节点特征和所述时间差,与所述k个关联节点对应的k个隐含向量分别组合后,输入算法相同、参数不同的第一变换函数和第二变换函数,分别得到k个第一变换向量和k个第二变换向量;将所述k个关联节点中第i关联节点的中间向量,与对应的第i第一变换向量,第i第二变换向量进行组合操作,得到k个操作结果,将该k个操作结果求和,得到组合向量;将所述第二节点的节点特征连同所述k个隐含向量,分别输入第三变换函数和第四变换函数,分别得到第三变换向量和第四变换向量;基于所述组合向量和第三变换向量,确定所述第二节点的中间向量;基于所述第二节点的中间向量和第四变换向量,确定所述第二节点的隐含向量。In another embodiment, the above-mentioned LSTM layer is specifically used to: after the node characteristics of the second node and the time difference are combined with the k implicit vectors corresponding to the k associated nodes, the input algorithm is the same, The first transformation function and the second transformation function with different parameters respectively obtain k first transformation vectors and k second transformation vectors; compare the intermediate vector of the i-th associated node among the k associated nodes with the corresponding i-th The first transform vector and the i-th second transform vector are combined to obtain k operation results, and the k operation results are summed to obtain a combined vector; the node feature of the second node is combined with the k implicit Vector, input the third transformation function and the fourth transformation function respectively to obtain the third transformation vector and the fourth transformation vector; based on the combination vector and the third transformation vector, determine the intermediate vector of the second node; based on the The intermediate vector and the fourth transform vector of the second node determine the implicit vector of the second node.
根据一种实施方式,神经网络模型包括多个LSTM层,其中,上一LSTM层确定出的所述第二节点的隐含向量,输入到下一LSTM层作为该第二节点的节点特征。According to an embodiment, the neural network model includes multiple LSTM layers, wherein the implicit vector of the second node determined by the previous LSTM layer is input to the next LSTM layer as the node feature of the second node.
在这样的情况下,在一个实施例中,神经网络模型将所述多个LSTM层各自输出的当前节点的隐含向量进行综合,得到所述当前节点的最终隐含向量。In this case, in one embodiment, the neural network model synthesizes the hidden vectors of the current node output by each of the multiple LSTM layers to obtain the final hidden vector of the current node.
在另一实施例中,神经网络模型将所述多个LSTM层中最后一个LSTM层输出的当前节点的隐含向量,作为所述当前节点的最终隐含向量。In another embodiment, the neural network model uses the hidden vector of the current node output by the last LSTM layer in the plurality of LSTM layers as the final hidden vector of the current node.
根据一种实施方式,神经网络模型通过模型训练单元145训练。模型训练单元145可以包含在装置140之中,也可以位于其之外。模型训练单元145可以包括(未示出):样本获取模块,配置为获取历史交互事件,其中包括第一样本对象和第二样本对象;子图确定模块,配置为在所述动态交互图中,分别确定与所述第一样本对象对应的第一子图,和与所述第二样本对象对应的第二子图;向量获取模块,配置为将所述第一子图和所述第二子图分别输入所述神经网络模型,分别得到所述第一样本对象的隐含向量和第二样本对象的隐含向量;预测模块,配置为根据所述第一样本对象的隐含向量和第二样本对象的隐含向量,预测所述第一样本对象和第二样本对象是否会发生交互,得到预测结果;损失确定模块,配置为根据所述预测结果,确定预测损失;更新模块,配置为根据所述预测损失,更新所述神经网络模型。According to an embodiment, the neural network model is trained by the model training unit 145. The model training unit 145 may be included in the device 140 or located outside it. The model training unit 145 may include (not shown): a sample acquisition module configured to acquire historical interaction events, which includes a first sample object and a second sample object; and a sub-picture determining module, configured to be in the dynamic interaction diagram , Respectively determine a first sub-picture corresponding to the first sample object and a second sub-picture corresponding to the second sample object; the vector acquisition module is configured to combine the first sub-picture and the first sub-picture The two sub-images are input into the neural network model respectively to obtain the implicit vector of the first sample object and the implicit vector of the second sample object; the prediction module is configured to be based on the implicit vector of the first sample object The vector and the implicit vector of the second sample object predict whether the first sample object and the second sample object will interact to obtain the prediction result; the loss determination module is configured to determine the prediction loss according to the prediction result; update Module, configured to update the neural network model according to the predicted loss.
在另一实施例中,模型训练单元145可以包括(未示出):样本获取模块,配置为从所述交互事件集涉及的多个样本对象中选择样本对象,并获取该样本对象的分类标签;子图确定模块,配置为在所述动态交互图中,确定与该样本对象对应的样本子图;向量获取模块,配置为将所述样本子图输入所述神经网络模型,得到所述样本对象的隐含向量;预测模块,配置为根据所述样本对象的隐含向量,预测所述样本对象的分类,得到预测结果;损失确定模块,配置为根据所述预测结果和所述分类标签,确定预测损失;更新模块,配置为根据所述预测损失,更新所述神经网络模型。In another embodiment, the model training unit 145 may include (not shown): a sample acquisition module configured to select a sample object from a plurality of sample objects involved in the set of interaction events, and obtain a classification label of the sample object A subgraph determining module, configured to determine a sample subgraph corresponding to the sample object in the dynamic interaction graph; a vector acquisition module, configured to input the sample subgraph into the neural network model to obtain the sample A hidden vector of the object; a prediction module configured to predict the classification of the sample object according to the hidden vector of the sample object to obtain a prediction result; a loss determination module configured to according to the prediction result and the classification label, Determine the prediction loss; an update module configured to update the neural network model according to the prediction loss.
通过以上装置,基于动态交互图,采用神经网络模型处理交互对象,得到适于后续分析的特征向量。Through the above device, based on the dynamic interactive graph, the neural network model is used to process the interactive objects, and feature vectors suitable for subsequent analysis are obtained.
根据另一方面的实施例,还提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行结合图3所描述的方法。According to another embodiment, there is also provided a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed in a computer, the computer is caused to execute the method described in conjunction with FIG. 3.
根据再一方面的实施例,还提供一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现结合图3所述的方法。According to an embodiment of still another aspect, there is also provided a computing device, including a memory and a processor, the memory is stored with executable code, and when the processor executes the executable code, it implements the method described in conjunction with FIG. 3 method.
本领域技术人员应该可以意识到,在上述一个或多个示例中,本发明所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。Those skilled in the art should be aware that, in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, firmware, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on the computer-readable medium.
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一 步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本发明的保护范围之内。The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention. The protection scope, any modification, equivalent replacement, improvement, etc. made on the basis of the technical solution of the present invention shall be included in the protection scope of the present invention.

Claims (30)

  1. 一种处理交互数据的方法,所述方法包括:A method for processing interactive data, the method comprising:
    获取根据交互事件集构建的动态交互图,其中,所述交互事件集包括多个交互事件,每个交互事件至少包括,发生交互行为的两个对象和交互时间;所述动态交互图包括任意的第一节点,所述第一节点对应于发生在第一时间的交互事件中的第一对象,所述第一节点通过连接边指向N个关联事件所对应的M个关联节点,所述N个关联事件均发生于第二时间,且均包含所述第一对象作为交互对象之一,所述第二时间为,从所述第一时间向前回溯,所述第一对象发生交互行为的前一时间;所述动态交互图中包括至少一个关联节点数目大于2的多元节点;Acquire a dynamic interaction diagram constructed according to an interaction event set, wherein the interaction event set includes a plurality of interaction events, each interaction event includes at least two objects where the interaction behavior occurs and the interaction time; the dynamic interaction diagram includes any The first node, the first node corresponds to the first object in the interaction event occurring at the first time, the first node points to the M associated nodes corresponding to the N associated events through the connecting edge, and the N The associated events all occur at the second time, and they all include the first object as one of the interactive objects. The second time is, going back from the first time, before the first object interacts. At a time; the dynamic interaction graph includes at least one multi-node with more than 2 associated nodes;
    在所述动态交互图中,确定与待分析的当前节点对应的当前子图,所述当前子图包括从当前节点出发,经由连接边到达的预定范围内的节点;In the dynamic interaction graph, determine a current subgraph corresponding to the current node to be analyzed, and the current subgraph includes nodes within a predetermined range that start from the current node and reach via a connecting edge;
    将所述当前子图输入神经网络模型,所述神经网络模型包括LSTM层,所述LSTM层根据所述当前子图中各个节点之间的连接边的指向关系,依次迭代处理各个节点,从而得到所述当前节点的隐含向量;其中所述各个节点包括第二节点,所述依次迭代处理各个节点包括,至少根据所述第二节点的节点特征,该第二节点所指向的k个关联节点各自的中间向量和隐含向量,确定所述第二节点的隐含向量和中间向量;The current subgraph is input into a neural network model, and the neural network model includes an LSTM layer, and the LSTM layer processes each node in turn iteratively according to the direction relationship of the connecting edge between each node in the current subgraph, so as to obtain The implicit vector of the current node; wherein each node includes a second node, and the sequential iterative processing of each node includes, at least according to the node characteristics of the second node, the k associated nodes pointed to by the second node Respective intermediate vectors and hidden vectors, determining the hidden vector and intermediate vector of the second node;
    根据所述当前节点的隐含向量,进行与所述当前节点相关的业务处理。Perform business processing related to the current node according to the implicit vector of the current node.
  2. 根据权利要求1所述的方法,其中,所述对象包括用户,所述交互事件包括以下中的至少一种:点击事件,社交事件,交易事件。The method according to claim 1, wherein the object includes a user, and the interaction event includes at least one of the following: a click event, a social event, and a transaction event.
  3. 根据权利要求1所述的方法,其中,The method of claim 1, wherein:
    所述M个关联节点为2N个节点,分别对应于所述N个关联事件中各个关联事件所包括的两个对象;或者,The M associated nodes are 2N nodes, respectively corresponding to two objects included in each associated event in the N associated events; or,
    所述M个关联节点为N+1个节点,分别对应于所述N个关联事件中与所述第一对象交互的N个其他对象,以及所述第一对象自身。The M associated nodes are N+1 nodes, respectively corresponding to N other objects interacting with the first object in the N associated events, and the first object itself.
  4. 根据权利要求1所述的方法,其中,所述预定范围内的节点包括:The method according to claim 1, wherein the nodes within the predetermined range include:
    预设阶数K的连接边之内的节点;和/或Nodes within the connecting edges of the preset order K; and/or
    交互时间在预设时间范围内的节点。Nodes whose interaction time is within the preset time range.
  5. 根据权利要求1所述的方法,其中,所述每个交互事件还包括,交互行为的行为特征;The method according to claim 1, wherein each interaction event further includes behavior characteristics of the interaction behavior;
    所述第二节点的节点特征包括,所述第二节点所对应的对象的属性特征,以及所述第二节点在所对应的交互时间中参与的交互事件的行为特征。The node characteristics of the second node include the attribute characteristics of the object corresponding to the second node, and the behavior characteristics of the interaction events that the second node participates in during the corresponding interaction time.
  6. 根据权利要求1所述的方法,其中,所述确定所述第二节点的隐含向量和中间向量包括:The method according to claim 1, wherein the determining the implicit vector and the intermediate vector of the second node comprises:
    将所述第二节点的节点特征,分别与所述k个关联节点对应的k个隐含向量组合,输入算法相同、参数不同的第一变换函数和第二变换函数,分别得到k个第一变换向量和k个第二变换向量;Combine the node characteristics of the second node with the k implicit vectors corresponding to the k associated nodes, and input the first transformation function and the second transformation function with the same algorithm and different parameters to obtain k first transformation functions. Transformation vector and k second transformation vectors;
    将所述k个关联节点中第i关联节点的中间向量,与对应的第i个第一变换向量,第i个第二变换向量进行组合操作,得到k个操作结果,将该k个操作结果求和,得到组合向量;Combine the intermediate vector of the i-th associated node among the k associated nodes with the corresponding i-th first transform vector and the i-th second transform vector to obtain k operation results, and the k operation results Sum to get the combined vector;
    将所述第二节点的节点特征连同所述k个隐含向量,分别输入第三变换函数和第四变换函数,分别得到第三变换向量和第四变换向量;Inputting the node feature of the second node together with the k implicit vectors into a third transformation function and a fourth transformation function, respectively, to obtain a third transformation vector and a fourth transformation vector;
    基于所述组合向量和第三变换向量,确定所述第二节点的中间向量;Determining the intermediate vector of the second node based on the combination vector and the third transformation vector;
    基于所述第二节点的中间向量和第四变换向量,确定所述第二节点的隐含向量。Based on the intermediate vector and the fourth transform vector of the second node, the implicit vector of the second node is determined.
  7. 根据权利要求1所述的方法,其中,所述依次迭代处理各个节点包括,根据所述第二节点的节点特征,该第二节点所指向的k个关联节点各自的中间向量和隐含向量,以及该第二节点对应的交互时间与所述k个关联节点对应的交互时间之间的时间差,确定所述第二节点的隐含向量和中间向量。The method according to claim 1, wherein the sequentially iteratively processing each node comprises, according to the node characteristics of the second node, the respective intermediate vectors and implicit vectors of the k associated nodes pointed to by the second node, And the time difference between the interaction time corresponding to the second node and the interaction time corresponding to the k associated nodes to determine the implicit vector and the intermediate vector of the second node.
  8. 根据权利要求7所述的方法,其中,所述确定所述第二节点的隐含向量和中间向量包括:The method according to claim 7, wherein said determining the implicit vector and the intermediate vector of the second node comprises:
    将所述第二节点的节点特征和所述时间差,与所述k个关联节点对应的k个隐含向量分别组合,输入第一变换函数,得到k个第一变换向量;Combining the node characteristics of the second node and the time difference with the k implicit vectors corresponding to the k associated nodes, respectively, and inputting a first transformation function to obtain k first transformation vectors;
    将所述第二节点的节点特征与所述k个关联节点对应的k个隐含向量分别组合,输入第二变换函数,得到k个第二变换向量;Combine the node features of the second node and the k implicit vectors corresponding to the k associated nodes respectively, and input a second transformation function to obtain k second transformation vectors;
    将所述k个关联节点中第i关联节点的中间向量,与对应的第i第一变换向量,第i第二变换向量进行组合操作,得到k个操作结果,将该k个操作结果求和,得到组合向量;Combine the intermediate vector of the i-th associated node among the k associated nodes with the corresponding i-th first transform vector and the i-th second transform vector to obtain k operation results, and sum the k operation results , Get the combined vector;
    将所述第二节点的节点特征连同所述k个隐含向量,分别输入第三变换函数和第四变换函数,分别得到第三变换向量和第四变换向量;Inputting the node feature of the second node together with the k implicit vectors into a third transformation function and a fourth transformation function, respectively, to obtain a third transformation vector and a fourth transformation vector;
    基于所述组合向量和第三变换向量,确定所述第二节点的中间向量;Determining the intermediate vector of the second node based on the combination vector and the third transformation vector;
    基于所述第二节点的中间向量和第四变换向量,确定所述第二节点的隐含向量。Based on the intermediate vector and the fourth transform vector of the second node, the implicit vector of the second node is determined.
  9. 根据权利要求7所述的方法,其中,所述确定所述第二节点的隐含向量和中间向量包括:The method according to claim 7, wherein said determining the implicit vector and the intermediate vector of the second node comprises:
    将所述第二节点的节点特征和所述时间差,与所述k个关联节点对应的k个隐含向量分别组合后,输入算法相同、参数不同的第一变换函数和第二变换函数,分别得到k个第一变换向量和k个第二变换向量;After combining the node characteristics of the second node and the time difference with the k implicit vectors corresponding to the k associated nodes, respectively, the first transformation function and the second transformation function with the same algorithm and different parameters are input, respectively Obtain k first transform vectors and k second transform vectors;
    将所述k个关联节点中第i关联节点的中间向量,与对应的第i第一变换向量,第i第二变换向量进行组合操作,得到k个操作结果,将该k个操作结果求和,得到组合向量;Combine the intermediate vector of the i-th associated node among the k associated nodes with the corresponding i-th first transform vector and the i-th second transform vector to obtain k operation results, and sum the k operation results , Get the combined vector;
    将所述第二节点的节点特征连同所述k个隐含向量,分别输入第三变换函数和第四变换函数,分别得到第三变换向量和第四变换向量;Inputting the node feature of the second node together with the k implicit vectors into a third transformation function and a fourth transformation function, respectively, to obtain a third transformation vector and a fourth transformation vector;
    基于所述组合向量和第三变换向量,确定所述第二节点的中间向量;Determining the intermediate vector of the second node based on the combination vector and the third transformation vector;
    基于所述第二节点的中间向量和第四变换向量,确定所述第二节点的隐含向量。Based on the intermediate vector and the fourth transform vector of the second node, the implicit vector of the second node is determined.
  10. 根据权利要求1所述的方法,其中,所述神经网络模型包括多个LSTM层,其中,上一LSTM层确定出的所述第二节点的隐含向量,输入到下一LSTM层作为该第二节点的节点特征。The method according to claim 1, wherein the neural network model includes a plurality of LSTM layers, wherein the implicit vector of the second node determined by the previous LSTM layer is input to the next LSTM layer as the first The node characteristics of the two nodes.
  11. 根据权利要求10所述的方法,其中,所述神经网络模型将所述多个LSTM层各自输出的当前节点的隐含向量进行综合,得到所述当前节点的最终隐含向量。The method according to claim 10, wherein the neural network model integrates the hidden vectors of the current node output by each of the multiple LSTM layers to obtain the final hidden vector of the current node.
  12. 根据权利要求10所述的方法,其中,所述神经网络模型将所述多个LSTM层中最后一个LSTM层输出的当前节点的隐含向量,作为所述当前节点的最终隐含向量。The method according to claim 10, wherein the neural network model uses the implicit vector of the current node output by the last LSTM layer among the plurality of LSTM layers as the final implicit vector of the current node.
  13. 根据权利要求1所述的方法,其中,所述神经网络模型通过以下方式训练:The method according to claim 1, wherein the neural network model is trained in the following manner:
    获取历史交互事件,其中包括第一样本对象和第二样本对象;Obtain historical interaction events, including the first sample object and the second sample object;
    在所述动态交互图中,分别确定与所述第一样本对象对应的第一子图,和与所述第二样本对象对应的第二子图;In the dynamic interaction graph, a first subgraph corresponding to the first sample object and a second subgraph corresponding to the second sample object are respectively determined;
    将所述第一子图和所述第二子图分别输入所述神经网络模型,分别得到所述第一样本对象的隐含向量和第二样本对象的隐含向量;Input the first subgraph and the second subgraph into the neural network model respectively to obtain the hidden vector of the first sample object and the hidden vector of the second sample object;
    根据所述第一样本对象的隐含向量和第二样本对象的隐含向量,预测所述第一样本对象和第二样本对象是否会发生交互,得到预测结果;According to the implicit vector of the first sample object and the implicit vector of the second sample object, predict whether the first sample object and the second sample object will interact, and obtain a prediction result;
    根据所述预测结果,确定预测损失;Determine the predicted loss according to the predicted result;
    根据所述预测损失,更新所述神经网络模型。According to the predicted loss, the neural network model is updated.
  14. 根据权利要求1所述的方法,其中,所述神经网络模型通过以下方式训练:The method according to claim 1, wherein the neural network model is trained in the following manner:
    从所述交互事件集涉及的多个样本对象中选择样本对象,并获取该样本对象的分类标签;Selecting a sample object from a plurality of sample objects involved in the interaction event set, and obtaining a classification label of the sample object;
    在所述动态交互图中,确定与该样本对象对应的样本子图;In the dynamic interaction diagram, determine the sample sub-image corresponding to the sample object;
    将所述样本子图输入所述神经网络模型,得到所述样本对象的隐含向量;Input the sample sub-image into the neural network model to obtain the implicit vector of the sample object;
    根据所述样本对象的隐含向量,预测所述样本对象的分类,得到预测结果;Predict the classification of the sample object according to the implicit vector of the sample object to obtain the prediction result;
    根据所述预测结果和所述分类标签,确定预测损失;Determine the prediction loss according to the prediction result and the classification label;
    根据所述预测损失,更新所述神经网络模型。According to the predicted loss, the neural network model is updated.
  15. 一种处理交互数据的装置,所述装置包括:A device for processing interactive data, the device comprising:
    交互图获取单元,配置为获取根据交互事件集构建的动态交互图,其中,所述交互事件集包括多个交互事件,每个交互事件至少包括,发生交互行为的两个对象和交互时间;所述动态交互图包括任意的第一节点,所述第一节点对应于发生在第一时间的交互事件中的第一对象,所述第一节点通过连接边指向N个关联事件所对应的M个关联节点,所述N个关联事件均发生于第二时间,且均包含所述第一对象作为交互对象之一,所述第二时间为,从所述第一时间向前回溯,所述第一对象发生交互行为的前一时间;所述动态交互图中包括至少一个关联节点数目大于2的多元节点;The interaction diagram obtaining unit is configured to obtain a dynamic interaction diagram constructed according to a set of interaction events, wherein the set of interaction events includes a plurality of interaction events, and each interaction event includes at least two objects on which the interaction behavior occurs and the interaction time; The dynamic interaction graph includes any first node, the first node corresponds to the first object in the interaction event occurring at the first time, and the first node points to M corresponding to the N associated events through the connecting edge. Associated node, the N associated events all occur at the second time, and all include the first object as one of the interactive objects, the second time is, going back from the first time, the first time The time before the interaction of an object; the dynamic interaction graph includes at least one multi-node with more than 2 associated nodes;
    子图确定单元,配置为在所述动态交互图中,确定与待分析的当前节点对应的当前子图,所述当前子图包括从当前节点出发,经由连接边到达的预定范围内的节点;A subgraph determining unit configured to determine, in the dynamic interaction graph, a current subgraph corresponding to the current node to be analyzed, the current subgraph including nodes within a predetermined range that start from the current node and reach via a connecting edge;
    子图处理单元,配置为将所述当前子图输入神经网络模型,所述神经网络模型包括LSTM层,所述LSTM层根据所述当前子图中各个节点之间的连接边的指向关系,依次迭代处理各个节点,从而得到所述当前节点的隐含向量;其中所述各个节点包括第二节点,所述依次迭代处理各个节点包括,至少根据所述第二节点的节点特征,该第二节点所指向的k个关联节点各自的中间向量和隐含向量,确定所述第二节点的隐含向量和中间向量;The subgraph processing unit is configured to input the current subgraph into a neural network model, the neural network model including an LSTM layer, and the LSTM layer sequentially Iteratively process each node to obtain the implicit vector of the current node; wherein each node includes a second node, and the sequential iterative processing of each node includes, at least according to the node characteristics of the second node, the second node Determine the hidden vector and the intermediate vector of the respective intermediate vectors and hidden vectors of the k associated nodes pointed to;
    业务处理单元,配置为根据所述当前节点的隐含向量,进行与所述当前节点相关的业务处理。The service processing unit is configured to perform service processing related to the current node according to the implicit vector of the current node.
  16. 根据权利要求15所述的装置,其中,所述对象包括用户,所述交互事件包括以下中的至少一种:点击事件,社交事件,交易事件。The apparatus according to claim 15, wherein the object includes a user, and the interaction event includes at least one of the following: a click event, a social event, and a transaction event.
  17. 根据权利要求15所述的装置,其中,所述M个关联节点为2N个节点,分别对应于所述N个关联事件中各个关联事件所包括的两个对象;或者,The apparatus according to claim 15, wherein the M associated nodes are 2N nodes, respectively corresponding to two objects included in each associated event in the N associated events; or,
    所述M个关联节点为N+1个节点,分别对应于所述N个关联事件中与所述第一对象交互的N个其他对象,以及所述第一对象自身。The M associated nodes are N+1 nodes, respectively corresponding to N other objects interacting with the first object in the N associated events, and the first object itself.
  18. 根据权利要求15所述的装置,其中,所述预定范围内的节点包括:The apparatus according to claim 15, wherein the nodes in the predetermined range comprise:
    预设阶数K的连接边之内的节点;和/或Nodes within the connecting edges of the preset order K; and/or
    交互时间在预设时间范围内的节点。Nodes whose interaction time is within the preset time range.
  19. 根据权利要求15所述的装置,其中,所述每个交互事件还包括,交互行为的行为特征;The apparatus according to claim 15, wherein each of the interaction events further comprises behavior characteristics of the interaction behavior;
    所述第二节点的节点特征包括,所述第二节点所对应的对象的属性特征,以及所述第二节点在所对应的交互时间中参与的交互事件的行为特征。The node characteristics of the second node include the attribute characteristics of the object corresponding to the second node, and the behavior characteristics of the interaction events that the second node participates in during the corresponding interaction time.
  20. 根据权利要求15所述的装置,其中,所述LSTM层用于:The apparatus according to claim 15, wherein the LSTM layer is used to:
    将所述第二节点的节点特征,分别与所述k个关联节点对应的k个隐含向量组合,输入算法相同、参数不同的第一变换函数和第二变换函数,分别得到k个第一变换向量和k个第二变换向量;Combine the node characteristics of the second node with the k implicit vectors corresponding to the k associated nodes, and input the first transformation function and the second transformation function with the same algorithm and different parameters to obtain k first transformation functions. Transformation vector and k second transformation vectors;
    将所述k个关联节点中第i关联节点的中间向量,与对应的第i个第一变换向量,第i个第二变换向量进行组合操作,得到k个操作结果,将该k个操作结果求和,得到组合向量;Combine the intermediate vector of the i-th associated node among the k associated nodes with the corresponding i-th first transform vector and the i-th second transform vector to obtain k operation results, and the k operation results Sum to get the combined vector;
    将所述第二节点的节点特征连同所述k个隐含向量,分别输入第三变换函数和第四变换函数,分别得到第三变换向量和第四变换向量;Inputting the node feature of the second node together with the k implicit vectors into a third transformation function and a fourth transformation function, respectively, to obtain a third transformation vector and a fourth transformation vector;
    基于所述组合向量和第三变换向量,确定所述第二节点的中间向量;Determining the intermediate vector of the second node based on the combination vector and the third transformation vector;
    基于所述第二节点的中间向量和第四变换向量,确定所述第二节点的隐含向量。Based on the intermediate vector and the fourth transform vector of the second node, the implicit vector of the second node is determined.
  21. 根据权利要求15所述的装置,其中,所述LSTM层用于:根据所述第二节点的节点特征,该第二节点所指向的k个关联节点各自的中间向量和隐含向量,以及该第二节点对应的交互时间与所述k个关联节点对应的交互时间之间的时间差,确定所述第二节点的隐含向量和中间向量。The apparatus according to claim 15, wherein the LSTM layer is used to: according to the node characteristics of the second node, the respective intermediate vectors and implicit vectors of the k associated nodes pointed to by the second node, and the The time difference between the interaction time corresponding to the second node and the interaction time corresponding to the k associated nodes determines the implicit vector and the intermediate vector of the second node.
  22. 根据权利要求21所述的装置,其中,所述LSTM层具体用于:The device according to claim 21, wherein the LSTM layer is specifically used for:
    将所述第二节点的节点特征和所述时间差,与所述k个关联节点对应的k个隐含向量分别组合,输入第一变换函数,得到k个第一变换向量;Combining the node characteristics of the second node and the time difference with the k implicit vectors corresponding to the k associated nodes, respectively, and inputting a first transformation function to obtain k first transformation vectors;
    将所述第二节点的节点特征与所述k个关联节点对应的k个隐含向量分别组合,输入第二变换函数,得到k个第二变换向量;Combine the node features of the second node and the k implicit vectors corresponding to the k associated nodes respectively, and input a second transformation function to obtain k second transformation vectors;
    将所述k个关联节点中第i关联节点的中间向量,与对应的第i第一变换向量,第i第二变换向量进行组合操作,得到k个操作结果,将该k个操作结果求和,得到组合向量;Combine the intermediate vector of the i-th associated node among the k associated nodes with the corresponding i-th first transform vector and the i-th second transform vector to obtain k operation results, and sum the k operation results , Get the combined vector;
    将所述第二节点的节点特征连同所述k个隐含向量,分别输入第三变换函数和第四变换函数,分别得到第三变换向量和第四变换向量;Inputting the node feature of the second node together with the k implicit vectors into a third transformation function and a fourth transformation function, respectively, to obtain a third transformation vector and a fourth transformation vector;
    基于所述组合向量和第三变换向量,确定所述第二节点的中间向量;Determining the intermediate vector of the second node based on the combination vector and the third transformation vector;
    基于所述第二节点的中间向量和第四变换向量,确定所述第二节点的隐含向量。Based on the intermediate vector and the fourth transform vector of the second node, the implicit vector of the second node is determined.
  23. 根据权利要求21所述的装置,其中,所述LSTM层具体用于:The device according to claim 21, wherein the LSTM layer is specifically used for:
    将所述第二节点的节点特征和所述时间差,与所述k个关联节点对应的k个隐含向量分别组合后,输入算法相同、参数不同的第一变换函数和第二变换函数,分别得到k个第一变换向量和k个第二变换向量;After combining the node characteristics of the second node and the time difference with the k implicit vectors corresponding to the k associated nodes, respectively, the first transformation function and the second transformation function with the same algorithm and different parameters are input, respectively Obtain k first transform vectors and k second transform vectors;
    将所述k个关联节点中第i关联节点的中间向量,与对应的第i第一变换向量,第i第二变换向量进行组合操作,得到k个操作结果,将该k个操作结果求和,得到组合向量;Combine the intermediate vector of the i-th associated node among the k associated nodes with the corresponding i-th first transform vector and the i-th second transform vector to obtain k operation results, and sum the k operation results , Get the combined vector;
    将所述第二节点的节点特征连同所述k个隐含向量,分别输入第三变换函数和第四变换函数,分别得到第三变换向量和第四变换向量;Inputting the node feature of the second node together with the k implicit vectors into a third transformation function and a fourth transformation function, respectively, to obtain a third transformation vector and a fourth transformation vector;
    基于所述组合向量和第三变换向量,确定所述第二节点的中间向量;Determining the intermediate vector of the second node based on the combination vector and the third transformation vector;
    基于所述第二节点的中间向量和第四变换向量,确定所述第二节点的隐含向量。Based on the intermediate vector and the fourth transform vector of the second node, the implicit vector of the second node is determined.
  24. 根据权利要求15所述的装置,其中,所述神经网络模型包括多个LSTM层,其中,上一LSTM层确定出的所述第二节点的隐含向量,输入到下一LSTM层作为该第二节点的节点特征。The device according to claim 15, wherein the neural network model includes a plurality of LSTM layers, wherein the implicit vector of the second node determined by the previous LSTM layer is input to the next LSTM layer as the first The node characteristics of the two nodes.
  25. 根据权利要求24所述的装置,其中,所述神经网络模型将所述多个LSTM层各自输出的当前节点的隐含向量进行综合,得到所述当前节点的最终隐含向量。The device according to claim 24, wherein the neural network model integrates the implicit vectors of the current node output by each of the multiple LSTM layers to obtain the final implicit vector of the current node.
  26. 根据权利要求24所述的装置,其中,所述神经网络模型将所述多个LSTM层中最后一个LSTM层输出的当前节点的隐含向量,作为所述当前节点的最终隐含向量。The device according to claim 24, wherein the neural network model uses the implicit vector of the current node output by the last LSTM layer among the plurality of LSTM layers as the final implicit vector of the current node.
  27. 根据权利要求15所述的装置,其中,所述神经网络模型通过模型训练单元训练,所述模型训练单元包括:The device according to claim 15, wherein the neural network model is trained by a model training unit, and the model training unit comprises:
    样本获取模块,配置为获取历史交互事件,其中包括第一样本对象和第二样本对象;The sample acquisition module is configured to acquire historical interaction events, including the first sample object and the second sample object;
    子图确定模块,配置为在所述动态交互图中,分别确定与所述第一样本对象对应的第一子图,和与所述第二样本对象对应的第二子图;A subgraph determining module, configured to respectively determine a first subgraph corresponding to the first sample object and a second subgraph corresponding to the second sample object in the dynamic interaction graph;
    向量获取模块,配置为将所述第一子图和所述第二子图分别输入所述神经网络模型,分别得到所述第一样本对象的隐含向量和第二样本对象的隐含向量;A vector acquisition module configured to input the first sub-image and the second sub-image into the neural network model respectively to obtain the implicit vector of the first sample object and the implicit vector of the second sample object ;
    预测模块,配置为根据所述第一样本对象的隐含向量和第二样本对象的隐含向量,预测所述第一样本对象和第二样本对象是否会发生交互,得到预测结果;A prediction module configured to predict whether the first sample object and the second sample object will interact according to the implicit vector of the first sample object and the implicit vector of the second sample object, to obtain a prediction result;
    损失确定模块,配置为根据所述预测结果,确定预测损失;A loss determining module, configured to determine a predicted loss according to the prediction result;
    更新模块,配置为根据所述预测损失,更新所述神经网络模型。The update module is configured to update the neural network model according to the predicted loss.
  28. 根据权利要求15所述的装置,其中,所述神经网络模型通过模型训练单元训练,所述模型训练单元包括:The device according to claim 15, wherein the neural network model is trained by a model training unit, and the model training unit comprises:
    样本获取模块,配置为从所述交互事件集涉及的多个样本对象中选择样本对象,并获取该样本对象的分类标签;A sample acquisition module, configured to select a sample object from a plurality of sample objects involved in the set of interaction events, and obtain a classification label of the sample object;
    子图确定模块,配置为在所述动态交互图中,确定与该样本对象对应的样本子图;A subgraph determining module, configured to determine a sample subgraph corresponding to the sample object in the dynamic interaction graph;
    向量获取模块,配置为将所述样本子图输入所述神经网络模型,得到所述样本对象的隐含向量;A vector acquisition module configured to input the sample sub-image into the neural network model to obtain the implicit vector of the sample object;
    预测模块,配置为根据所述样本对象的隐含向量,预测所述样本对象的分类,得到预测结果;A prediction module configured to predict the classification of the sample object according to the implicit vector of the sample object to obtain a prediction result;
    损失确定模块,配置为根据所述预测结果和所述分类标签,确定预测损失;A loss determination module, configured to determine a prediction loss according to the prediction result and the classification label;
    更新模块,配置为根据所述预测损失,更新所述神经网络模型。The update module is configured to update the neural network model according to the predicted loss.
  29. 一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行权利要求1-14中任一项的所述的方法。A computer-readable storage medium with a computer program stored thereon, and when the computer program is executed in a computer, the computer is caused to execute the method of any one of claims 1-14.
  30. 一种计算设备,包括存储器和处理器,其特征在于,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现权利要求1-14中任一项所述的方法。A computing device, comprising a memory and a processor, characterized in that executable code is stored in the memory, and when the processor executes the executable code, the device described in any one of claims 1-14 is implemented method.
PCT/CN2020/138398 2020-01-09 2020-12-22 Method and apparatus for processing interaction data by using lstm neural network model WO2021139524A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010022183.2 2020-01-09
CN202010022183.2A CN111210008B (en) 2020-01-09 2020-01-09 Method and device for processing interactive data by using LSTM neural network model

Publications (1)

Publication Number Publication Date
WO2021139524A1 true WO2021139524A1 (en) 2021-07-15

Family

ID=70786026

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/138398 WO2021139524A1 (en) 2020-01-09 2020-12-22 Method and apparatus for processing interaction data by using lstm neural network model

Country Status (2)

Country Link
CN (2) CN115081589A (en)
WO (1) WO2021139524A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116303996A (en) * 2023-05-25 2023-06-23 江西财经大学 Theme event extraction method based on multifocal graph neural network

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115081589A (en) * 2020-01-09 2022-09-20 支付宝(杭州)信息技术有限公司 Method and device for processing interactive data by using LSTM neural network model
CN111522866B (en) * 2020-07-03 2020-11-03 支付宝(杭州)信息技术有限公司 Credible subgraph mining method, device and equipment
CN111523682B (en) * 2020-07-03 2020-10-23 支付宝(杭州)信息技术有限公司 Method and device for training interactive prediction model and predicting interactive object
CN112085293B (en) * 2020-09-18 2022-09-09 支付宝(杭州)信息技术有限公司 Method and device for training interactive prediction model and predicting interactive object
CN112307256A (en) * 2020-10-28 2021-02-02 有半岛(北京)信息科技有限公司 Cross-domain recommendation and model training method and device
CN113313208A (en) * 2021-02-05 2021-08-27 支付宝(杭州)信息技术有限公司 Object clustering method and system
CN113987280A (en) * 2021-10-27 2022-01-28 支付宝(杭州)信息技术有限公司 Method and device for training graph model aiming at dynamic graph
CN116777567A (en) * 2023-08-17 2023-09-19 山东恒诺尚诚信息科技有限公司 Order generation method and system based on artificial intelligence

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109284864A (en) * 2018-09-04 2019-01-29 广州视源电子科技股份有限公司 Behavior sequence acquisition methods and device, user's conversion ratio prediction technique and device
CN110543935A (en) * 2019-08-15 2019-12-06 阿里巴巴集团控股有限公司 Method and device for processing interactive sequence data
CN110555469A (en) * 2019-08-15 2019-12-10 阿里巴巴集团控股有限公司 Method and device for processing interactive sequence data
CN110598847A (en) * 2019-08-15 2019-12-20 阿里巴巴集团控股有限公司 Method and device for processing interactive sequence data
CN111210008A (en) * 2020-01-09 2020-05-29 支付宝(杭州)信息技术有限公司 Method and device for processing interactive data by using LSTM neural network model
CN111258469A (en) * 2020-01-09 2020-06-09 支付宝(杭州)信息技术有限公司 Method and device for processing interactive sequence data

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101017508A (en) * 2006-12-21 2007-08-15 四川大学 SoC software-hardware partition method based on discrete Hopfield neural network
US8296434B1 (en) * 2009-05-28 2012-10-23 Amazon Technologies, Inc. Providing dynamically scaling computing load balancing
US9659265B2 (en) * 2009-10-12 2017-05-23 Oracle International Corporation Methods and systems for collecting and analyzing enterprise activities
US20110313736A1 (en) * 2010-06-18 2011-12-22 Bioproduction Group, a California Corporation Method and Algorithm for Modeling and Simulating A Discrete-Event Dynamic System
US20130232433A1 (en) * 2013-02-01 2013-09-05 Concurix Corporation Controlling Application Tracing using Dynamic Visualization
US9794359B1 (en) * 2014-03-31 2017-10-17 Facebook, Inc. Implicit contacts in an online social network
JP5901712B2 (en) * 2014-08-29 2016-04-13 株式会社日立製作所 Semiconductor device and information processing apparatus
CN106021364B (en) * 2016-05-10 2017-12-12 百度在线网络技术(北京)有限公司 Foundation, image searching method and the device of picture searching dependency prediction model
CN109934706B (en) * 2017-12-15 2021-10-29 创新先进技术有限公司 Transaction risk control method, device and equipment based on graph structure model
CN108446978A (en) * 2018-02-12 2018-08-24 阿里巴巴集团控股有限公司 Handle the method and device of transaction data
US11537719B2 (en) * 2018-05-18 2022-12-27 Deepmind Technologies Limited Deep neural network system for similarity-based graph representations
CN109583475B (en) * 2018-11-02 2023-06-30 创新先进技术有限公司 Abnormal information monitoring method and device
CN110009093B (en) * 2018-12-07 2020-08-07 阿里巴巴集团控股有限公司 Neural network system and method for analyzing relational network graph
CN109918454B (en) * 2019-02-22 2024-02-06 创新先进技术有限公司 Method and device for embedding nodes into relational network graph
CN110659799A (en) * 2019-08-14 2020-01-07 深圳壹账通智能科技有限公司 Attribute information processing method and device based on relational network, computer equipment and storage medium
CN110490274B (en) * 2019-10-17 2020-02-07 支付宝(杭州)信息技术有限公司 Method and device for evaluating interaction event

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109284864A (en) * 2018-09-04 2019-01-29 广州视源电子科技股份有限公司 Behavior sequence acquisition methods and device, user's conversion ratio prediction technique and device
CN110543935A (en) * 2019-08-15 2019-12-06 阿里巴巴集团控股有限公司 Method and device for processing interactive sequence data
CN110555469A (en) * 2019-08-15 2019-12-10 阿里巴巴集团控股有限公司 Method and device for processing interactive sequence data
CN110598847A (en) * 2019-08-15 2019-12-20 阿里巴巴集团控股有限公司 Method and device for processing interactive sequence data
CN111210008A (en) * 2020-01-09 2020-05-29 支付宝(杭州)信息技术有限公司 Method and device for processing interactive data by using LSTM neural network model
CN111258469A (en) * 2020-01-09 2020-06-09 支付宝(杭州)信息技术有限公司 Method and device for processing interactive sequence data

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116303996A (en) * 2023-05-25 2023-06-23 江西财经大学 Theme event extraction method based on multifocal graph neural network
CN116303996B (en) * 2023-05-25 2023-08-04 江西财经大学 Theme event extraction method based on multifocal graph neural network

Also Published As

Publication number Publication date
CN115081589A (en) 2022-09-20
CN111210008A (en) 2020-05-29
CN111210008B (en) 2022-05-24

Similar Documents

Publication Publication Date Title
WO2021139524A1 (en) Method and apparatus for processing interaction data by using lstm neural network model
WO2021027260A1 (en) Method and device for processing interaction sequence data
JP6913241B2 (en) Systems and methods for issuing loans to consumers who are determined to be creditworthy
CN111611472B (en) Binding recommendation method and system based on graph convolution neural network
CN110555469B (en) Method and device for processing interactive sequence data
CN110543935B (en) Method and device for processing interactive sequence data
US11250088B2 (en) Method and apparatus for processing user interaction sequence data
CN109087178A (en) Method of Commodity Recommendation and device
US20100257028A1 (en) Methods and systems for extracting and managing latent social networks for use in commercial activities
US20180285936A1 (en) Intelligent visual object management system
CN110490274B (en) Method and device for evaluating interaction event
US11227217B1 (en) Entity transaction attribute determination method and apparatus
CN110689110B (en) Method and device for processing interaction event
US11157987B2 (en) System and method for obtaining recommendations using scalable cross-domain collaborative filtering
WO2021139525A1 (en) Method and device for training autoencoder for evaluating interaction event
US20140108156A1 (en) Methods and systems for extracting and managing latent social networks for use in commercial activities
CN111476223B (en) Method and device for evaluating interaction event
WO2021139513A1 (en) Method and apparatus for processing interaction sequence data
Xiao et al. MGNN: Mutualistic graph neural network for joint friend and item recommendation
CN113763095B (en) Information recommendation method and device and model training method and device
CN113761388A (en) Recommendation method and device, electronic equipment and storage medium
CN113610610A (en) Session recommendation method and system based on graph neural network and comment similarity
US20230214696A1 (en) System and method for obtaining recommendations using scalable cross-domain collaborative filtering
Wang et al. Multicriteria-based crowd selection using ant colony optimization
CN113168424A (en) System and method for obtaining recommendations using scalable cross-domain collaborative filtering

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20912658

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20912658

Country of ref document: EP

Kind code of ref document: A1