WO2021027256A1 - 处理交互序列数据的方法及装置 - Google Patents

处理交互序列数据的方法及装置 Download PDF

Info

Publication number
WO2021027256A1
WO2021027256A1 PCT/CN2020/072042 CN2020072042W WO2021027256A1 WO 2021027256 A1 WO2021027256 A1 WO 2021027256A1 CN 2020072042 W CN2020072042 W CN 2020072042W WO 2021027256 A1 WO2021027256 A1 WO 2021027256A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
interaction
sequence
vector
vectors
Prior art date
Application number
PCT/CN2020/072042
Other languages
English (en)
French (fr)
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 创新先进技术有限公司
Priority to US16/816,719 priority Critical patent/US10936950B1/en
Publication of WO2021027256A1 publication Critical patent/WO2021027256A1/zh
Priority to US17/188,112 priority patent/US11636341B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/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 sequence data using machine learning.
  • Interaction events are one of the basic elements of Internet events. For example, a user's click behavior 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 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 sources of 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 their various characteristics. Therefore, it is hoped that there will be an improved solution to more effectively analyze and process the interactive objects in the interactive event, so as to obtain feature vectors suitable for subsequent analysis.
  • One or more embodiments of this specification describe a method and device for processing interactive sequence data, in which a neural network model is used to consider the interaction events participated by interactive objects and the influence of other objects in the interactive events, and the interactive objects are processed into feature vectors, thereby Conducive to follow-up analysis.
  • a method for processing interactive sequence data comprising:
  • the dynamic interaction sequence includes multiple interaction feature groups corresponding to multiple interaction events arranged in chronological order, and each interaction feature group includes the first interaction behavior that occurs Object, second object, and interaction time;
  • the dynamic interaction graph includes multiple nodes representing each first object and second object in each interaction feature group, the multiple nodes include a first node, and the first node Pointing to two leaf nodes by connecting edges, the two leaf nodes respectively representing two objects in the interaction feature group corresponding to the last interaction event in which the interaction object corresponding to the first node participated;
  • the current sequence corresponding to the current node to be analyzed is determined, and the current sequence includes a plurality of nodes within a predetermined range that start from the current node and arrive via a connecting edge, and the plurality of nodes The position code of each node in the dynamic interaction graph relative to the current node;
  • the dynamic interaction diagram is obtained in the following manner:
  • the dynamic interaction diagram is obtained in the following manner:
  • the first object and the second object are added as two newly-added nodes to the existing dynamic interaction graph;
  • the current node is a node: in the dynamic interaction graph, there is no connecting edge pointing to the node.
  • the nodes within the predetermined range include: nodes within a predetermined number K of connected edges; and/or nodes whose interaction time is within a predetermined time range.
  • the aforementioned first object and second object are respectively a first type of object and a second type of object
  • the two leaf nodes include a left node and a right node
  • the left node corresponds to the previous interaction event
  • the right node corresponds to the second type of object in the previous interaction event.
  • the position encoding may include the number of connecting edges that each node passes with respect to the current node, and whether the node is a left node or a right node.
  • each interaction feature group further includes the behavior feature of the interaction behavior; therefore, the node feature of each node in the current sequence may include the attribute feature of the interaction object corresponding to the node, and the interaction where the node is located Behavioral characteristics in a characteristic group.
  • the embedding layer obtains N embedding vectors as follows:
  • the N node embedding vectors and the N position embedding vectors are integrated to obtain the N embedding vectors.
  • the attention layer obtains N output vectors as follows:
  • the first transformation matrix Q, the second transformation matrix K, and the third transformation matrix V are used to transform each of the N input vectors to obtain the first intermediate vector, the second intermediate vector and the first intermediate vector corresponding to each input vector.
  • the i-th input vector and each input are determined The correlation degree of the vector;
  • the N output vectors are obtained.
  • each attention layer maintains m sets of transformation matrices, and each set of transformation matrices includes the first transformation matrix Q, the second transformation matrix K, and the third transformation matrix V, thereby obtaining m vectors Sequence, each vector sequence includes N combination vectors obtained based on a set of transformation matrices; the attention layer then splices the m vector sequences to obtain a splicing matrix; transforms the splicing matrix through a fourth transformation matrix , Split the transformed matrix into N vectors as the N output vectors.
  • the at least one attention layer is a plurality of attention layers, including a first attention layer and subsequent attention layers connected to the embedding layer, and the first attention layer is derived from the
  • the embedding layer obtains the N embedding vectors as its N input vectors, and each subsequent attention layer obtains the N output vectors obtained by the previous attention layer as its N input vectors.
  • the neural network model can synthesize the N output vectors obtained by each attention layer in the multiple attention layers to obtain the feature vector corresponding to the current node.
  • the neural network model may also synthesize the N output vectors obtained by the last attention layer among the multiple attention layers to obtain the feature vector of the current node.
  • the neural network model is trained in the following way:
  • a first sequence corresponding to the first sample object and a second sequence corresponding to the second sample object are respectively determined
  • the first feature vector and the second feature vector predict whether the first sample object and the second sample object will interact, and obtain a prediction result
  • the neural network model is updated.
  • the neural network model is trained in the following way:
  • the neural network model is updated.
  • an apparatus for processing interactive sequence data comprising:
  • the interaction diagram obtaining unit is configured to obtain a dynamic interaction diagram constructed according to a dynamic interaction sequence, wherein the dynamic interaction sequence includes multiple interaction feature groups corresponding to multiple interaction events arranged in chronological order, and each interaction feature group includes , The first object, the second object, and the interaction time where the interactive behavior occurs; the dynamic interaction graph includes multiple nodes representing each first object and second object in each interactive feature group, and the multiple nodes include the first Node, the first node points to two leaf nodes through a connecting edge, and the two leaf nodes respectively represent two of the interaction feature groups corresponding to the last interaction event in which the interaction object corresponding to the first node participated Objects
  • the sequence determining unit is configured to determine the current sequence corresponding to the current node to be analyzed in the dynamic interaction graph, and the current sequence includes, starting from the current node, a plurality of nodes within a predetermined range reached via a connecting edge, And the position code of each node of the multiple nodes relative to the current node in the dynamic interaction graph;
  • a sequence processing unit configured to input the current sequence into a Transformer-based neural network model, the neural network model including an embedding layer and at least one attention layer, where the embedding layer is based on the nodes of each node in the current sequence Features and their position encodings to obtain N embedding vectors; in each attention layer, based on the correlation between each of the N input vectors obtained from the previous layer, the input vectors are synthesized to obtain N Output vector; the neural network model determines the feature vector corresponding to the current node based on the N output vectors obtained by the at least one attention layer.
  • 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 dynamic interaction sequence, 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 feature vector of the interactive object can be extracted. The feature vector obtained in this way 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.
  • 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 sequence data according to an embodiment
  • Figure 4 shows a dynamic interaction sequence and a dynamic interaction diagram constructed therefrom according to an embodiment
  • Figure 5 shows an example of the current sequence in one embodiment
  • FIG. 6 shows a schematic structural diagram of a neural network model based on Transformer in an embodiment
  • FIG. 7 is a schematic diagram of the operation of the attention layer according to an embodiment
  • Figure 8 shows a flowchart of training a neural network model in one embodiment
  • Figure 9 shows a flowchart of training a neural network model in another embodiment
  • Fig. 10 shows a schematic block diagram of an apparatus for processing interactive sequence data according to an embodiment.
  • the participants of 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, thereby forming 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 two-part graph, which contains user nodes (U1-U4) and commodity nodes (V1-V3). If a user has purchased a certain commodity, it will be between the user and the commodity. Construct a connecting edge between.
  • Figure 1B shows a user transfer relationship diagram, in which each node represents a user, and there is a connection 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 timing information of the interaction 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, while interactive events are events involving multiple parties, and the participants will indirectly pass on the impact through the interactive events. Therefore, this method does not express the influence between the participating objects in the interaction event.
  • a dynamically changing sequence 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.
  • the sequence related to the corresponding node is obtained from the dynamic interaction graph, which contains the associated leaf node and the position code of the leaf node relative to the node to be analyzed, and the sequence is input into the neural network model based on Transformer, 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 dynamic interaction sequence.
  • 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.
  • the structure of the dynamic interaction diagram 200 will be described in more detail later.
  • the corresponding current node in the dynamic interaction graph can be determined, and the node sequence data with the current node as the root node in the dynamic interaction graph can be obtained.
  • the node sequence data can be obtained.
  • the position code of each leaf node relative to the current node is also obtained to form the node sequence data together.
  • the sequence data reflects the influence of other objects in the interaction event directly or indirectly associated with the current interaction object on the current node.
  • the above-mentioned node sequence data is input to the Transformer-based neural network model, and the feature vector of the current interactive object is output through the model.
  • the feature vector obtained in this way can extract the timing information of the associated interaction event and the influence between the interaction objects in each interaction event, so as to more accurately express the deep characteristics of the current interaction object.
  • Such feature vectors can be subsequently applied to various machine learning models and various business 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 sequence 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 sequence data as shown in FIG. 3 in conjunction with specific embodiments.
  • step 31 a dynamic interaction diagram constructed according to a dynamic interaction sequence is obtained.
  • the dynamic interaction sequence includes multiple feature groups (a i , b i , t i ) corresponding to multiple interaction events arranged in chronological order, and each interaction feature group includes at least two interactive behaviors.
  • Objects such as the first object and the second object, and the interaction time.
  • the two objects interacting may be objects of different types, such as objects of the first type and objects of the second type.
  • the interaction event may be a user's purchase behavior, where the first object may be a certain user (the first type of object), and the second object may be a certain commodity (the second type of object).
  • the interaction event can be a user's click behavior on a page block, where the first object can be the user (the first type of object), and the second object can be a certain page block (the second type of object) .
  • 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.
  • the interaction event can be a transfer between two users. At this time, both the first object and the second object are users of the electronic payment platform and belong to the same type of objects.
  • whether to distinguish the types of two interactive objects can be set according to business needs. For example, for the transfer interaction event, in the foregoing example, it is considered that two users belong to the same kind of objects. In other examples, according to business needs, the user who transfers the amount may be regarded as the first type of object, and the receiving user is regarded as the second type of object.
  • the behavior feature f may include the background and context information of the interaction behavior, some attribute characteristics of the interaction behavior, and so on.
  • the behavior characteristic f may include the type of terminal used by the user to click, the browser type, app version, and so on.
  • a dynamic interaction diagram can be constructed. Specifically, each first object and each second object in each feature group in the dynamic interaction sequence are respectively used as nodes of the dynamic interaction graph. In this way, one node may correspond to one object in the feature group of one interaction event, but the same physical object may correspond to multiple nodes. For example, if user U1 purchases product M1 at time t1 and product M2 at time t2, then there are two interaction feature groups (U1, M1, t1) and (U1, M2, t2), then according to these two The interactive feature group creates nodes U1(t1) and U1(t2) for the user U1. Therefore, it can be considered that the nodes in the dynamic interaction graph correspond to the state of an interaction object in an interaction event.
  • Figure 4 shows a dynamic interaction sequence and a dynamic interaction diagram constructed therefrom according to an embodiment.
  • the left side of FIG. 4 shows a sequence of dynamic interaction organized chronologically, which are exemplarily shown in t 1, t 2, ..., E t 6 time interaction events occurred 1, E 2, ..., E 6 ,
  • the feature group of each interaction event includes the two interaction objects involved in the interaction and the interaction time.
  • the right side of Fig. 4 shows a dynamic interaction diagram constructed according to the dynamic interaction sequence on the left, in which two interaction objects in each interaction event are respectively used as nodes.
  • the following takes node A (t 6 ) as an example to describe the determination of leaf nodes and the construction of connecting edges.
  • the node A (t 6 ) represents an interactive object A in the interactive event E 6 . Therefore, starting from the interaction event E 6 and backtracking, the last interaction event found that also contains the interaction object A is E 4 , that is, E 4 is the last interaction event that A participated in, and correspondingly, E 4 corresponds to
  • the two nodes in the feature group are the two leaf nodes of A(t 6 ). Thus, a connecting edge from node A(t 6 ) to the two nodes A(t 4 ) and e(t 4 ) corresponding to E 4 is established.
  • the first object and the second object in each interaction event are different types of objects, which are distinguished by capitalization, that is, uppercase letters indicate the first type of objects, and lowercase letters indicate the second Class object.
  • the object types are also distinguished, and the nodes corresponding to the first type of objects in the same interaction event are arranged on the left, and the nodes corresponding to the second type of objects are arranged on the right.
  • the left node corresponds to the first type of object
  • the right node corresponds to the second type of object.
  • the two interactive objects can be arranged in any order in the interactive feature group and the dynamic interactive graph.
  • step 31 a dynamic interaction diagram is constructed on-site according to the dynamic interaction sequence.
  • the construction method is as described above.
  • the dynamic interaction diagram may be constructed based on the dynamic interaction sequence in advance. In step 31, read or receive the formed dynamic interaction diagram.
  • step 31 may also include a process of updating the dynamic interaction graph.
  • the dynamic interaction graph is updated based on the new interaction event.
  • an existing dynamic interaction graph constructed based on an existing interaction sequence can be obtained, and a feature group corresponding to a new interaction event, that is, a new feature group, can be obtained.
  • the first object and the second object included in the newly added interaction feature group are used as two newly added nodes and added to the existing dynamic interaction graph.
  • a new interaction event may be detected every predetermined time interval, for example, every hour, and multiple interaction events newly added in the time interval may be formed into a new interaction sequence. Or, whenever a predetermined number (for example, 100) of newly-added interaction events is detected, the predetermined number of newly-added interaction events is formed into a newly-added interaction sequence. Then the dynamic interaction diagram is updated based on the newly added interaction sequence.
  • a predetermined number for example, 100
  • an existing dynamic interaction graph constructed based on an existing interaction sequence can be obtained, and the above-mentioned new interaction sequence can be obtained, which includes a plurality of new interaction feature groups. Then, for each newly-added interaction feature group, the first object and the second object are added as two newly-added nodes to the existing dynamic interaction graph. And, for each newly added node, determine whether there is a leaf node, and if so, add a connecting edge from the newly added node to its two leaf nodes, thus forming an updated dynamic interaction graph.
  • step 31 a dynamic interaction graph constructed based on a dynamic interaction sequence is obtained.
  • step 32 in the acquired dynamic interaction graph, the current sequence corresponding to the current node to be analyzed is determined, and the current sequence includes, starting from the current node, a plurality of nodes within a predetermined range reached via the connecting edge, And the position code of each node of the multiple nodes relative to the current node in the dynamic interaction graph.
  • the current node is the node corresponding to the interactive object to be analyzed.
  • an interactive object can correspond to multiple nodes, expressing the state of the interactive object in different interactive events 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 corresponding to the latest interaction event in which the object to be analyzed participates is selected as the current node.
  • the current node For example, in the dynamic interaction diagram shown in FIG. 4, when you want to analyze the interaction object A, you can select node A (t 6 ) as the current node. However, this is not required.
  • another node may be selected as the current node.
  • node A (t 5 ) may also be selected as the current node.
  • the nodes within the foregoing predetermined range may be nodes that are reachable through at most a preset number K of connection edges.
  • the number K is a preset hyperparameter, which can be selected according to business conditions. It can be understood that the preset number 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, the longer the historical interactive information 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 that are reachable at most through the preset number K of connection edges and whose interaction time is within the predetermined time range.
  • traversal is performed along the connecting edge according to the principle of width first. In another embodiment, the traversal is performed according to the principle of depth first. Or, in other embodiments, traversal can be performed according to other topological sorting methods.
  • the position code of the node relative to the root node For each node within the predetermined range obtained by traversing, determine the position code of the node relative to the root node.
  • the above-mentioned position encoding may include the number of connecting edges passed by the node relative to the root node, or called the order.
  • each interaction object in the dynamic interaction graph is divided into a first type of object and a second type of object, and the first type of object is arranged on the left side of the two nodes of the same interaction event.
  • the second type of object is arranged on the right side of the above two nodes as the right node.
  • the aforementioned position coding further includes whether the node is a left node or a right node.
  • Figure 5 shows an example of the current sequence in one embodiment.
  • A(t 6 ) and b(t 6 ) in Figure 4 are the current nodes, and assume that the predetermined range is a certain time range, that is, backtracking from the interaction moment of the current node to At the earliest time t2.
  • the dashed box in FIG. 5 shows the nodes that fall within the aforementioned predetermined time range.
  • the nodes reachable through the connecting edge within a predetermined range include A(t 6 ), A(t 4 ), e(t 4 ), D( t 2 ), e(t 2 ).
  • the position codes are shown in the form of L/Rn, where L/R indicates whether the node is a left node or a right node, and n indicates the number of connecting edges passing by the root node.
  • L/R indicates whether the node is a left node or a right node
  • n indicates the number of connecting edges passing by the root node.
  • the position code L2 of the node D(t 2 ) indicates that the node is a left node and is connected to the root node through two connecting edges.
  • each node in sequence and its position code constitutes the current sequence corresponding to the current node.
  • the right side of Fig. 5 respectively shows sequence 1 obtained by taking A(t 6 ) as the current node and sequence 2 obtained by taking b(t 6 ) as the current node.
  • sequences corresponding to other nodes can also be obtained similarly.
  • step 33 the current sequence is input to a neural network model based on Transformer, and the current sequence is processed through the model to obtain the feature vector corresponding to the current node.
  • the Transformer model is mostly used to perform natural language processing NLP tasks.
  • the core feature of the Transformer model lies in its unique attention mechanism.
  • the Transformer model uses this attention mechanism to assign different attention coefficients to each word vector in the sentence, so as to more fully consider the influence of the context in the sentence on each word.
  • the Transformer model is used to process the current sequence obtained from the dynamic interaction graph for the current node.
  • Fig. 6 shows a schematic structural diagram of a neural network model based on Transformer in an embodiment.
  • the neural network model 600 includes an embedding layer 61 and attention layers 62 and 63.
  • the embedding layer 61 obtains N embedding vectors based on the node characteristics and position codes of each node in the current sequence.
  • the attention layer 62 is connected to the embedding layer 61.
  • N embedding vectors are obtained from the embedding layer as input vectors. Based on the correlation between the input vectors in the N input vectors, the input vectors are synthesized to obtain N output vectors, Output to the subsequent attention layer 63.
  • the attention layer 63 obtains the output of the previous layer as an input vector, and performs similar operations to the attention layer 62.
  • the neural network model determines the feature vector corresponding to the current node based on the N output vectors obtained by each attention layer.
  • the embedding layer 61 obtains the current sequence corresponding to the current node.
  • the current sequence includes multiple nodes in a predetermined range reachable from the current node through the connecting edge, and the position code of each node. It can be understood that for different current nodes, the current sequence length may not be consistent, as shown in the example in FIG. 5. To this end, a longer length N can be preset. If the actual length of the current sequence is less than N, the default value padding is used to fill it. After padding, it can be considered that the current sequence length is N, that is, it includes N nodes and corresponding N position codes. Therefore, the embedding layer 61 can embed the node feature and position code of each node separately, and then integrate them to obtain a preliminary embedding vector.
  • the embedding layer may perform embedding processing on the node features of each of the N nodes, respectively, to obtain N node embedding vectors.
  • the node feature may include the user's attribute characteristics, such as age, occupation, education level, region, etc.; in the case of a node representing a commodity, the node feature may include the commodity attribute feature, such as a commodity Categories, shelf time, sales, etc.
  • the original node characteristics can be obtained accordingly.
  • the interaction feature group also includes the behavior feature f
  • the node feature may also include the behavior feature f in the corresponding feature group.
  • the embedding layer also performs embedding processing on the N position codes corresponding to the N nodes to obtain N position embedding vectors.
  • the N nodes and N locations embedded vector embedded integrated vector for example, direct addition, a weighted combination, etc., thus to obtain N vector embedded ⁇ A 1 ,A 2 ,...,A N>.
  • the attention layer obtains N input vectors ⁇ X 1 ,X 2 ,...,X N > from its upper layer, which can be expressed as a matrix X, and uses a self-attention mechanism to transform each vector based on the degree of association between the vectors , Get N output vectors ⁇ Y 1 ,Y 2 ,...,Y N >, which can be expressed as matrix Y again.
  • the attention is embedded in the layer is a layer directly connecting, such as attention layer 62 in FIG. 6, which acquires a vector of an input vector that is embedded ⁇ A 1 ,A 2 ,...,A N>;
  • This attention layer is a subsequent attention layer, such as the attention layer 63 in FIG. 6, and the input vector obtained is the output vector ⁇ Y 1 , Y 2 ,..., Y N > of the previous attention layer.
  • FIG. 7 is a schematic diagram of the operation of the attention layer according to an embodiment.
  • the schematic diagram shows how the attention layer transforms the input matrix X into the output matrix Y.
  • the first transformation matrix Q, the second transformation matrix K, and the third transformation matrix V are used to transform each input vector X i in the N input vectors ⁇ X 1 , X 2 ,..., X N >, Obtain the first intermediate vector (q vector), the second intermediate vector (k vector) and the third intermediate vector (v vector) corresponding to each input vector.
  • the first transformation matrix Q, the second transformation matrix K, and the third transformation matrix V can be used to linearly transform the input matrix X composed of N input vectors to obtain the Q matrix, K matrix and V of the input matrix. Matrix, and then split the matrix separately to get the q vector, k vector and v vector corresponding to each input vector.
  • each input i For any i-th input vector X i among the N input vectors, based on the first intermediate vector (q vector, q i ) corresponding to the i-th input vector and each second intermediate vector (k vector) corresponding to each input vector X j , k j) dot product operation, each input i to determine the degree of association of the vectors X i and X j of each input vector.
  • the third intermediate vector (v vector, v j ) corresponding to each input vector X j can be weighted by using the respective correlation degrees ⁇ i,j of the i-th input vector X i and each input vector X j as a weighting factor. combination, to obtain a combination of the i-th vector of the i C i X i corresponding to the input vector:
  • N output vectors can be obtained.
  • the output matrix Y is the combined vector matrix C, which can be written as:
  • the attention layer adopts a "multi-head attention" mechanism, that is, the attention layer maintains m sets of transformation matrices, and each set of transformation matrices includes the aforementioned first transformation matrix Q and second transformation matrix K. And the third transformation matrix V, so that the above operations can be performed in parallel to obtain m combination vector sequences (ie m matrices C), each vector sequence includes N combination vectors obtained based on a set of transformation matrices.
  • the attention layer splices the obtained m combination vector sequences to obtain a splicing matrix; and then transforms the splicing matrix through the fourth transformation matrix W to obtain the final output matrix Y.
  • Splitting the output matrix Y corresponds to N output vectors ⁇ Y 1 , Y 2 ,..., Y N >.
  • the attention layer performs a transformation operation based on the correlation between the N input vectors, and obtains N output vectors.
  • the neural network model can contain multiple attention layers.
  • the above-mentioned multiple attention layers may be stacked and connected in a residual network manner to form a neural network model.
  • the neural network model can synthesize N output vectors obtained by each attention layer in the multiple attention layers to obtain the feature vector corresponding to the current node. In another embodiment, the neural network model can also extract only the N output vectors obtained by the last attention layer, and synthesize the N output vectors to obtain the feature vector of the current node.
  • the neural network model obtains the feature vector of the current node based on the current sequence corresponding to the current node to be analyzed. Since the current sequence contains the leaf nodes of each level related to the current node, and the positions of these leaf nodes relative to the current node, this information collectively reflects the temporal interaction history related to the interactive object corresponding to the current node, so we get The feature vector of the current node not only expresses the characteristics of the interactive object itself, but also expresses the influence that the interactive object has received in previous interactive events, thereby fully representing the characteristics of the interactive object.
  • the neural network model depends on a large number of parameters in the calculation process of determining the feature vector of the current node, such as the parameters in the aforementioned transformation matrices (Q matrix, K matrix, V matrix, etc.). 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.
  • the neural network model is trained by predicting the interaction behavior.
  • Fig. 8 shows a flowchart of training a neural network model in this embodiment.
  • a historical feature group corresponding to a historical interaction event is obtained, and the historical feature group is a feature group corresponding to a historical interaction event that has indeed occurred.
  • the historical interaction feature group can be obtained from the aforementioned dynamic interaction sequence.
  • the two objects included in the historical interaction feature group are called the first sample object and the second sample object.
  • step 82 in the dynamic interaction diagram, the first sequence corresponding to the first sample object and the second sequence corresponding to the second sample object are respectively determined. Specifically, the first node corresponding to the first sample object and the second node corresponding to the second sample object are respectively determined in the dynamic interaction graph, and the first node and the second node are respectively regarded as the current nodes, according to Figure 3 In a similar manner to step 32, the corresponding first sequence and second sequence are determined.
  • step 83 the above-mentioned first sequence and the second sequence are respectively input to the neural network model, and the first feature vector corresponding to the first sample object and the second feature vector corresponding to the second sample object are respectively obtained.
  • the specific process of the neural network model to determine the feature vector of the corresponding sample object based on the nodes in the sequence and their position codes is as described above in conjunction with step 33, and will not be repeated.
  • step 84 according to the first feature vector and the second feature vector, 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.
  • step 85 the prediction loss is determined based on the above prediction result.
  • the above-mentioned first sample object and second sample object come from the feature group of historical interaction events, and therefore interaction has actually occurred, which is equivalent to knowing the relationship label between the two sample objects.
  • 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.
  • the neural network model is trained by predicting the classification of interactive objects.
  • Fig. 9 shows a flowchart of training the neural network model in this embodiment.
  • a sample object is selected from the dynamic interaction sequence, and the classification label of the sample object is obtained.
  • the sample object may be any interaction object in any feature group included in the dynamic interaction sequence, and the classification label for the sample object may be a label related to a business scenario.
  • the classification label may be a preset 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.
  • step 92 in the dynamic interaction diagram, a sample sequence 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 sequence in a manner similar to step 32 in FIG. 3.
  • step 93 the above-mentioned sample sequence is input into the neural network model to obtain the feature vector of the sample object. This process is the same as that described in step 33, and will not be repeated.
  • step 94 the classification of the sample object is predicted according to the feature 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 to determine the loss of this prediction.
  • step 96 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 dynamic interaction sequence, 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 trained neural network model based on the node sequence related to the interactive object to be analyzed in the dynamic interaction graph, the feature vector of the interactive object can be extracted.
  • the feature vector obtained in this way 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.
  • an apparatus for processing interactive sequence data is provided, and the apparatus can be deployed in any device, platform, or device cluster with computing and processing capabilities.
  • Fig. 10 shows a schematic block diagram of an apparatus for processing interactive sequence data according to an embodiment. As shown in FIG. 10, the processing device 100 includes:
  • the interaction diagram obtaining unit 101 is configured to obtain a dynamic interaction diagram constructed according to a dynamic interaction sequence, wherein the dynamic interaction sequence includes multiple interaction feature groups corresponding to multiple interaction events arranged in chronological order, each interaction feature group Including the first object, the second object and the interaction time where the interactive behavior occurs; the dynamic interaction graph includes multiple nodes representing each first object and second object in each interactive feature group, and the multiple nodes include the first A node, the first node points to two leaf nodes through a connecting edge, and the two leaf nodes respectively represent the interaction feature group corresponding to the last interaction event in which the interaction object corresponding to the first node participated Two objects
  • the sequence determining unit 102 is configured to determine a current sequence corresponding to the current node to be analyzed in the dynamic interaction graph, and the current sequence includes a plurality of nodes within a predetermined range that start from the current node and reach via a connecting edge , And the position code of each node of the plurality of nodes relative to the current node in the dynamic interaction graph;
  • the sequence processing unit 103 is configured to input the current sequence into a Transformer-based neural network model, the neural network model including an embedding layer and at least one attention layer, in the embedding layer, based on the information of each node in the current sequence Node feature and its position encoding, get N embedding vectors;
  • each attention layer based on the correlation between each input vector in the N input vectors obtained from the previous layer, each input vector is synthesized to obtain N Output vectors; the neural network model determines the feature vector corresponding to the current node based on the N output vectors obtained by the at least one attention layer.
  • the interaction graph acquiring unit 101 is configured to:
  • the interaction graph acquiring unit 101 is configured to:
  • the first object and the second object are added as two newly-added nodes to the existing dynamic interaction graph;
  • the aforementioned current node is a node: in the dynamic interaction graph, there is no connection edge pointing to the node.
  • the nodes within the predetermined range may be nodes within a predetermined number K of connected edges; and/or nodes whose interaction time is within a predetermined time range.
  • the first object and the second object in the feature group are objects of the first type and the object of the second type respectively
  • the two leaf nodes include a left node and a right node
  • the left node corresponds to the previous
  • the right node corresponds to the second type of object in the previous interaction event.
  • the position encoding may include the number of connecting edges that each node passes with respect to the current node, and whether the node is a left node or a right node.
  • each interactive feature group further includes behavioral features of the interactive behavior; in this case, the node features of each node in the current sequence include the attribute features of the interactive object corresponding to the node, and The behavior feature in the interactive feature group where the node is located.
  • the embedding layer in the neural network model used by the sequence processing unit 103 is specifically used for:
  • the N node embedding vectors and the N position embedding vectors are integrated to obtain the N embedding vectors.
  • each attention layer in the neural network model used by the sequence processing unit 103 is used for:
  • the first transformation matrix Q, the second transformation matrix K, and the third transformation matrix V are used to transform each of the N input vectors to obtain the first intermediate vector, the second intermediate vector and the first intermediate vector corresponding to each input vector.
  • the i-th input vector and each input are determined The correlation degree of the vector;
  • the N output vectors are obtained.
  • each attention layer maintains m sets of transformation matrices, and each set of transformation matrices includes the first transformation matrix Q, the second transformation matrix K, and the third transformation matrix V, thereby obtaining m vectors Sequence, each vector sequence includes N combination vectors obtained based on a set of transformation matrices;
  • Each attention layer is also used for:
  • the at least one attention layer is a plurality of attention layers, including a first attention layer and subsequent attention layers connected to the embedding layer, and the first attention layer is derived from the
  • the embedding layer obtains the N embedding vectors as its N input vectors, and each subsequent attention layer obtains the N output vectors obtained by the previous attention layer as its N input vectors.
  • the neural network model synthesizes the N output vectors obtained by each of the multiple attention layers to obtain the feature vector corresponding to the current node.
  • the neural network model synthesizes the N output vectors obtained by the last attention layer among the plurality of attention layers to obtain the feature vector of the current node.
  • the neural network model is trained by the model training unit 104.
  • the model training unit 104 may be included in the device 100 or located outside it.
  • the model training unit 104 may include (not shown):
  • the sample acquisition module is configured to acquire the historical feature group corresponding to the historical interaction event, which includes the first sample object and the second sample object;
  • a sequence determining module configured to respectively determine a first sequence corresponding to the first sample object and a second sequence corresponding to the second sample object in the dynamic interaction diagram
  • the vector acquisition module is configured to input the first sequence and the second sequence into the neural network model, respectively, to obtain a first feature vector corresponding to the first sample object and a first feature vector corresponding to the second sample object.
  • Second eigenvector
  • a prediction module configured to predict whether the first sample object and the second sample object will interact according to the first feature vector and the second feature vector, and 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.
  • model training unit 104 may include (not shown):
  • a sample obtaining module configured to select a sample object from the dynamic interaction sequence, and obtain a classification label of the sample object
  • a sequence determination module configured to determine a sample sequence corresponding to the sample object in the dynamic interaction diagram
  • a vector acquisition module configured to input the sample sequence into the neural network model to obtain the feature vector of the sample object
  • a prediction module configured to predict the classification of the sample object according to the feature 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.
  • the neural network model based on Transformer is used to process the interaction object, and the feature vector suitable for subsequent analysis is 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 stores executable code, and when the processor executes the executable code, it implements the method.

Landscapes

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

Abstract

本说明书实施例提供一种处理交互序列数据的方法和装置。在该方法中,首先获取根据动态交互序列构建的动态交互图,其中动态交互序列包括按照时间顺序排列的多个交互事件,动态交互图包括代表各个交互事件中各个交互对象的节点,某个节点可以通过连接边指向两个叶节点,叶节点代表该某节点所参与的前一事件中包含的两个对象。然后,在动态交互图中,确定与待分析的当前节点对应的当前序列,其中包括从当前节点出发沿连接边可达的预定范围内的节点,以及这些节点的位置编码。然后,将当前序列输入基于Transformer的神经网络模型进行处理,得到该当前节点的特征向量。

Description

处理交互序列数据的方法及装置 技术领域
本说明书一个或多个实施例涉及机器学习领域,尤其涉及利用机器学习处理交互序列数据的方法和装置。
背景技术
在许多场景下,需要对用户交互事件进行分析和处理。交互事件是互联网事件的基本组成元素之一,例如,用户浏览页面时的点击行为,可以视为用户与页面内容区块之间的交互事件,电商中的购买行为可以视为用户与商品之间的交互事件,账户间转账行为则是用户与用户之间的交互事件。用户的一系列交互事件中蕴含了用户的细粒度习惯偏好等特点,以及交互对象的特点,是机器学习模型的重要特征来源。因此,在许多场景下,希望根据交互事件对交互参与方进行特征表达和建模。
然而,交互事件涉及交互双方,并且各个参与方本身的状态可以是动态变化的,因此,综合考虑交互参与方的多方面特点对其进行准确的特征表达非常困难。由此,希望能有改进的方案,更为有效地对交互事件中的交互对象进行分析处理,以得到适于后续分析的特征向量。
发明内容
本说明书一个或多个实施例描述了处理交互序列数据的方法和装置,其中利用神经网络模型,考虑交互对象参与的交互事件以及交互事件中其他对象的影响,将交互对象处理为特征向量,从而有利于后续分析。
根据第一方面,提供了一种处理交互序列数据的方法,所述方法包括:
获取根据动态交互序列构建的动态交互图,其中,所述动态交互序列包括按照时间顺序排列的多个交互事件所对应的多个交互特征组,每个交互特征组包括,发生交互行为的第一对象,第二对象和交互时间;所述动态交互图包括代表各个交互特征组中的各个第一对象和第二对象的多个节点,所述多个节点包括第一节点,所述第一节点通过连接边指向两个叶节点,所述两个叶节点分别代表,所述第一节点对应的交互对象所参与的上一交互事件所对应的交互特征组中的两个对象;
在所述动态交互图中,确定与待分析的当前节点对应的当前序列,所述当前序列包括,从当前节点出发,经由连接边到达的预定范围内的多个节点,以及所述多个节点中各个节点在所述动态交互图中相对于所述当前节点的位置编码;
将所述当前序列输入基于Transformer的神经网络模型,所述神经网络模型包括嵌入层和至少一个注意力层,在所述嵌入层,基于所述当前序列中各个节点的节点特征及其位置编码,得到N个嵌入向量;在每个注意力层,基于从上一层获取的N个输入向量中各个输入向量之间的关联度,对各个输入向量进行综合,得到N个输出向量;所述神经网络模型基于所述至少一个注意力层得到的N个输出向量,确定所述当前节点对应的特征向量。
在一个实施例中,通过以下方式获取动态交互图:
获取基于已有交互序列构建的已有动态交互图;
获取新增交互事件对应的新增交互特征组;
将该新增交互特征组中包括的第一对象和第二对象作为两个新增节点,添加到所述已有动态交互图中;
对于每个新增节点,若其存在叶节点,则添加从该新增节点指向其两个叶节点的连接边。
在另一个实施例中,通过以下方式获取动态交互图:
获取基于已有交互序列构建的已有动态交互图;
获取新增交互序列,其中包括多个新增交互事件对应的多个新增交互特征组;
对于每个新增交互特征组,将其中的第一对象和第二对象作为两个新增节点,添加到所述已有动态交互图中;
对于每个新增节点,若其存在叶节点,则添加从该新增节点指向其两个叶节点的连接边。
在一个实施例中,当前节点是这样的节点:在所述动态交互图中,不存在指向该节点的连接边。
根据一种实施方式,所述预定范围内的节点包括:预设数目K的连接边之内的节点;和/或,交互时间在预设时间范围内的节点。
在一个实施例中,前述第一对象和第二对象分别是第一类对象和第二类对象,所述两个叶节点包括左节点和右节点,左节点对应于所述上一交互事件中的第一类对象,右节点对应于所述上一交互事件中的第二类对象。
在这样的情况下,位置编码可以包括,各节点相对于所述当前节点经过的连接边的数目,以及该节点是左节点或是右节点。
根据一种实施方式,每个交互特征组还包括,交互行为的行为特征;于是,当前序列中各个节点的节点特征可以包括,该节点所对应的交互对象的属性特征,以及该节点所在的交互特征组中的行为特征。
在一个实施例中,嵌入层如此得到N个嵌入向量:
对各个节点的节点特征分别进行嵌入处理,得到N个节点嵌入向量;
对各个节点的位置编码分别进行嵌入处理,得到N个位置嵌入向量;
对所述N个节点嵌入向量和N个位置嵌入向量进行综合,得到所述N个嵌入向量。
在一个实施例中,注意力层如此得到N个输出向量:
分别采用第一变换矩阵Q,第二变换矩阵K和第三变换矩阵V对所述N个输入向量中各个输入向量进行变换,得到各个输入向量对应的第一中间向量,第二中间向量和第三中间向量;
对于N个输入向量中任意的第i输入向量,基于该第i输入向量对应的第一中间向量与各个输入向量对应的各个第二中间向量的点乘操作,确定该第i输入向量与各个输入向量的各个关联度;
以该第i输入向量与各个输入向量的各个关联度作为权重因子,对所述各个输入向量对应的第三中间向量进行加权组合,得到该第i输入向量对应的第i组合向量;
基于各个输入向量对应的各个组合向量,得到所述N个输出向量。
进一步地,在一个实施例中,每个注意力层维护m套变换矩阵,每套变换矩阵包括所述第一变换矩阵Q、第二变换矩阵K和第三变换矩阵V,从而得到m个向量序列,每个向量序列包括基于一套变换矩阵得到的N个组合向量;注意力层于是还将所述m个向量序列进行拼接,得到拼接矩阵;通过第四变换矩阵对所述拼接矩阵进行变换,将变换得到的矩阵拆分为N个向量作为所述N个输出向量。
在一个实施例中,所述至少一个注意力层为多个注意力层,其中包括与所述嵌入层 连接的第一注意力层和后续注意力层,所述第一注意力层从所述嵌入层获取所述N个嵌入向量作为其N个输入向量,每个后续注意力层获取其上一注意力层得到的N个输出向量作为其N个输入向量。
进一步地,在多个注意力层的情况下,神经网络模型可以对多个注意力层中各个注意力层得到的N个输出向量进行综合,得到所述当前节点对应的特征向量。
在另一实施例中,神经网络模型还可以对多个注意力层中最后一个注意力层得到的N个输出向量进行综合,得到所述当前节点的特征向量。
根据一种实施方式,神经网络模型通过以下方式训练:
获取历史交互事件对应的历史特征组,其中包括第一样本对象和第二样本对象;
在所述动态交互图中,分别确定与所述第一样本对象对应的第一序列,和与所述第二样本对象对应的第二序列;
将所述第一序列和所述第二序列分别输入所述神经网络模型,分别得到与所述第一样本对象对应的第一特征向量和与第二样本对象对应的第二特征向量;
根据所述第一特征向量和第二特征向量,预测所述第一样本对象和第二样本对象是否会发生交互,得到预测结果;
根据所述预测结果,确定预测损失;
根据所述预测损失,更新所述神经网络模型。
根据另一实施方式,神经网络模型通过以下方式训练:
从所述动态交互序列中选择样本对象,并获取该样本对象的分类标签;
在所述动态交互图中,确定与该样本对象对应的样本序列;
将所述样本序列输入所述神经网络模型,得到所述样本对象的特征向量;
根据所述样本对象的特征向量,预测所述样本对象的分类,得到预测结果;
根据所述预测结果和所述分类标签,确定预测损失;
根据所述预测损失,更新所述神经网络模型。
根据第二方面,提供一种处理交互序列数据的装置,所述装置包括:
交互图获取单元,配置为获取根据动态交互序列构建的动态交互图,其中,所述动 态交互序列包括按照时间顺序排列的多个交互事件所对应的多个交互特征组,每个交互特征组包括,发生交互行为的第一对象,第二对象和交互时间;所述动态交互图包括代表各个交互特征组中的各个第一对象和第二对象的多个节点,所述多个节点包括第一节点,所述第一节点通过连接边指向两个叶节点,所述两个叶节点分别代表,所述第一节点对应的交互对象所参与的上一交互事件所对应的交互特征组中的两个对象;
序列确定单元,配置为在所述动态交互图中,确定与待分析的当前节点对应的当前序列,所述当前序列包括,从当前节点出发,经由连接边到达的预定范围内的多个节点,以及所述多个节点中各个节点在所述动态交互图中相对于所述当前节点的位置编码;
序列处理单元,配置为将所述当前序列输入基于Transformer的神经网络模型,所述神经网络模型包括嵌入层和至少一个注意力层,在所述嵌入层,基于所述当前序列中各个节点的节点特征及其位置编码,得到N个嵌入向量;在每个注意力层,基于从上一层获取的N个输入向量中各个输入向量之间的关联度,对各个输入向量进行综合,得到N个输出向量;所述神经网络模型基于所述至少一个注意力层得到的N个输出向量,确定所述当前节点对应的特征向量。
根据第三方面,提供了一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行第一方面的方法。
根据第四方面,提供了一种计算设备,包括存储器和处理器,其特征在于,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现第一方面的方法。
根据本说明书实施例提供的方法和装置,基于动态交互序列构建动态交互图,该动态交互图反映了各个交互事件的时序关系,以及交互对象之间通过各个交互事件传递的相互影响。利用预先训练的基于Transformer的神经网络模型,基于该动态交互图中与待分析交互对象相关的序列信息,可以提取得到该交互对象的特征向量。如此得到的特征向量中引入了各个交互事件中其他交互对象对其的影响,从而可以综合全面地表达该交互对象的深层特征。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其 它的附图。
图1A示出在一个例子中的交互关系二部图;
图1B示出在另一例子中的交互关系网络图;
图2示出根据一个实施例的实施场景示意图;
图3示出根据一个实施例的处理交互序列数据的方法流程图;
图4示出根据一个实施例的动态交互序列和由此构建的动态交互图;
图5示出在一个实施例中当前序列的示例;
图6示出在一个实施例中基于Transformer的神经网络模型的结构示意图;
图7为根据一个实施例的注意力层的操作示意图;
图8示出在一个实施例中训练神经网络模型的流程图;
图9示出在另一实施例中训练神经网络模型的流程图;
图10示出根据一个实施例的处理交互序列数据的装置的示意性框图。
具体实施方式
下面结合附图,对本说明书提供的方案进行描述。
如前所述,希望能够基于交互事件,对交互事件的参与方,即交互对象进行特征表达和建模。
在一种方案中,基于历史交互事件构建静态的交互关系网络图,从而基于该交互关系网络图,分析各个交互对象。具体地,可以以各个历史事件的参与者作为节点,在存在交互关系的节点之间建立连接边,从而形成上述交互网络图。
图1A和图1B分别示出在具体例子中的交互关系网络图。更具体而言,图1A示出一个二部图,其中包含用户节点(U1-U4)和商品节点(V1-V3),如果某个用户购买过某件商品,则在该用户和该商品之间构建一条连接边。图1B示出一个用户转账关系图,其中每个节点代表一个用户,发生过转账记录的两个用户之间存在连接边。
然而,可以看到,图1A和图1B尽管示出了对象之间的交互关系,但是没有包含这些交互事件的时序信息。简单地基于这样的交互关系网络图进行图嵌入,获得的特征向量也没有表达出交互事件的时序信息对节点的影响。并且,这样的静态图可扩展性不够 强,对于新增交互事件和新增节点的情况,难以灵活进行处理。
在另一方案中,对于各个待分析的交互对象,构建该对象的行为序列,基于该行为序列,提取该对象的特征表达。然而,这样的行为序列仅表征了待分析对象本身的行为,而交互事件是多方参与的事件,参与者之间会通过交互事件间接传递影响。因此,这样的方式没有表达出交互事件中的参与对象之间的影响。
综合考虑以上因素,根据本说明书的一个或多个实施例,将动态变化的交互事件序列构建成动态交互图,其中各个交互事件中涉及的各个交互对象对应于该动态交互图中的各个节点。对于待分析的交互对象,从该动态交互图中得到对应节点相关的序列,其中包含相关联的叶节点以及叶节点相对于待分析节点的位置编码,将该序列输入基于Transformer的神经网络模型,得到该交互对象的特征向量表达。
图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是交互时间。
根据本说明书的实施例,基于该动态交互序列构建动态交互图200。在图200中,将各个交互事件中的各个交互对象a i,b i用节点表示,并在包含同一对象的事件之间建立连接边。动态交互图200的结构将在后续进行更具体的描述。
对于某个待分析的交互对象,可以确定出其在动态交互图中对应的当前节点,并得到动态交互图中以该当前节点为根节点的节点序列数据。一般地,可以从该当前节点出发,选取经过一定数目的连接边可以达到的叶节点形成节点序列。此外,还获取各个叶节点相对于当前节点的位置编码,共同构成节点序列数据。该序列数据反映了,与当前交互对象直接或间接关联的交互事件中的其他对象对当前节点带来的影响。
然后,将上述节点序列数据输入到基于Transformer的神经网络模型,通过该模型,输出得到当前交互对象的特征向量。如此得到的特征向量,可以抽取出相关联的交互事件的时序信息和各交互事件中的交互对象之间的影响,从而更准确地表达当前交互对象的深层特征。这样的特征向量可以在后续应用于各种机器学习模型和各种业务场景。例如,可以基于如此得到的特征向量进行强化学习,也可以基于该特征向量进行聚类分析,例如,将用户聚类为人群。还可以基于这样的特征向量进行分类预测,例如,预测两个对象之间是否会发生交互(比如某个用户是否会购买某个商品),预测某个对象的业务 类型(比如某个用户的风险层级),等等。
下面描述以上构思的具体实现方式。
图3示出根据一个实施例的处理交互序列数据的方法流程图。可以理解,可以理解,该方法可以通过任何具有计算、处理能力的装置、设备、平台、设备集群来执行。下面结合具体实施例,对如图3所示的处理交互序列数据的方法中的各个步骤进行描述。
首先,在步骤31,获取根据动态交互序列构建的动态交互图。
如前所述,动态交互序列,例如表示为<E 1,E 2,…,E N>,可以包括按照时间顺序排列的多个交互事件,其中每个交互事件E i可以表示为一个交互特征组E i=(a i,b i,t i),其中a i和b i是事件E i的两个交互对象,t i是交互时间。如此,概括地说,动态交互序列包括按照时间顺序排列的多个交互事件对应的多个特征组(a i,b i,t i),每个交互特征组至少包括,发生交互行为的两个对象,例如称为第一对象和第二对象,以及交互时间。
在一个实施例中,根据交互事件的特点,发生交互的两个对象可以是不同类型的对象,例如称为第一类对象和第二类对象。例如,在电商平台中,交互事件可以是用户的购买行为,其中的第一对象可以是某个用户(第一类对象),第二对象可以是某个商品(第二类对象)。在另一例子中,交互事件可以是用户对页面区块的点击行为,其中的第一对象可以是用户(第一类对象),第二对象可以是某个页面区块(第二类对象)。
在另一些实施例中,交互事件涉及的两个对象可以是同类对象。例如,在即时通讯场景中,交互事件可以是两个用户之间进行了一次即时通讯。此时,第一对象和第二对象均为用户,属于同类对象。或者,在电子支付平台中,交互事件可以是两个用户之间的一次转账。此时,第一对象和第二对象均为电子支付平台的用户,属于同类对象。
在又一些实施例中,可以根据业务的需要,来设定是否区分两个交互对象的类型。例如,对于转账交互事件,在前述例子中,认为两个用户属于同类对象。在其他例子中,也可以根据业务需要,将金额转出方用户认为是第一类对象,将接收方用户认为是第二类对象。
进一步的,在一个实施例中,每个交互事件对应的交互特征组还可以包括行为特征f,如此,每个交互特征组可以表示为X i=(a i,b i,t i,f)。具体的,行为特征f可以包括交互行为发生的背景和上下文信息,交互行为的一些属性特征,等等。例如,在交互事件为用户点击事件的情况下,行为特征f可以包括,用户进行点击所使用的终端的类型,浏览器类型,app版本,等等。
对于以上所述的动态交互序列,可以构建动态交互图。具体的,将动态交互序列中各个特征组中的各个第一对象和第二对象分别作为动态交互图的节点。如此,一个节点可以对应到一个交互事件的特征组中的一个对象,但是同一物理对象可能对应到多个节点。例如,如果用户U1在t1时刻购买了商品M1,在t2时刻购买了商品M2,那么存在两个交互特征组(U1,M1,t1)和(U1,M2,t2),那么则根据这两个交互特征组分别为用户U1创建节点U1(t1),U1(t2)。因此可以认为,动态交互图中的节点对应于一个交互对象在一次交互事件中的状态。
对于动态交互图中的每个节点,按照以下方式确定叶节点并构建连接边。对于任意节点i,假定其对应于交互事件i(交互时间为t),那么在动态交互序列中,从交互事件i向前回溯,也就是向早于交互时间t的方向回溯,寻找第一个同样包含节点i代表的对象u的交互事件j(交互时间为t-,t-早于t),也就是,寻找对象u参与的上一交互事件j。将上一交互事件j的交互特征组中两个对象对应的两个节点作为上述节点i的两个叶节点,建立从节点i指向该两个叶节点的连接边。
下面结合具体例子进行描述。图4示出根据一个实施例的动态交互序列和由此构建的动态交互图。具体的,图4左侧示出按照时间顺序组织的动态交互序列,其中示例性示出分别在t 1,t 2,…,t 6时刻发生的交互事件E 1,E 2,…,E 6,每个交互事件的特征组包含交互涉及的两个交互对象,以及交互时间。图4右侧示出根据左侧的动态交互序列构建的动态交互图,其中,将各个交互事件中的两个交互对象分别作为节点。下面以节点A(t 6)为例,描述叶节点的确定和连接边的构建。
如图所示,该节点A(t 6)代表交互事件E 6中的一个交互对象A。于是,从交互事件E 6出发向前回溯,找到的上一个同样包含交互对象A的交互事件为E 4,也就是说,E 4是A参与的上一次交互事件,相应的,E 4对应的特征组中的两个节点即为A(t 6)的两个叶节点。于是,建立从节点A(t 6)指向E 4对应的两个节点A(t 4)和e(t 4)的连接边。类似的,从A(t 4)(对应于交互事件E 4)继续向前回溯,可以继续找到对象A参与的上一次交互事件E 1,于是建立从A(t 4)指向E 1对应的两个节点的连接边;从e(t 4)向前回溯,可以找到对象e参与的上一次交互事件E 2,于是,建立从e(t 4)指向E 2对应的两个节点的连接边。如此,确定节点之间的依赖关系,在节点之间构建连接边,从而形成图4的动态交互图。
需要说明的是,在图4的例子中,各个交互事件中的第一对象和第二对象为不同类型的对象,通过大小写进行区分,即大写字母表示第一类对象,小写字母表示第二类对 象。在组织交互事件的特征组时,按照<第一类对象,第二类对象,交互时间>的方式排布。相应地,在形成动态交互图时,同样地区分对象类型,将同一交互事件中第一类对象对应的节点排布在左侧,将第二类对象对应的节点排布在右侧。如此,如果某个节点存在两个叶节点,这两个叶节点包括左节点和右节点,那么左节点对应于第一类对象,右节点对应于第二类对象。
在不需区分对象类型的情况下,在交互特征组以及动态交互图中两个交互对象可以以任意顺序排布。
以上描述了基于动态交互序列构建动态交互图的方式和过程。对于图3所示的处理交互对象的方法而言,构建动态交互图的过程可以预先进行也可以现场进行。相应地,在一个实施例中,在步骤31,根据动态交互序列现场构建动态交互图。构建方式如以上所述。在另一实施例中,可以预先基于动态交互序列构建形成动态交互图。在步骤31,读取或接收已形成的动态交互图。
可以理解,按照以上方式构建的动态交互图具有很强的可扩展性,可以非常容易地根据新增的交互事件进行动态更新。相应地,步骤31还可以包括更新动态交互图的过程。
在一个实施例中,每当检测到新的交互事件,就基于该新的交互事件更新动态交互图。具体的,在该实施方式下,可以获取基于已有交互序列构建的已有动态交互图,并获取新增交互事件所对应的特征组,即新增特征组。然后,将该新增交互特征组中包括的第一对象和第二对象作为两个新增节点,添加到已有动态交互图中。并且,对于每个新增节点,确定其是否存在叶节点,如果存在,则添加从该新增节点指向其两个叶节点的连接边,如此形成更新的动态交互图。
在另一实施例中,可以每过预定时间间隔,例如每隔一个小时,检测新增的交互事件,将该时间间隔内新增的多个交互事件形成新增交互序列。或者,每当检测到预定数目(例如,100个)的新增交互事件,将该预定数目的新增交互事件形成新增交互序列。然后基于该新增交互序列更新动态交互图。
具体的,在该实施方式下,可以获取基于已有交互序列构建的已有动态交互图,并获取如上所述的新增交互序列,其中包括多个新增交互特征组。然后,对于每个新增交互特征组,将其中的第一对象和第二对象作为两个新增节点,添加到所述已有动态交互图中。并且,对于每个新增节点,确定其是否存在叶节点,如果存在,则添加从该新增 节点指向其两个叶节点的连接边,如此形成更新的动态交互图。
综合以上,在步骤31,获取到基于动态交互序列构建的动态交互图。接着,在步骤32,在获取的动态交互图中,确定与待分析的当前节点对应的当前序列,所述当前序列包括,从当前节点出发,经由连接边到达的预定范围内的多个节点,以及所述多个节点中各个节点在所述动态交互图中相对于所述当前节点的位置编码。
当前节点是与待分析的交互对象对应的节点。然而如前所述,一个交互对象可以对应多个节点,表达该交互对象在不同时刻的不同交互事件中的状态。为了表达出待分析的交互对象的最新状态,在一个实施例中,选择这样的节点作为当前节点,即在动态交互图中,不存在指向该节点的连接边。也就是说,选择待分析对象所参与的最新一次交互事件对应的节点作为当前节点。例如,在图4所示的动态交互图中,当想要分析交互对象A时,可以选择节点A(t 6)作为当前节点。然而,这并不是必须的。在其他实施例中,例如为了训练的目的,也可以选择其他节点作为当前节点,例如,为了分析对象A,也可以选择节点A(t 5)作为当前节点。
可以将当前节点作为根节点,从该根节点出发,获取在预定范围内经由连接边依次到达的各个节点,并确定这些节点相对于根节点的位置编码,将上述预定范围内的各个节点及其位置编码的组合依次排列,构成当前节点对应的当前序列。
在一个实施例中,上述预定范围内的节点可以是,至多经过预设数目K的连接边可达的节点。这里数目K为预设的超参数,可以根据业务情况选取。可以理解,该预设数目K体现了,在表达当前节点的信息时,向前回溯的历史交互事件的步数。数目K越大,则考虑越久的历史交互信息。
在另一实施例中,上述预定范围内的节点还可以是,交互时间在预定时间范围内的节点。例如,从当前节点的交互时间向前回溯T时长(例如一天),在该时长范围内、且可通过连接边达到的节点。
在又一实施例中,上述预定范围既考虑连接边的数目,又考虑时间范围。换而言之,该预定范围内的节点是指,至多经过预设数目K的连接边可达、且交互时间在预定时间范围内的节点。
在获取上述预定范围内的节点时,在一个实施例中,沿着连接边,按照宽度优先的原则进行遍历。在另一实施例中,按照深度优先的原则进行遍历。或者,在其他实施例中,可以根据其他拓扑排序的方式进行遍历。
对于遍历得到的上述预定范围内的每个节点,确定该节点相对于根节点的位置编码。在一个实施例中,上述位置编码可以包括,该节点相对于根节点所经过的连接边的数目,或称为阶数。
在一个实施例中,如前所述,动态交互图中的各个交互对象被划分为第一类对象和第二类对象,第一类对象排布在同一交互事件的两个节点的左侧,作为左节点,第二类对象排布在上述两个节点的右侧,作为右节点。在这样的情况下,上述位置编码还进一步包括,节点是左节点或是右节点。
图5示出在一个实施例中当前序列的示例。在图5的例子中,假定分别以图4中的A(t 6)和b(t 6)为当前节点,并假定预定范围是一定的时间范围,即从当前节点的交互时刻向前回溯至最早到t2时刻。图5中的虚线框示出落入上述预定时间范围的节点。
以A(t 6)为根节点,沿着连接边进行遍历,可以得到预定范围内通过连接边可达的节点包括A(t 6),A(t 4),e(t 4),D(t 2),e(t 2)。在这些节点下方分别示出其位置编码,位置编码示出为L/Rn的形式,其中L/R示出该节点是左节点或是右节点,n表示距离根节点经过的连接边的数目。例如,节点D(t 2)的位置编码L2,表示该节点是左节点,经过2条连接边连接到根节点。依次排列的各个节点及其位置编码的组合,构成当前节点对应的当前序列。图5右侧分别示出以A(t 6)为当前节点得到的序列1,和以b(t 6)为当前节点得到的序列2。其他节点对应的序列也可以类似得出。
接着,在步骤33,将当前序列输入基于Transformer的神经网络模型,通过该模型对当前序列进行处理,得到当前节点对应的特征向量。
如本领域技术人员所了解,Transformer模型多用于执行自然语言处理NLP任务。Transformer模型的核心特点在于其采用的独特的注意力机制。在处理自然语言,例如一个句子时,Transformer模型利用该注意力机制,为句子中各个词向量赋予不同的注意力系数,从而更全面地考虑句子中上下文对各个词的影响。借鉴Transformer模型对句子对应的词序列的处理方式,在本说明书的实施例中,利用Transformer模型处理针对当前节点从动态交互图得到的当前序列。
图6示出在一个实施例中基于Transformer的神经网络模型的结构示意图。如图6所示,该神经网络模型600包括嵌入层61和注意力层62和63。嵌入层61基于当前序列中各个节点的节点特征及其位置编码,得到N个嵌入向量。注意力层62与嵌入层 61相连,从嵌入层获取N个嵌入向量作为输入向量,基于N个输入向量中各个输入向量之间的关联度,对各个输入向量进行综合,得到N个输出向量,输出给后续的注意力层63。注意力层63获取前一层的输出作为输入向量,执行与注意力层62类似的操作。
需要理解,图6的结构仅仅是一个示例,注意力层的数目可以根据需要而设置。例如,可以仅设置一个注意力层,也可以设置更多的注意力层。神经网络模型基于各注意力层得到的N个输出向量,确定当前节点对应的特征向量。
下面描述各个层的具体工作过程。
首先,嵌入层61获取当前节点对应的当前序列。如前所述,当前序列包括从当前节点出发,经由连接边可达的预定范围的多个节点,以及各个节点的位置编码。可以理解,对于不同的当前节点,当前序列长度可能并不一致,如图5的示例所示。为此,可以预设一较长的长度N。如果当前序列的实际长度不足N,则采用缺省值填补(padding)的方式将其补足。经过填补处理,可以认为,当前序列长度为N,也就是,包括N个节点,以及对应的N个位置编码。于是,嵌入层61可以对各个节点的节点特征和位置编码分别进行嵌入,再将其综合,得到初步的嵌入向量。
具体地,嵌入层可以对N个节点中各个节点的节点特征分别进行嵌入处理,得到N个节点嵌入向量。在节点表示用户的情况下,节点特征可以包括用户的属性特征,例如年龄、职业、教育程度、所在地区,等等;在节点表示商品的情况下,节点特征可以包括商品的属性特征,例如商品类别、上架时间、销量等等。在节点表示其他交互对象的情况下,可以相应的获取到原始的节点特征。在交互特征组中还包括行为特征f的情况下,也可以在节点特征中包含对应特征组中的行为特征f。
另外,嵌入层还对N个节点对应的N个位置编码分别进行嵌入处理,得到N个位置嵌入向量。
然后,对N个节点嵌入向量和N个位置嵌入向量进行综合,例如可以采用直接相加,加权组合等方式,如此得到N个嵌入向量<A 1,A 2,…,A N>。
下面描述注意力层的操作过程。注意力层从其上一层获取N个输入向量<X 1,X 2,…,X N>,又可以表示为矩阵X,采用自注意力机制,基于向量间的关联度对各个向量进行变换,得到N个输出向量<Y 1,Y 2,…,Y N>,又可以表示为矩阵Y。可以理解,当该注意力层是与嵌入层直接相连的层,例如图6中的注意力层62,其获取的输入向量即为嵌入向量<A 1,A 2,…,A N>;当该注意力层是后续的注意力层,例如图6中的注意力层 63,其获取的输入向量即为前一注意力层的输出向量<Y 1,Y 2,…,Y N>。
图7为根据一个实施例的注意力层的操作示意图,该示意图示出注意力层如何将输入矩阵X变换为输出矩阵Y。
如图所示,分别采用第一变换矩阵Q,第二变换矩阵K和第三变换矩阵V对N个输入向量<X 1,X 2,…,X N>中各个输入向量X i进行变换,得到各个输入向量对应的第一中间向量(q向量),第二中间向量(k向量)和第三中间向量(v向量)。操作上,可以分别用第一变换矩阵Q,第二变换矩阵K和第三变换矩阵V,对N个输入向量构成的输入矩阵X进行线性变换,分别得到输入矩阵的Q矩阵,K矩阵和V矩阵,再分别对矩阵进行拆分,即可得到各个输入向量对应的q向量,k向量和v向量。
对于N个输入向量中任意的第i输入向量X i,基于该第i输入向量对应的第一中间向量(q向量,q i)与各个输入向量X j对应的各个第二中间向量(k向量,k j)的点乘操作,确定该第i输入向量X i与各个输入向量X j的各个关联度。
尽管也可以直接将q i与k j的点乘结果确定为关联度,但是更经典地,先将点乘结果除以一常数,然后进行softmax运算,将运算结果作为输入向量X i与X j的关联度,即:
Figure PCTCN2020072042-appb-000001
于是,可以以该第i输入向量X i与各个输入向量X j的各个关联度α i,j作为权重因子,对各个输入向量X j对应的第三中间向量(v向量,v j)进行加权组合,得到该第i输入向量X i对应的第i组合向量C i
Figure PCTCN2020072042-appb-000002
于是,可以得到N个输入向量对应的N个组合向量的向量序列<C 1,C 2,…,C N>,或矩阵C。基于该组合向量序列,可以得到N个输出向量。
具体地,在一个实施例中,可以直接将N个组合向量的向量序列作为N个输出向量,即Y i=C i。此时,输出矩阵Y即为组合向量矩阵C,又可以写成:
Figure PCTCN2020072042-appb-000003
在另一实施例中,注意力层采用“多头”注意力机制(Multi head attention),即注意力层维护m套变换矩阵,每套变换矩阵包括前述第一变换矩阵Q、第二变换矩阵K 和第三变换矩阵V,从而可以并行地进行上述操作,得到m个组合向量序列(即m个矩阵C),每个向量序列包括基于一套变换矩阵得到的N个组合向量。
在这样的情况下,注意力层将得到的m个组合向量序列进行拼接,得到拼接矩阵;再通过第四变换矩阵W对该拼接矩阵进行变换,得到最终的输出矩阵Y。将该输出矩阵Y拆分即对应于N个输出向量<Y 1,Y 2,…,Y N>。
通过以上的操作过程,注意力层基于N个输入向量之间的关联度进行变换操作,得到N个输出向量。
如前所述,神经网络模型可以包含多个注意力层。在一个实施例中,上述多个注意力层可以采用残差网络的方式堆叠连接,形成神经网络模型。
在多个注意力层的情况下,在一个实施例中,神经网络模型可以对多个注意力层中各个注意力层得到的N个输出向量进行综合,得到当前节点对应的特征向量。在另一实施例中,神经网络模型也可以仅提取最后一个注意力层得到的N个输出向量,对这N个输出向量进行综合,得到当前节点的特征向量。
如此,通过多种方式,神经网络模型基于与待分析的当前节点对应的当前序列,得到当前节点的特征向量。由于当前序列中包含了与当前节点有关的各阶叶节点,以及这些叶节点相对于当前节点的位置,这些信息共同反映了与当前节点对应的交互对象有关的时序性交互历史,因此,如此得到的当前节点的特征向量,不仅表达出交互对象本身的特征,还可以表达出交互对象在历次交互事件中所受到的影响,从而全面表征交互对象的特点。
可以理解,神经网络模型在确定当前节点的特征向量的计算过程中,依赖于大量的参数,例如前述各个变换矩阵(Q矩阵,K矩阵,V矩阵,等等)中的参数。这些参数需要通过对该神经网络模型进行训练而确定。在不同实施例中,可以通过不同的任务,训练该神经网络模型。
在一个实施例中,通过预测交互行为来训练神经网络模型。图8示出在该实施例中训练神经网络模型的流程图。如图8所示,在步骤81,获取历史交互事件对应的历史特征组,该历史特征组是确已发生的历史交互事件对应的特征组。在一个具体例子中,可以从前述动态交互序列中获取历史交互特征组。将该历史交互特征组中包括的两个对象称为第一样本对象和第二样本对象。
在步骤82,在动态交互图中,分别确定与第一样本对象对应的第一序列,和与 第二样本对象对应的第二序列。具体的,在动态交互图中分别确定出与第一样本对象对应的第一节点和与第二样本对象对应的第二节点,分别以第一节点和第二节点作为当前节点,按照图3的步骤32类似的方式,确定出对应的第一序列和第二序列。
然后,在步骤83,将上述第一序列和第二序列分别输入神经网络模型,分别得到与第一样本对象对应的第一特征向量,和与第二样本对象对应的第二特征向量。神经网络模型基于序列中的节点及其位置编码确定对应样本对象的特征向量的具体过程如前结合步骤33所述,不再赘述。
接着,在步骤84,根据第一特征向量和第二特征向量,预测第一样本对象和第二样本对象是否会发生交互,得到预测结果。通常,可以采用一个二分类的分类器,预测两个样本对象是否会发生交互,得到的预测结果通常表现为,这两个样本对象发生交互的概率。
于是,在步骤85,根据上述预测结果,确定预测损失。可以理解,上述第一样本对象和第二样本对象来自历史交互事件的特征组,因此实际上已经发生交互,这相当于已知这两个样本对象之间的关系标签。根据例如交叉熵计算方式等损失函数形式,可以基于上述预测结果确定出本次预测的损失。
然后,在步骤86,根据预测损失,更新神经网络模型。具体的,可以采用梯度下降、反向传播等方式,调整神经网络中的参数,以更新神经网络模型,直到神经网络模型的预测准确率达到一定要求。
以上采用历史交互事件中的两个样本对象来进行对象关系的预测,相当于利用了正样本进行训练。在一个实施例中,还可以在动态交互图中找到未发生交互关系的两个样本对象作为负样本进行进一步训练,从而达到更好的训练效果。
根据另一实施方式,通过预测交互对象的分类来训练神经网络模型。图9示出该实施例中训练神经网络模型的流程图。如图9所示,在步骤91,从动态交互序列中选择样本对象,并获取该样本对象的分类标签。该样本对象可以是动态交互序列包含的任意特征组中的任意交互对象,针对该样本对象的分类标签可以是与业务场景相关的标签。例如,在样本对象是用户的情况下,分类标签可以是预先设定的人群分类的标签,或用户风险程度分类的标签;在样本对象是商品的情况下,分类标签可以是商品分类的标签。这样的标签可以由人工标注产生,或通过其他业务相关处理而产生。
在步骤92,在动态交互图中,确定与该样本对象对应的样本序列。具体的,可 以在动态交互图中确定出与该样本对象对应的节点,以该节点作为当前节点,按照图3的步骤32类似的方式,确定出对应的样本序列。
然后,在步骤93,将上述样本序列输入神经网络模型,得到样本对象的特征向量。该过程如前结合步骤33所述,不再赘述。
接着,在步骤94,根据样本对象的特征向量,预测该样本对象的分类,得到预测结果。可以采用分类器,预测样本对象属于各个分类的各个概率,作为预测结果。
然后,在步骤95,根据预测结果和分类标签,确定预测损失。具体的,可以采用例如交叉熵计算方式,可以预测结果中的各个概率和分类标签,确定出本次预测的损失。
在步骤96,根据预测损失,更新神经网络模型。如此,通过预测样本对象分类的任务,训练神经网络模型。
综合以上,在本说明书实施例的方案中,基于动态交互序列构建动态交互图,该动态交互图反映了各个交互事件的时序关系,以及交互对象之间通过各个交互事件传递的相互影响。利用训练的神经网络模型,基于该动态交互图中与待分析交互对象相关的节点序列,可以提取得到该交互对象的特征向量。如此得到的特征向量中引入了各个交互事件中其他交互对象对其的影响,从而可以综合全面地表达该交互对象的深层特征。
根据另一方面的实施例,提供了一种处理交互序列数据的装置,该装置可以部署在任何具有计算、处理能力的设备、平台或设备集群中。图10示出根据一个实施例的处理交互序列数据的装置的示意性框图。如图10所示,该处理装置100包括:
交互图获取单元101,配置为获取根据动态交互序列构建的动态交互图,其中,所述动态交互序列包括按照时间顺序排列的多个交互事件所对应的多个交互特征组,每个交互特征组包括,发生交互行为的第一对象,第二对象和交互时间;所述动态交互图包括代表各个交互特征组中的各个第一对象和第二对象的多个节点,所述多个节点包括第一节点,所述第一节点通过连接边指向两个叶节点,所述两个叶节点分别代表,所述第一节点对应的交互对象所参与的上一交互事件所对应的交互特征组中的两个对象;
序列确定单元102,配置为在所述动态交互图中,确定与待分析的当前节点对应的当前序列,所述当前序列包括,从当前节点出发,经由连接边到达的预定范围内的多个节点,以及所述多个节点中各个节点在所述动态交互图中相对于所述当前节点的位置编码;
序列处理单元103,配置为将所述当前序列输入基于Transformer的神经网络模型,所述神经网络模型包括嵌入层和至少一个注意力层,在所述嵌入层,基于所述当前序列中各个节点的节点特征及其位置编码,得到N个嵌入向量;在每个注意力层,基于从上一层获取的N个输入向量中各个输入向量之间的关联度,对各个输入向量进行综合,得到N个输出向量;所述神经网络模型基于所述至少一个注意力层得到的N个输出向量,确定所述当前节点对应的特征向量。
在一个实施例中,所述交互图获取单元101配置为:
获取基于已有交互序列构建的已有动态交互图;
获取新增交互事件对应的新增交互特征组;
将该新增交互特征组中包括的第一对象和第二对象作为两个新增节点,添加到所述已有动态交互图中;
对于每个新增节点,若其存在叶节点,则添加从该新增节点指向其两个叶节点的连接边。
在另一实施例中,所述交互图获取单元101配置为:
获取基于已有交互序列构建的已有动态交互图;
获取新增交互序列,其中包括多个新增交互事件对应的多个新增交互特征组;
对于每个新增交互特征组,将其中的第一对象和第二对象作为两个新增节点,添加到所述已有动态交互图中;
对于每个新增节点,若其存在叶节点,则添加从该新增节点指向其两个叶节点的连接边。
根据一种实施方式,前述当前节点是这样的节点:在所述动态交互图中,不存在指向该节点的连接边。
根据不同实施例,所述预定范围内的节点可以是,预设数目K的连接边之内的节点;和/或,交互时间在预设时间范围内的节点。
在一个实施例中,特征组中的第一对象和第二对象分别是第一类对象和第二类对象,所述两个叶节点包括左节点和右节点,左节点对应于所述上一交互事件中的第一类对象,右节点对应于所述上一交互事件中的第二类对象。
在这样的情况下,位置编码可以包括,各节点相对于所述当前节点经过的连接边的数目,以及该节点是左节点或是右节点。
在一个实施例中,每个交互特征组还包括,交互行为的行为特征;在这样的情况下,所述当前序列中各个节点的节点特征包括,该节点所对应的交互对象的属性特征,以及该节点所在的交互特征组中的行为特征。
在一个实施例中,序列处理单元103所利用的神经网络模型中的嵌入层具体用于:
对各个节点的节点特征分别进行嵌入处理,得到N个节点嵌入向量;
对各个节点的位置编码分别进行嵌入处理,得到N个位置嵌入向量;
对所述N个节点嵌入向量和N个位置嵌入向量进行综合,得到所述N个嵌入向量。
根据一种实施方式,序列处理单元103所利用的神经网络模型中的每个注意力层用于:
分别采用第一变换矩阵Q,第二变换矩阵K和第三变换矩阵V对所述N个输入向量中各个输入向量进行变换,得到各个输入向量对应的第一中间向量,第二中间向量和第三中间向量;
对于N个输入向量中任意的第i输入向量,基于该第i输入向量对应的第一中间向量与各个输入向量对应的各个第二中间向量的点乘操作,确定该第i输入向量与各个输入向量的各个关联度;
以该第i输入向量与各个输入向量的各个关联度作为权重因子,对所述各个输入向量对应的第三中间向量进行加权组合,得到该第i输入向量对应的第i组合向量;
基于各个输入向量对应的各个组合向量,得到所述N个输出向量。
进一步的,在一个实施例中,每个注意力层维护m套变换矩阵,每套变换矩阵包括所述第一变换矩阵Q、第二变换矩阵K和第三变换矩阵V,从而得到m个向量序列,每个向量序列包括基于一套变换矩阵得到的N个组合向量;
所述每个注意力层还用于:
将所述m个向量序列进行拼接,得到拼接矩阵;
通过第四变换矩阵对所述拼接矩阵进行变换,将变换得到的矩阵拆分为N个向量作为所述N个输出向量。
根据一种实施方式,所述至少一个注意力层为多个注意力层,其中包括与所述嵌入层连接的第一注意力层和后续注意力层,所述第一注意力层从所述嵌入层获取所述N个嵌入向量作为其N个输入向量,每个后续注意力层获取其上一注意力层得到的N个输出向量作为其N个输入向量。
在这样的情况下,在一个实施例中,所述神经网络模型对所述多个注意力层中各个注意力层得到的N个输出向量进行综合,得到所述当前节点对应的特征向量。
在另一实施例中,所述神经网络模型对所述多个注意力层中最后一个注意力层得到的N个输出向量进行综合,得到所述当前节点的特征向量。
根据一种实施方式,神经网络模型通过模型训练单元104训练。模型训练单元104可以包含在装置100之中,也可以位于其之外。模型训练单元104可以包括(未示出):
样本获取模块,配置为获取历史交互事件对应的历史特征组,其中包括第一样本对象和第二样本对象;
序列确定模块,配置为在所述动态交互图中,分别确定与所述第一样本对象对应的第一序列,和与所述第二样本对象对应的第二序列;
向量获取模块,配置为将所述第一序列和所述第二序列分别输入所述神经网络模型,分别得到与所述第一样本对象对应的第一特征向量和与第二样本对象对应的第二特征向量;
预测模块,配置为根据所述第一特征向量和第二特征向量,预测所述第一样本对象和第二样本对象是否会发生交互,得到预测结果;
损失确定模块,配置为根据所述预测结果,确定预测损失;
更新模块,配置为根据所述预测损失,更新所述神经网络模型。
在另一实施例中,模型训练单元104可以包括(未示出):
样本获取模块,配置为从所述动态交互序列中选择样本对象,并获取该样本对象的分类标签;
序列确定模块,配置为在所述动态交互图中,确定与该样本对象对应的样本序 列;
向量获取模块,配置为将所述样本序列输入所述神经网络模型,得到所述样本对象的特征向量;
预测模块,配置为根据所述样本对象的特征向量,预测所述样本对象的分类,得到预测结果;
损失确定模块,配置为根据所述预测结果和所述分类标签,确定预测损失;
更新模块,配置为根据所述预测损失,更新所述神经网络模型。
通过以上装置,基于动态交互图,采用基于Transformer的神经网络模型处理交互对象,得到适于后续分析的特征向量。
根据另一方面的实施例,还提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行结合图3所描述的方法。
根据再一方面的实施例,还提供一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现结合图3所述的方法。
本领域技术人员应该可以意识到,在上述一个或多个示例中,本发明所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本发明的保护范围之内。

Claims (34)

  1. 一种处理交互序列数据的方法,所述方法包括:
    获取根据动态交互序列构建的动态交互图,其中,所述动态交互序列包括按照时间顺序排列的多个交互事件所对应的多个交互特征组,每个交互特征组包括,发生交互行为的第一对象,第二对象和交互时间;所述动态交互图包括代表各个交互特征组中的各个第一对象和第二对象的多个节点,所述多个节点包括第一节点,所述第一节点通过连接边指向两个叶节点,所述两个叶节点分别代表,所述第一节点对应的交互对象所参与的上一交互事件所对应的交互特征组中的两个对象;
    在所述动态交互图中,确定与待分析的当前节点对应的当前序列,所述当前序列包括,从当前节点出发,经由连接边到达的预定范围内的多个节点,以及所述多个节点中各个节点在所述动态交互图中相对于所述当前节点的位置编码;
    将所述当前序列输入基于Transformer的神经网络模型,所述神经网络模型包括嵌入层和至少一个注意力层,在所述嵌入层,基于所述当前序列中各个节点的节点特征及其位置编码,得到N个嵌入向量;在每个注意力层,基于从上一层获取的N个输入向量中各个输入向量之间的关联度,对各个输入向量进行综合,得到N个输出向量;所述神经网络模型基于所述至少一个注意力层得到的N个输出向量,确定所述当前节点对应的特征向量。
  2. 根据权利要求1所述的方法,其中,所述获取根据动态交互序列构建的动态交互图包括:
    获取基于已有交互序列构建的已有动态交互图;
    获取新增交互事件对应的新增交互特征组;
    将该新增交互特征组中包括的第一对象和第二对象作为两个新增节点,添加到所述已有动态交互图中;
    对于每个新增节点,若其存在叶节点,则添加从该新增节点指向其两个叶节点的连接边。
  3. 根据权利要求1所述的方法,其中,所述获取根据动态交互序列构建的动态交互图包括:
    获取基于已有交互序列构建的已有动态交互图;
    获取新增交互序列,其中包括多个新增交互事件对应的多个新增交互特征组;
    对于每个新增交互特征组,将其中的第一对象和第二对象作为两个新增节点,添加到所述已有动态交互图中;
    对于每个新增节点,若其存在叶节点,则添加从该新增节点指向其两个叶节点的连接边。
  4. 根据权利要求1所述的方法,其中,所述当前节点是这样的节点:在所述动态交互图中,不存在指向该节点的连接边。
  5. 根据权利要求1所述的方法,其中,所述预定范围内的节点包括:
    预设数目K的连接边之内的节点;和/或
    交互时间在预设时间范围内的节点。
  6. 根据权利要求1所述的方法,其中,所述第一对象和第二对象分别是第一类对象和第二类对象,所述两个叶节点包括左节点和右节点,左节点对应于所述上一交互事件中的第一类对象,右节点对应于所述上一交互事件中的第二类对象。
  7. 根据权利要求6所述的方法,其中,所述位置编码包括,各节点相对于所述当前节点经过的连接边的数目,以及该节点是左节点或是右节点。
  8. 根据权利要求1所述的方法,其中,所述每个交互特征组还包括,交互行为的行为特征;
    所述当前序列中各个节点的节点特征包括,该节点所对应的交互对象的属性特征,以及该节点所在的交互特征组中的行为特征。
  9. 根据权利要求1所述的方法,其中,所述基于所述当前序列中各个节点的节点特征及其位置编码,得到N个嵌入向量包括:
    对各个节点的节点特征分别进行嵌入处理,得到N个节点嵌入向量;
    对各个节点的位置编码分别进行嵌入处理,得到N个位置嵌入向量;
    对所述N个节点嵌入向量和N个位置嵌入向量进行综合,得到所述N个嵌入向量。
  10. 根据权利要求1所述的方法,其中,基于从上一层获取的N个输入向量中各个输入向量之间的关联度,对各个输入向量进行综合,得到N个输出向量,包括:
    分别采用第一变换矩阵Q,第二变换矩阵K和第三变换矩阵V对所述N个输入向量中各个输入向量进行变换,得到各个输入向量对应的第一中间向量,第二中间向量和第三中间向量;
    对于N个输入向量中任意的第i输入向量,基于该第i输入向量对应的第一中间向量与各个输入向量对应的各个第二中间向量的点乘操作,确定该第i输入向量与各个输入向量的各个关联度;
    以该第i输入向量与各个输入向量的各个关联度作为权重因子,对所述各个输入向量对应的第三中间向量进行加权组合,得到该第i输入向量对应的第i组合向量;
    基于各个输入向量对应的各个组合向量,得到所述N个输出向量。
  11. 根据权利要求10所述的方法,其中,所述每个注意力层维护m套变换矩阵,每套变换矩阵包括所述第一变换矩阵Q、第二变换矩阵K和第三变换矩阵V,从而得到m个向量序列,每个向量序列包括基于一套变换矩阵得到的N个组合向量;
    所述基于各个输入向量对应的各个组合向量,得到所述N个输出向量包括:
    将所述m个向量序列进行拼接,得到拼接矩阵;
    通过第四变换矩阵对所述拼接矩阵进行变换,将变换得到的矩阵拆分为N个向量作为所述N个输出向量。
  12. 根据权利要求1所述的方法,其中,所述至少一个注意力层为多个注意力层,其中包括与所述嵌入层连接的第一注意力层和后续注意力层,所述第一注意力层从所述嵌入层获取所述N个嵌入向量作为其N个输入向量,每个后续注意力层获取其上一注意力层得到的N个输出向量作为其N个输入向量。
  13. 根据权利要求12所述的方法,其中,所述神经网络模型对所述多个注意力层中各个注意力层得到的N个输出向量进行综合,得到所述当前节点对应的特征向量。
  14. 根据权利要求12所述的方法,其中,所述神经网络模型对所述多个注意力层中最后一个注意力层得到的N个输出向量进行综合,得到所述当前节点的特征向量。
  15. 根据权利要求1所述的方法,其中,所述神经网络模型通过以下方式训练:
    获取历史交互事件对应的历史特征组,其中包括第一样本对象和第二样本对象;
    在所述动态交互图中,分别确定与所述第一样本对象对应的第一序列,和与所述第二样本对象对应的第二序列;
    将所述第一序列和所述第二序列分别输入所述神经网络模型,分别得到与所述第一样本对象对应的第一特征向量和与第二样本对象对应的第二特征向量;
    根据所述第一特征向量和第二特征向量,预测所述第一样本对象和第二样本对象是否会发生交互,得到预测结果;
    根据所述预测结果,确定预测损失;
    根据所述预测损失,更新所述神经网络模型。
  16. 根据权利要求1所述的方法,其中,所述神经网络模型通过以下方式训练:
    从所述动态交互序列中选择样本对象,并获取该样本对象的分类标签;
    在所述动态交互图中,确定与该样本对象对应的样本序列;
    将所述样本序列输入所述神经网络模型,得到所述样本对象的特征向量;
    根据所述样本对象的特征向量,预测所述样本对象的分类,得到预测结果;
    根据所述预测结果和所述分类标签,确定预测损失;
    根据所述预测损失,更新所述神经网络模型。
  17. 一种处理交互序列数据的装置,所述装置包括:
    交互图获取单元,配置为获取根据动态交互序列构建的动态交互图,其中,所述动态交互序列包括按照时间顺序排列的多个交互事件所对应的多个交互特征组,每个交互特征组包括,发生交互行为的第一对象,第二对象和交互时间;所述动态交互图包括代表各个交互特征组中的各个第一对象和第二对象的多个节点,所述多个节点包括第一节点,所述第一节点通过连接边指向两个叶节点,所述两个叶节点分别代表,所述第一节点对应的交互对象所参与的上一交互事件所对应的交互特征组中的两个对象;
    序列确定单元,配置为在所述动态交互图中,确定与待分析的当前节点对应的当前序列,所述当前序列包括,从当前节点出发,经由连接边到达的预定范围内的多个节点,以及所述多个节点中各个节点在所述动态交互图中相对于所述当前节点的位置编码;
    序列处理单元,配置为将所述当前序列输入基于Transformer的神经网络模型,所述神经网络模型包括嵌入层和至少一个注意力层,在所述嵌入层,基于所述当前序列中各个节点的节点特征及其位置编码,得到N个嵌入向量;在每个注意力层,基于从上一层获取的N个输入向量中各个输入向量之间的关联度,对各个输入向量进行综合,得到N个输出向量;所述神经网络模型基于所述至少一个注意力层得到的N个输出向量,确定所述当前节点对应的特征向量。
  18. 根据权利要求17所述的装置,其中,所述交互图获取单元配置为:
    获取基于已有交互序列构建的已有动态交互图;
    获取新增交互事件对应的新增交互特征组;
    将该新增交互特征组中包括的第一对象和第二对象作为两个新增节点,添加到所述已有动态交互图中;
    对于每个新增节点,若其存在叶节点,则添加从该新增节点指向其两个叶节点的连接边。
  19. 根据权利要求17所述的装置,其中,所述交互图获取单元配置为:
    获取基于已有交互序列构建的已有动态交互图;
    获取新增交互序列,其中包括多个新增交互事件对应的多个新增交互特征组;
    对于每个新增交互特征组,将其中的第一对象和第二对象作为两个新增节点,添加到所述已有动态交互图中;
    对于每个新增节点,若其存在叶节点,则添加从该新增节点指向其两个叶节点的连接边。
  20. 根据权利要求17所述的装置,其中,所述当前节点是这样的节点:在所述动态交互图中,不存在指向该节点的连接边。
  21. 根据权利要求17所述的装置,其中,所述预定范围内的节点包括:
    预设数目K的连接边之内的节点;和/或
    交互时间在预设时间范围内的节点。
  22. 根据权利要求17所述的装置,其中,所述第一对象和第二对象分别是第一类对象和第二类对象,所述两个叶节点包括左节点和右节点,左节点对应于所述上一交互事件中的第一类对象,右节点对应于所述上一交互事件中的第二类对象。
  23. 根据权利要求22所述的装置,其中,所述位置编码包括,各节点相对于所述当前节点经过的连接边的数目,以及该节点是左节点或是右节点。
  24. 根据权利要求17所述的装置,其中,所述每个交互特征组还包括,交互行为的行为特征;
    所述当前序列中各个节点的节点特征包括,该节点所对应的交互对象的属性特征,以及该节点所在的交互特征组中的行为特征。
  25. 根据权利要求17所述的装置,其中,所述嵌入层用于:
    对各个节点的节点特征分别进行嵌入处理,得到N个节点嵌入向量;
    对各个节点的位置编码分别进行嵌入处理,得到N个位置嵌入向量;
    对所述N个节点嵌入向量和N个位置嵌入向量进行综合,得到所述N个嵌入向量。
  26. 根据权利要求17所述的装置,其中,所述每个注意力层用于:
    分别采用第一变换矩阵Q,第二变换矩阵K和第三变换矩阵V对所述N个输入向量中各个输入向量进行变换,得到各个输入向量对应的第一中间向量,第二中间向量和第三中间向量;
    对于N个输入向量中任意的第i输入向量,基于该第i输入向量对应的第一中间向量与各个输入向量对应的各个第二中间向量的点乘操作,确定该第i输入向量与各个输入向量的各个关联度;
    以该第i输入向量与各个输入向量的各个关联度作为权重因子,对所述各个输入向量对应的第三中间向量进行加权组合,得到该第i输入向量对应的第i组合向量;
    基于各个输入向量对应的各个组合向量,得到所述N个输出向量。
  27. 根据权利要求26所述的装置,其中,所述每个注意力层维护m套变换矩阵, 每套变换矩阵包括所述第一变换矩阵Q、第二变换矩阵K和第三变换矩阵V,从而得到m个向量序列,每个向量序列包括基于一套变换矩阵得到的N个组合向量;
    所述每个注意力层还用于:
    将所述m个向量序列进行拼接,得到拼接矩阵;
    通过第四变换矩阵对所述拼接矩阵进行变换,将变换得到的矩阵拆分为N个向量作为所述N个输出向量。
  28. 根据权利要求17所述的装置,其中,所述至少一个注意力层为多个注意力层,其中包括与所述嵌入层连接的第一注意力层和后续注意力层,所述第一注意力层从所述嵌入层获取所述N个嵌入向量作为其N个输入向量,每个后续注意力层获取其上一注意力层得到的N个输出向量作为其N个输入向量。
  29. 根据权利要求28所述的装置,其中,所述神经网络模型对所述多个注意力层中各个注意力层得到的N个输出向量进行综合,得到所述当前节点对应的特征向量。
  30. 根据权利要求28所述的装置,其中,所述神经网络模型对所述多个注意力层中最后一个注意力层得到的N个输出向量进行综合,得到所述当前节点的特征向量。
  31. 根据权利要求17所述的装置,其中,所述神经网络模型通过模型训练单元训练,所述模型训练单元包括:
    样本获取模块,配置为获取历史交互事件对应的历史特征组,其中包括第一样本对象和第二样本对象;
    序列确定模块,配置为在所述动态交互图中,分别确定与所述第一样本对象对应的第一序列,和与所述第二样本对象对应的第二序列;
    向量获取模块,配置为将所述第一序列和所述第二序列分别输入所述神经网络模型,分别得到与所述第一样本对象对应的第一特征向量和与第二样本对象对应的第二特征向量;
    预测模块,配置为根据所述第一特征向量和第二特征向量,预测所述第一样本对象和第二样本对象是否会发生交互,得到预测结果;
    损失确定模块,配置为根据所述预测结果,确定预测损失;
    更新模块,配置为根据所述预测损失,更新所述神经网络模型。
  32. 根据权利要求17所述的装置,其中,所述神经网络模型通过模型训练单元训练,所述模型训练单元包括:
    样本获取模块,配置为从所述动态交互序列中选择样本对象,并获取该样本对象的分类标签;
    序列确定模块,配置为在所述动态交互图中,确定与该样本对象对应的样本序列;
    向量获取模块,配置为将所述样本序列输入所述神经网络模型,得到所述样本对象的特征向量;
    预测模块,配置为根据所述样本对象的特征向量,预测所述样本对象的分类,得到预测结果;
    损失确定模块,配置为根据所述预测结果和所述分类标签,确定预测损失;
    更新模块,配置为根据所述预测损失,更新所述神经网络模型。
  33. 一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行权利要求1-16中任一项的所述的方法。
  34. 一种计算设备,包括存储器和处理器,其特征在于,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现权利要求1-13中任一项所述的方法。
PCT/CN2020/072042 2019-08-15 2020-01-14 处理交互序列数据的方法及装置 WO2021027256A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US16/816,719 US10936950B1 (en) 2019-08-15 2020-03-12 Processing sequential interaction data
US17/188,112 US11636341B2 (en) 2019-08-15 2021-03-01 Processing sequential interaction data

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910755561.5 2019-08-15
CN201910755561.5A CN110555469B (zh) 2019-08-15 2019-08-15 处理交互序列数据的方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/816,719 Continuation US10936950B1 (en) 2019-08-15 2020-03-12 Processing sequential interaction data

Publications (1)

Publication Number Publication Date
WO2021027256A1 true WO2021027256A1 (zh) 2021-02-18

Family

ID=68737802

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/072042 WO2021027256A1 (zh) 2019-08-15 2020-01-14 处理交互序列数据的方法及装置

Country Status (2)

Country Link
CN (1) CN110555469B (zh)
WO (1) WO2021027256A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114757700A (zh) * 2022-04-12 2022-07-15 北京京东尚科信息技术有限公司 物品销量预测模型训练方法、物品销量预测方法及装置
CN115277220A (zh) * 2022-07-29 2022-11-01 西安热工研究院有限公司 一种工控网络流量安全分类方法、系统及可读存储设备
CN116319110A (zh) * 2023-05-24 2023-06-23 保定思齐智科信息科技有限公司 针对工业多源异构时序数据的数据采集与治理方法

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10936950B1 (en) 2019-08-15 2021-03-02 Advanced New Technologies Co., Ltd. Processing sequential interaction data
CN110555469B (zh) * 2019-08-15 2020-07-24 阿里巴巴集团控股有限公司 处理交互序列数据的方法及装置
CN111258469B (zh) * 2020-01-09 2021-05-14 支付宝(杭州)信息技术有限公司 处理交互序列数据的方法及装置
CN115081589A (zh) * 2020-01-09 2022-09-20 支付宝(杭州)信息技术有限公司 利用lstm神经网络模型处理交互数据的方法及装置
CN111274388B (zh) * 2020-01-14 2024-05-10 平安科技(深圳)有限公司 一种文本聚类的方法及装置
CN111340566B (zh) * 2020-03-23 2023-12-08 京东科技控股股份有限公司 一种商品分类方法、装置、电子设备及存储介质
CN111523682B (zh) * 2020-07-03 2020-10-23 支付宝(杭州)信息技术有限公司 训练交互预测模型、预测交互对象的方法及装置
CN111949892B (zh) * 2020-08-10 2022-04-05 浙江大学 一种多关系感知的时态交互网络预测方法
CN113673420B (zh) * 2021-08-19 2022-02-15 清华大学 一种基于全局特征感知的目标检测方法及系统

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109299373A (zh) * 2018-10-20 2019-02-01 上海交通大学 基于图卷积技术的推荐系统
US20190080260A1 (en) * 2017-09-14 2019-03-14 Amadeus S.A.S. Machine learning methods and systems for predicting online user interactions
CN109816101A (zh) * 2019-01-31 2019-05-28 中科人工智能创新技术研究院(青岛)有限公司 一种基于图卷积神经网络的会话序列推荐方法及系统
CN110009093A (zh) * 2018-12-07 2019-07-12 阿里巴巴集团控股有限公司 用于分析关系网络图的神经网络系统和方法
CN110543935A (zh) * 2019-08-15 2019-12-06 阿里巴巴集团控股有限公司 处理交互序列数据的方法及装置
CN110555469A (zh) * 2019-08-15 2019-12-10 阿里巴巴集团控股有限公司 处理交互序列数据的方法及装置
CN110569437A (zh) * 2019-09-05 2019-12-13 腾讯科技(深圳)有限公司 点击概率预测、页面内容推荐方法和装置
CN110598847A (zh) * 2019-08-15 2019-12-20 阿里巴巴集团控股有限公司 处理交互序列数据的方法及装置

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7142715B2 (en) * 2003-01-17 2006-11-28 Sakhr Software Company Arabic handwriting recognition using feature matching
CN102244587B (zh) * 2011-07-15 2013-07-31 杭州信雅达数码科技有限公司 网络中节点信任评估方法
CN105426365B (zh) * 2014-08-01 2018-11-02 阿里巴巴集团控股有限公司 区分交互行为的方法及装置
CN109582147B (zh) * 2018-08-08 2022-04-26 亮风台(上海)信息科技有限公司 一种用于呈现增强交互内容的方法以及用户设备
CN109522474B (zh) * 2018-10-19 2021-05-18 上海交通大学 基于交互序列数据挖掘深度用户相似性的推荐方法
CN109359140B (zh) * 2018-11-30 2022-09-09 苏州大学 一种基于自适应注意力的序列推荐方法及装置
CN109993346B (zh) * 2019-02-22 2020-09-11 南京邮电大学 基于混沌时间序列和神经网络的微电网电压安全评估方法
CN110060097A (zh) * 2019-04-01 2019-07-26 苏州市职业大学 基于注意力机制和卷积神经网络的用户行为序列推荐方法

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190080260A1 (en) * 2017-09-14 2019-03-14 Amadeus S.A.S. Machine learning methods and systems for predicting online user interactions
CN109299373A (zh) * 2018-10-20 2019-02-01 上海交通大学 基于图卷积技术的推荐系统
CN110009093A (zh) * 2018-12-07 2019-07-12 阿里巴巴集团控股有限公司 用于分析关系网络图的神经网络系统和方法
CN109816101A (zh) * 2019-01-31 2019-05-28 中科人工智能创新技术研究院(青岛)有限公司 一种基于图卷积神经网络的会话序列推荐方法及系统
CN110543935A (zh) * 2019-08-15 2019-12-06 阿里巴巴集团控股有限公司 处理交互序列数据的方法及装置
CN110555469A (zh) * 2019-08-15 2019-12-10 阿里巴巴集团控股有限公司 处理交互序列数据的方法及装置
CN110598847A (zh) * 2019-08-15 2019-12-20 阿里巴巴集团控股有限公司 处理交互序列数据的方法及装置
CN110569437A (zh) * 2019-09-05 2019-12-13 腾讯科技(深圳)有限公司 点击概率预测、页面内容推荐方法和装置

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114757700A (zh) * 2022-04-12 2022-07-15 北京京东尚科信息技术有限公司 物品销量预测模型训练方法、物品销量预测方法及装置
CN115277220A (zh) * 2022-07-29 2022-11-01 西安热工研究院有限公司 一种工控网络流量安全分类方法、系统及可读存储设备
CN115277220B (zh) * 2022-07-29 2023-10-20 西安热工研究院有限公司 一种工控网络流量安全分类方法、系统及可读存储设备
CN116319110A (zh) * 2023-05-24 2023-06-23 保定思齐智科信息科技有限公司 针对工业多源异构时序数据的数据采集与治理方法
CN116319110B (zh) * 2023-05-24 2023-08-11 保定思齐智科信息科技有限公司 针对工业多源异构时序数据的数据采集与治理方法

Also Published As

Publication number Publication date
CN110555469A (zh) 2019-12-10
CN110555469B (zh) 2020-07-24

Similar Documents

Publication Publication Date Title
WO2021027256A1 (zh) 处理交互序列数据的方法及装置
US10958748B2 (en) Resource push method and apparatus
US20210334625A1 (en) Webinterface generation and testing using artificial neural networks
WO2021027260A1 (zh) 处理交互序列数据的方法及装置
US10936950B1 (en) Processing sequential interaction data
US11604980B2 (en) Targeted crowd sourcing for metadata management across data sets
EP3754549B1 (en) A computer vision method for recognizing an object category in a digital image
CN112119388A (zh) 训练图像嵌入模型和文本嵌入模型
CN110543935B (zh) 处理交互序列数据的方法及装置
CN110689110B (zh) 处理交互事件的方法及装置
US20220100772A1 (en) Context-sensitive linking of entities to private databases
CN112699215B (zh) 基于胶囊网络与交互注意力机制的评级预测方法及系统
CN114065750A (zh) 商品信息匹配、发布方法及其装置、设备、介质、产品
US20220414470A1 (en) Multi-Task Attention Based Recurrent Neural Networks for Efficient Representation Learning
US20220100967A1 (en) Lifecycle management for customized natural language processing
CN110390041B (zh) 在线学习方法及装置、计算机可读存储介质
CN114817692A (zh) 确定推荐对象的方法、装置和设备及计算机存储介质
JP2023550510A (ja) 推薦方法、装置、電子機器及び記憶媒体
Dai et al. A two-phase method of QoS prediction for situated service recommendation
CN113191527A (zh) 一种基于预测模型进行人口预测的预测方法及装置
CN113762992A (zh) 一种处理数据的方法和装置
CN110674417B (zh) 一种基于用户关注关系的标签推荐方法
US20240086947A1 (en) Intelligent prediction of sales opportunity outcome
US11941076B1 (en) Intelligent product sequencing for category trees
CN115374360B (zh) 媒体资源的召回方法和媒体资源召回模型的训练方法

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: 20851839

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: 20851839

Country of ref document: EP

Kind code of ref document: A1