CN112328835A - Method and device for generating vector representation of object, electronic equipment and storage medium - Google Patents

Method and device for generating vector representation of object, electronic equipment and storage medium Download PDF

Info

Publication number
CN112328835A
CN112328835A CN202011105416.1A CN202011105416A CN112328835A CN 112328835 A CN112328835 A CN 112328835A CN 202011105416 A CN202011105416 A CN 202011105416A CN 112328835 A CN112328835 A CN 112328835A
Authority
CN
China
Prior art keywords
node
target
vector representation
nodes
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011105416.1A
Other languages
Chinese (zh)
Inventor
宋伟
谢乾龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hainan Liangxin Technology Co.,Ltd.
Original Assignee
Beijing Sankuai Online Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN202011105416.1A priority Critical patent/CN112328835A/en
Publication of CN112328835A publication Critical patent/CN112328835A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/906Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0241Advertisements
    • G06Q30/0242Determining effectiveness of advertisements

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Development Economics (AREA)
  • Data Mining & Analysis (AREA)
  • Accounting & Taxation (AREA)
  • General Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Software Systems (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Game Theory and Decision Science (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a method and a device for generating vector representation of an object, electronic equipment and a storage medium. The method comprises the following steps: determining a target path taking a target node corresponding to a target object as an end point according to the incidence relation between nodes corresponding to various types of objects; determining the traversal sequence of each node on the target path; according to the traversal sequence, traversing each node on the target path, aggregating the vector representation of each neighbor node of the node aiming at each traversed node, generating the vector representation of the node until the target node is traversed, aggregating the vector representation of each neighbor node of the target node, and generating the vector representation of the target node. The method distinguishes semantics among nodes at different positions in the meta-path, and enables vector representation of each node to be more accurate by aggregating neighbor information at each node position in the meta-path.

Description

Method and device for generating vector representation of object, electronic equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of data processing, in particular to a method and a device for generating vector representation of an object, electronic equipment and a storage medium.
Background
Only one type of node and edge exist in traditional homography (homogenous Graph) data, so that all nodes share the same model parameters and have the same dimensional feature space when the Graph neural network is constructed. More than one type of node and edge may exist in the Heterogeneous Graph (Heterogeneous Graph) data, so that different types of nodes are allowed to have features or attributes with different dimensions, and the application of the Heterogeneous Graph is quite wide.
In a heterogeneous graph network, nodes may be connected by various types of relationships (e.g., meta-paths). Given a meta-path, each node has many neighbors based on the meta-path. It is necessary how to distinguish nuances between neighbors and select some information rich neighbors. It is also necessary for each node to learn the importance of its meta-path-based neighbors and assign it different attention values, and thus obtain a vector representation of the node.
However, in the related art, when obtaining the vector representation of a certain node in the heterogeneous graph network, the weights of all neighboring nodes of the current node are obtained directly through the attention model on the heterogeneous graph network by using a neural network, and then the vector representation of the current node is obtained according to the weights of the neighboring nodes, and semantic differences between nodes at different positions on the meta-path are not distinguished. Since each node has many neighbors based on meta-paths, vector representations under different meta-paths are different, and the vector representations of the nodes cannot be accurately obtained without distinguishing semantic differences between the nodes.
Disclosure of Invention
Embodiments of the present application provide a method and an apparatus for generating a vector representation of an object, an electronic device, and a storage medium, which can accurately obtain a vector representation of a node by distinguishing semantic differences between nodes at different positions in a meta path.
A first aspect of an embodiment of the present application provides a method for generating a vector representation of an object, where the method includes:
determining a target path taking a target node corresponding to a target object as an end point according to the incidence relation between nodes corresponding to various types of objects;
determining the traversal sequence of each node on the target path;
according to the traversal sequence, traversing each node on the target path, aggregating the vector representation of each neighbor node of the node aiming at each traversed node, generating the vector representation of the node until the target node is traversed, aggregating the vector representation of each neighbor node of the target node, and generating the vector representation of the target node.
Optionally, for each traversed node, aggregating vector representations of respective neighboring nodes of the node, generating a vector representation of the node, until traversing to the target node, aggregating vector representations of respective neighboring nodes of the target node, and generating a vector representation of the target node, includes:
and determining respective weights of all neighbor nodes of the node based on the attention mechanism network aiming at each traversed node, weighting the respective vector representations of all neighbor nodes of the node to generate the vector representation of the node until the target node is traversed, determining the respective weights of all neighbor nodes of the target node based on the attention mechanism network, weighting the respective vector representations of all neighbor nodes of the target node to generate the vector representation of the target node.
Optionally, the number of the target paths is plural; the method further comprises the following steps:
generating a vector representation of the target node corresponding to each target path;
and fusing vector representations of the target nodes corresponding to the plurality of target paths to obtain a final vector representation of the target node.
Optionally, after generating the vector representation of the target node, the method further includes:
inputting the vector representation of the target node into a classification model to obtain the type of the target node, wherein the classification model is used for predicting the type of the node; or
And under the condition that the number of the target nodes is multiple, clustering the multiple target nodes according to the vector representation of the multiple target nodes to obtain a clustering result.
Optionally, the target nodes include a first node corresponding to a user and a second node corresponding to a POI; after generating the vector representation of the target node, the method further comprises:
and training a preset model by taking the vector representation of the first node and the vector representation of the second node as training samples to obtain an estimated task model, wherein the estimated task model is used for estimating at least one of click rate CTR, conversion rate CVR, repurchase rate and user score.
A second aspect of the embodiments of the present application provides an apparatus for generating a vector representation of an object, where the apparatus includes:
the first determining module is used for determining a target path taking a target node corresponding to a target object as an end point according to the incidence relation between nodes corresponding to various types of objects;
the second determining module is used for determining the traversal sequence of each node on the target path;
and the traversal module is used for traversing each node on the target path according to the traversal sequence, aggregating the vector representation of each neighbor node of the node aiming at each traversed node, generating the vector representation of the node until the target node is traversed, aggregating the vector representation of each neighbor node of the target node, and generating the vector representation of the target node.
Optionally, the traversing module includes:
and the traversal submodule is used for determining the weights corresponding to all the neighbor nodes of the traversed node based on the attention mechanism network, weighting the vector representations of all the neighbor nodes of the node to generate the vector representation of the node until the target node is traversed, determining the weights corresponding to all the neighbor nodes of the target node based on the attention mechanism network, weighting the vector representations of all the neighbor nodes of the target node to generate the vector representation of the target node.
Optionally, the number of the target paths is plural; the device further comprises:
a generating module for generating a vector representation of the target node corresponding to each target path;
and the fusion module is used for fusing the vector representations of the target nodes corresponding to the plurality of target paths to obtain the final vector representation of the target nodes.
Optionally, the apparatus further comprises:
the input module is used for inputting the vector representation of the target node into a classification model after generating the vector representation of the target node to obtain the type of the target node, and the classification model is used for predicting the type of the node; or
And the clustering module is used for clustering the plurality of target nodes according to the respective vector representations of the plurality of target nodes to obtain a clustering result under the condition that the number of the target nodes is multiple after the vector representation of the target node is generated.
Optionally, the target nodes include a first node corresponding to a user and a second node corresponding to a POI; the device further comprises:
and the training module is used for training a preset model by taking the vector representation of the first node and the vector representation of the second node as training samples after generating the vector representation of the target node to obtain an estimated task model, and the estimated task model is used for estimating at least one of click rate CTR, conversion rate CVR, repurchase rate and user score.
A third aspect of embodiments of the present application provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps in the method for generating a vector representation of an object according to the first aspect of the present application.
A fourth aspect of the embodiments of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor, when executing, implements the steps in the method for generating a vector representation of an object according to the first aspect of the present application.
According to the method for generating the vector representation of the object, firstly, a target path with a target node corresponding to a target object as an end point is determined according to the incidence relation between nodes corresponding to various types of objects; then, determining the traversal sequence of each node on the target path according to the hop count of each node on the target path jumping to the target node; and finally, traversing each node on the target path according to the traversal sequence, aggregating the vector representation of each neighbor node of the node aiming at each traversed node, generating the vector representation of the node until the target node is traversed, aggregating the vector representation of each neighbor node of the target node, and generating the vector representation of the target node. The method distinguishes semantics among nodes at different positions in the meta-path, and enables each node to aggregate information of nodes farther on the path by aggregating information of neighbors at each node position on the meta-path, thereby enabling vector representation of each node to be more accurate.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.
FIG. 1 is a schematic diagram of semantic relationships between nodes in a heterogeneous graph network;
FIG. 2 is a schematic diagram of a vector for generating heterogeneous graph network nodes in the related art;
FIG. 3 is a flow chart illustrating a method for generating a vector representation of an object according to an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating a process for generating a vector of nodes according to an embodiment of the present application;
FIG. 5 is a schematic diagram illustrating another process for generating a vector of nodes according to an embodiment of the present application;
fig. 6 is a diagram illustrating a structure of a CTR prediction model according to an embodiment of the present application;
fig. 7 is a block diagram illustrating a structure of a device for generating a vector representation of an object according to an embodiment of the present application;
fig. 8 is a schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Before describing in detail how to generate a vector of a node in a heterogeneous graph network in the present application, a brief description will be given below of a method for generating a vector of a node in a heterogeneous graph network in the related art.
FIG. 1 is a schematic diagram of semantic relationships between nodes in a heterogeneous graph network. Fig. 2 is a schematic diagram of a principle of generating a vector of a heterogeneous graph network node in the related art. In fig. 1, three different types of nodes are included in a heterogeneous graph network: user (u), merchant (i) and query (q), in particular, user includes u1 and u2, merchant includes i1, i2 and i3, query includes q1, q2 and q3, click represents click. The edge between the user and the merchant indicates that the user clicked on the merchant, the edge between the user and the query indicates that the user performed the query, and the edge between the merchant and the query indicates that the merchant clicked on the query.
In the related art, for a node, weights of all neighbor nodes of the node are obtained directly through an attention model, for example, in fig. 1, it is assumed that a meta-path learns the importance of all neighbor nodes (including: i1, i2, q1, q2, q3) of u1 for a user-merchant-query (representing that a user makes a query under a merchant, and for a node u1, directly through an attention model on a heterogeneous graph network, and weights are assigned to the neighbor nodes, and the process is specifically expressed as follows:
αij=attention(hi,hj),j∈Ni
wherein alpha isijRepresents the weight of the neighbor node j of the node i, wherein the attention represents a DNN (Deep Neural Networks) network, and j represents all the neighbor nodes of the node i, wherein the node i is a user u1, and the neighbor nodes j are i1, i2, q1, q2 and q 3.
The process of assigning weights to neighboring nodes is shown in FIG. 2, αi1Weight, α, of neighbor node i1 representing node u1i2Weight, α, of neighbor node i2 representing node u1q1Weight, α, of neighbor node q1 representing node u1q2Weight, α, of neighbor node q2 representing node u1q3Representing the weight of the neighbor node q3 of node u 1.
After the weights of the neighbor nodes of u1 are obtained, the vectors are weighted by using the weights, and the vector of the node u1 is obtained, wherein the specific expression of the process is as follows:
Figure BDA0002726784940000061
wherein z isiVector representing node i, σ represents activation function, hjA vector representation of a neighbor node j representing node i, where the activation function may be a sigmod function, a relu function, or the like.
In the above process, the attention model does not distinguish semantic differences between adjacent nodes of the node u1 on the meta-path user-merchant-query, that is, the categories i1 and i2 are merchants, and the categories q1, q2 and q3 are queries, so that semantic depiction on the meta-path is not fine enough and expression is not sufficient, so that the vector representation of u1 is not accurate enough.
In order to overcome the problems in the related art, the application provides an attention model on a heterogeneous graph network, the model considers semantic differences of nodes at different positions of a meta-path, and information of a neighbor is aggregated at each node position on the meta-path, so that each node can aggregate information of nodes farther on the path, semantics on the meta-path can be more finely described, and vector representation of each node is more accurate.
Fig. 3 is a flowchart illustrating a method for generating a vector representation of an object according to an embodiment of the present application. Referring to fig. 3, the method for generating a node in a heterogeneous graph network according to the present application may include the following steps:
step S11: and determining a target path taking the target node corresponding to the target object as an end point according to the incidence relation between the nodes corresponding to the various types of objects.
In the present embodiment, the object means a meaning of a node representation in the heteromorphic network, and the node is an imaged representation of the object. The type of the object may be a type pre-divided according to task requirements, such as a merchant, a user, a query, and the like, which is not specifically limited by the embodiment.
The objects can have an association relationship with each other, and the association relationship has certain semantics. For example, when the object is a user and a business, the association (semantics) between the two may be that the user clicked the business, and when the object is a user and a query, the association (semantics) between the two may be that the user made the query.
The target object may be arbitrarily specified, for example, in fig. 1, the target object may be user u1, or user u2, or merchant i1, or merchant i2, and the like, which is not limited in this embodiment. In other words, in the heterogeneous graph network, each node may be a target node, and for convenience of description of various embodiments of the present application, the target node in the present application refers to a node that needs to be vector-represented, and is not limited to a specific certain node or a certain part of nodes.
In this embodiment, the target path is a meta path, and one object may have a plurality of meta paths, and the meta path of one object may be arbitrarily specified according to a requirement. For example, when the target object is merchant i1, the specified meta-path may be user-merchant, user-query-merchant, and so on. Still further by way of example, when the target object is u2, the specified meta path may be merchant-user, query-user, etc.
Step S12: and determining the traversal sequence of each node on the target path.
In this embodiment, the traversal order may be a front-to-back order, or a back-to-front order, and the traversal order of each node on the target path may be determined according to actual requirements. For example, for meta-path user-merchants, the traversal order can be user- > merchant (front to back) or merchant- > user (back to front). It is also understood that traversing the target node first is a back-to-front traversal order, and vice versa.
Illustratively, in conjunction with fig. 1, taking the target object as u1 as an example, if the meta path is a merchant-user, the traversal order includes: when the traversal sequence from back to front is adopted, the traversal sequence comprises: u1- > i1, u1- > i 2; if the meta-path is query-merchant-user, when a traversal order from front to back is adopted, the traversal order comprises: q1- > i1- > u1, q2- > i1- > u1, q2- > i2- > u1 and q3- > i2- > u1, and when the traversal sequence from front to back is adopted, the traversal sequence comprises: u1- > i1- > q1, u1- > i1- > q2, u1- > i2- > q2, u1- > i2- > q 3. Taking the target object as u2 as an example, if the meta path is a query-user, the traversal order includes: q3- > u2, wherein the traversal order comprises the following steps when the traversal order from back to front is adopted: u2- > q 3.
Step S13: according to the traversal sequence, traversing each node on the target path, aggregating the vector representation of each neighbor node of the node aiming at each traversed node, generating the vector representation of the node until the target node is traversed, aggregating the vector representation of each neighbor node of the target node, and generating the vector representation of the target node.
Illustratively, taking the target node as u1 and the traversal order as q1- > i1- > u1 as an example, first traverse node q1, aggregate the vector representations of the neighbor nodes of node q1, and generate a vector representation of node q 1; then traversing the node i1, aggregating vector representations of neighbor nodes of the node i1, and generating a vector representation of the node i 1; next, traversing node u1, the vector representation of the neighbor nodes of node u1 are aggregated, generating a vector representation of node u 1.
In the present embodiment, the vector may be represented by an embedding manner. Embedding is one way to convert discrete variables into a continuous vector representation. In a neural network, embedding can reduce the spatial dimension of a discrete variable, while representing the variable meaningfully. Of course, the vector may be expressed in other ways, and this embodiment is not limited to this.
Referring to fig. 1 again, taking the target node u1 and the meta path query-merchant-user as an example, the traversal order includes: q1- > i1- > u1, q2- > i1- > u1, q2- > i2- > u1, q3- > i2- > u 1. In a specific implementation, the four traversal orders are not independent, for example, for two traversal orders of q2- > i2- > u1 and q3- > i2- > u1, the middle node is i2, and its neighbor nodes are q2 and q3, so that the node q2 and the node q3 are directly aggregated to obtain a vector representation of the node i 2. Instead of aggregating along the path when the traversal order is q2- > i2- > u1 and aggregating along the path when the path is q3- > i2- > u1, the method is based on node aggregation, for example, when the 2 nd node is a business, the first step is to aggregate neighbor nodes of each business node to obtain a vector representation of the business for all business nodes, and the second step is to aggregate neighbor nodes of all user nodes to obtain a vector representation of the user for all user nodes.
According to the method for generating the vector representation of the object, firstly, a target path with a target node corresponding to a target object as an end point is determined according to the incidence relation between nodes corresponding to various types of objects; then determining the traversal sequence of each node on the target path; and finally, traversing each node on the target path according to the traversal sequence, aggregating the vector representation of each neighbor node of the node aiming at each traversed node, generating the vector representation of the node until the target node is traversed, aggregating the vector representation of each neighbor node of the target node, and generating the vector representation of the target node. The method distinguishes the semantics between the nodes at different positions in the meta-path, and the information of the neighbors is aggregated at each node position in the meta-path, so that each node can aggregate the information of the nodes farther on the path, the semantics on the meta-path can be more finely described, and the vector representation of each node is more accurate.
In one implementation, in combination with the above embodiments, the present application further provides a method for generating a vector representation of a target node by aggregating vector representations of respective neighbor nodes of the target node. Specifically, the step S13 may include:
and determining respective weights of all neighbor nodes of the node based on the attention mechanism network aiming at each traversed node, weighting the respective vector representations of all neighbor nodes of the node to generate the vector representation of the node until the target node is traversed, determining the respective weights of all neighbor nodes of the target node based on the attention mechanism network, weighting the respective vector representations of all neighbor nodes of the target node to generate the vector representation of the target node.
In this embodiment, when generating the vector representation of a certain node, all the neighbor nodes of the node and the weight of each neighbor node need to be obtained, and then the final vector representation of the node is obtained according to the corresponding weighting of the weight and the vector representation of each neighbor node. In specific implementation, the weights of each neighbor node of a single node can be obtained through a pre-trained attention mechanism network.
Illustratively, the neighbor nodes for the target node X include nodes 1-4, the respective weights of the nodes 1-4 are α 1, α 2, α 3, and α 4, and the respective vectors are E1, E2, E3, E4, so that the vector of the target node X is denoted as EX ═ σ (α 1 ═ E1+ α 2 × E2+ α 3 × E3+ α 4 × E4).
Fig. 4 is a schematic diagram illustrating a process of generating a vector of nodes according to an embodiment of the present application. Fig. 5 is a schematic diagram illustrating another process of generating a vector of nodes according to an embodiment of the present application. With reference to fig. 4 and fig. 5, taking the target node u1 and the meta path query-merchant-user as an example, the complete process of generating the vector of the target node u1 under the meta path is:
step 1: determining the types of all nodes on the meta-path, including: user, merchant, and Query, as shown in fig. 5, Query represents a Query, Item represents a merchant, User represents a User, and attention represents an attention mechanism.
Step 2: because the meta-path is a query-merchant-user, each node on the meta-path is traversed in a front-to-back (or back-to-front) query mode, the query node is traversed first, and the merchant node is traversed next because the query node has no neighbor.
And step 3: traversing each merchant node, and obtaining the weight of the neighbor of each merchant node, namely obtaining the weight of the neighbor q1 and q2 of i1 and the weight of the neighbor q2 and q3 of i 2. As shown in fig. 5, the weight of the neighbor q1 of i1 is β 11, the weight of the neighbor q2 of i1 is β 21, the weight of the neighbor q1 of i2 is β 22, and the weight of the neighbor q3 of i2 is β 32.
And 4, step 4: the embedding vector of i1 is calculated according to the respective weights of the neighbors q1 and q2 of i1, and the embedding vector of i2 is calculated according to the respective weights of the neighbors q2 and q3 of i 2.
And 5: traversing the user node u1, obtaining respective weights of i1 and i2, namely the weight of the neighbor i1 of u1 is α 11, and the weight of the neighbor i2 of u1 is α 21.
Step 6: according to the respective weights of i1 and i2, an embedding vector of u1 is calculated.
Through the attention mechanism network of the embodiment, the weight of the neighbor node of each node can be obtained, and then the vector representation of each node is obtained.
With reference to the above embodiments, in one implementation, the number of the target paths is plural; on this basis, the method for generating the vector of the object of the present application may further include the following steps:
generating a vector representation of the target node corresponding to each target path;
and fusing vector representations of the target nodes corresponding to the plurality of target paths to obtain a final vector representation of the target node.
In this embodiment, since one node may have a plurality of meta-paths, for the case that the number of meta-paths of the target node is multiple, the vector representations of the target node under each meta-path may be generated first, and then the vector representations under all the meta-paths are fused to obtain the final vector representation of the target node. The fusion mode may be through embedding connection or pooling, which is not limited in this embodiment.
In combination with the above embodiments, in an implementation, after obtaining the vector representation of the target node, the vector may also be applied to a specific service scenario. The application scenarios of the vectors will be enumerated below.
Scenario one, node type prediction
And inputting the vector representation of the target node into a classification model to obtain the type of the target node, wherein the classification model is used for predicting the type of the node.
In scenario one, vectors of a plurality of labeled nodes may be used as training samples to train a network model, and a classification model that can be used for predicting types of nodes is obtained. When the vector of a certain node is input into the classification model, the probability that the node belongs to each type can be output, and the type with the highest probability is the type to which the node belongs.
Scene two, node clustering
And under the condition that the number of the target nodes is multiple, clustering the multiple target nodes according to the vector representation of the multiple target nodes to obtain a clustering result.
In the second scenario, vectors of a plurality of labeled nodes can be used as training samples to train the network model in advance, and a clustering model which can be used for clustering the nodes is obtained. When a vector of a plurality of nodes is input to the clustering model, the classification of the nodes and the nodes included in each classification can be output.
Scene three, prediction in advertising scene
The target nodes comprise a first node corresponding to a user and a second node corresponding to a POI (Point of Information); and training a preset model by taking the vector representation of the first node and the vector representation of the second node as training samples to obtain an estimated task model, wherein the estimated task model is used for estimating at least one of click rate CTR, conversion rate CVR, repurchase rate and user score.
In the third scenario, the generated vector may also be applied to various estimation tasks of the advertisement, taking CTR (Click-Through-Rate) estimation as an example, referring to fig. 6, where fig. 6 is a model structure diagram of CTR estimation shown in an embodiment of the present application. In fig. 6, after obtaining the embedding vectors of the nodes on the heterogeneous graph network, the vectors of the nodes may be respectively used as the input of the DNN network. For example, in fig. 6, a vector (user graph embedding) of a user node, a vector (POI node), other user characteristics, and other POI characteristics output through a heterogeneous graph network are input to a DNN network, and a final optimization target is obtained by using a cross entropy loss function after passing through a plurality of hidden layer networks, and finally, a CTR is estimated. Of course, other vectors, for example, a vector of the query node, a vector of the merchant node, and the like, may also be used as an input according to the actual estimation task, which is not limited in this embodiment.
Of course, the vectors of different types of nodes in the generated heteromorphic graph may also be applied in other scenarios, and this embodiment is not particularly limited thereto.
The method for generating the vector of the node distinguishes semantics among nodes at different positions in the meta-path, and enables each node to aggregate information of nodes farther away on the path by aggregating information of neighbors at each node position on the meta-path, so that vector representation of each node is more accurate.
Based on the same inventive concept, an embodiment of the present application provides an apparatus 700 for generating a vector representation of an object. Fig. 7 is a block diagram of a device for generating a vector representation of an object according to an embodiment of the present application. As shown in fig. 7, the apparatus 700 for generating a vector representation of an object includes:
a first determining module 701, configured to determine, according to an association relationship between nodes corresponding to multiple types of objects, a target path with a target node corresponding to a target object as an end point;
a second determining module 702, configured to determine a traversal order of each node on the target path;
a traversing module 703, configured to traverse each node on the target path according to the traversal order, aggregate, for each traversed node, the vector representation of each neighboring node of the node, generate the vector representation of the node, until the target node is traversed, aggregate the vector representation of each neighboring node of the target node, and generate the vector representation of the target node.
Optionally, the traversing module 703 includes:
and the traversal submodule is used for determining the weights corresponding to all the neighbor nodes of the traversed node based on the attention mechanism network, weighting the vector representations of all the neighbor nodes of the node to generate the vector representation of the node until the target node is traversed, determining the weights corresponding to all the neighbor nodes of the target node based on the attention mechanism network, weighting the vector representations of all the neighbor nodes of the target node to generate the vector representation of the target node.
Optionally, the number of the target paths is plural; the apparatus 700 further comprises:
a generating module for generating a vector representation of the target node corresponding to each target path;
and the fusion module is used for fusing the vector representations of the target nodes corresponding to the plurality of target paths to obtain the final vector representation of the target nodes.
Optionally, the apparatus 700 further comprises:
the input module is used for inputting the vector representation of the target node into a classification model after generating the vector representation of the target node to obtain the type of the target node, and the classification model is used for predicting the type of the node; or
And the clustering module is used for clustering the plurality of target nodes according to the respective vector representations of the plurality of target nodes to obtain a clustering result under the condition that the number of the target nodes is multiple after the vector representation of the target node is generated.
Optionally, the target nodes include a first node corresponding to a user and a second node corresponding to a POI; the apparatus 700 further comprises:
and the training module is used for training a preset model by taking the vector representation of the first node and the vector representation of the second node as training samples after generating the vector representation of the target node to obtain an estimated task model, and the estimated task model is used for estimating at least one of click rate CTR, conversion rate CVR, repurchase rate and user score.
Based on the same inventive concept, another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps in the method according to any of the above-mentioned embodiments of the present application.
Based on the same inventive concept, another embodiment of the present application provides an electronic device 800, as shown in fig. 8. Fig. 8 is a schematic diagram of an electronic device according to an embodiment of the present application. The electronic device comprises a memory 802, a processor 801 and a computer program stored on the memory and executable on the processor, which when executed performs the steps of the method according to any of the embodiments of the present application.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one of skill in the art, embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the true scope of the embodiments of the application.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The method, the apparatus, the storage medium, and the electronic device for generating a vector representation of an object provided by the present application are described in detail above, and a specific example is applied in the present application to explain the principles and embodiments of the present application, and the description of the above embodiment is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method of generating a vector representation of an object, the method comprising:
determining a target path taking a target node corresponding to a target object as an end point according to the incidence relation between nodes corresponding to various types of objects;
determining the traversal sequence of each node on the target path;
according to the traversal sequence, traversing each node on the target path, aggregating the vector representation of each neighbor node of the node aiming at each traversed node, generating the vector representation of the node until the target node is traversed, aggregating the vector representation of each neighbor node of the target node, and generating the vector representation of the target node.
2. The method of claim 1, wherein for each node traversed, aggregating vector representations of respective neighboring nodes of the node, generating a vector representation of the node, until traversing to the target node, aggregating vector representations of respective neighboring nodes of the target node, generating a vector representation of the target node, comprises:
and determining respective weights of all neighbor nodes of the node based on the attention mechanism network aiming at each traversed node, weighting the respective vector representations of all neighbor nodes of the node to generate the vector representation of the node until the target node is traversed, determining the respective weights of all neighbor nodes of the target node based on the attention mechanism network, weighting the respective vector representations of all neighbor nodes of the target node to generate the vector representation of the target node.
3. The method according to claim 1 or 2, wherein the number of target paths is plural; the method further comprises the following steps:
generating a vector representation of the target node corresponding to each target path;
and fusing vector representations of the target nodes corresponding to the plurality of target paths to obtain a final vector representation of the target node.
4. The method of any of claims 1-3, wherein after generating the vector representation of the target node, the method further comprises:
inputting the vector representation of the target node into a classification model to obtain the type of the target node, wherein the classification model is used for predicting the type of the node; or
And under the condition that the number of the target nodes is multiple, clustering the multiple target nodes according to the vector representation of the multiple target nodes to obtain a clustering result.
5. The method of any of claims 1-3, wherein the target nodes comprise a first node corresponding to a user and a second node corresponding to a POI; after generating the vector representation of the target node, the method further comprises:
and training a preset model by taking the vector representation of the first node and the vector representation of the second node as training samples to obtain an estimated task model, wherein the estimated task model is used for estimating at least one of click rate CTR, conversion rate CVR, repurchase rate and user score.
6. An apparatus for generating a vector representation of an object, the apparatus comprising:
the first determining module is used for determining a target path taking a target node corresponding to a target object as an end point according to the incidence relation between nodes corresponding to various types of objects;
the second determining module is used for determining the traversal sequence of each node on the target path;
and the traversal module is used for traversing each node on the target path according to the traversal sequence, aggregating the vector representation of each neighbor node of the node aiming at each traversed node, generating the vector representation of the node until the target node is traversed, aggregating the vector representation of each neighbor node of the target node, and generating the vector representation of the target node.
7. The apparatus of claim 6, wherein the traversal module comprises:
and the traversal submodule is used for determining the weights corresponding to all the neighbor nodes of the traversed node based on the attention mechanism network, weighting the vector representations of all the neighbor nodes of the node to generate the vector representation of the node until the target node is traversed, determining the weights corresponding to all the neighbor nodes of the target node based on the attention mechanism network, weighting the vector representations of all the neighbor nodes of the target node to generate the vector representation of the target node.
8. The apparatus of claim 6 or 7, wherein the number of target paths is plural; the device further comprises:
a generating module for generating a vector representation of the target node corresponding to each target path;
and the fusion module is used for fusing the vector representations of the target nodes corresponding to the plurality of target paths to obtain the final vector representation of the target nodes.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method for generating a vector representation of an object according to any one of claims 1 to 5.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executed performs the steps in the method for generating a vector representation of an object according to any of claims 1-5.
CN202011105416.1A 2020-10-15 2020-10-15 Method and device for generating vector representation of object, electronic equipment and storage medium Pending CN112328835A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011105416.1A CN112328835A (en) 2020-10-15 2020-10-15 Method and device for generating vector representation of object, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011105416.1A CN112328835A (en) 2020-10-15 2020-10-15 Method and device for generating vector representation of object, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112328835A true CN112328835A (en) 2021-02-05

Family

ID=74313838

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011105416.1A Pending CN112328835A (en) 2020-10-15 2020-10-15 Method and device for generating vector representation of object, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112328835A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113408297A (en) * 2021-06-30 2021-09-17 北京百度网讯科技有限公司 Method, device, electronic equipment and readable storage medium for generating node representation

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113408297A (en) * 2021-06-30 2021-09-17 北京百度网讯科技有限公司 Method, device, electronic equipment and readable storage medium for generating node representation
CN113408297B (en) * 2021-06-30 2023-08-18 北京百度网讯科技有限公司 Method, apparatus, electronic device and readable storage medium for generating node representation

Similar Documents

Publication Publication Date Title
CN109033229B (en) Question and answer processing method and device
CN110555050B (en) Heterogeneous network node representation learning method based on meta-path
CN112000819A (en) Multimedia resource recommendation method and device, electronic equipment and storage medium
CN110909182A (en) Multimedia resource searching method and device, computer equipment and storage medium
CN110955831B (en) Article recommendation method and device, computer equipment and storage medium
CN108446297B (en) Recommendation method and device and electronic equipment
CN110598118A (en) Resource object recommendation method and device and computer readable medium
CN110188210A (en) One kind is based on figure regularization and the independent cross-module state data retrieval method of mode and system
CN112948625B (en) Film recommendation method based on attribute heterogeneous information network embedding
CN111159563A (en) Method, device and equipment for determining user interest point information and storage medium
CN112580789B (en) Training graph coding network, and method and device for predicting interaction event
CN112989169A (en) Target object identification method, information recommendation method, device, equipment and medium
KR20170036874A (en) Method and apparatus for recommendation of social event based on users preference
CN113220974B (en) Click rate prediction model training and search recall method, device, equipment and medium
KR101738809B1 (en) Method and System for Multi Aspect Matrix Localization by Social Matching and Communication Service in Smart Home Community based on Internet of Things
CN112860759B (en) Big data mining method based on block chain security authentication and cloud authentication service system
CN113468403A (en) User information prediction method based on big data mining and cloud computing AI (Artificial Intelligence) service system
CN112328835A (en) Method and device for generating vector representation of object, electronic equipment and storage medium
CN111582448B (en) Weight training method and device, computer equipment and storage medium
WO2023165352A1 (en) Service object classification method and apparatus, device and storage medium
CN112016836A (en) Method and device for determining similarity between objects
CN113591986B (en) Method for generating object weight of recommendation model and personalized recommendation method
CN112085279B (en) Method and device for training interactive prediction model and predicting interactive event
CN115687747A (en) Content recommendation method and related device
CN116806337A (en) Information matching using subgraphs

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
TA01 Transfer of patent application right

Effective date of registration: 20220329

Address after: 571924 Room 302, building b-20, Hainan Ecological Software Park, west of Meilun South Road, Laocheng town economic and Technological Development Zone, Chengmai County, Hainan Province

Applicant after: Hainan Liangxin Technology Co.,Ltd.

Address before: 100083 2106-030, 9 North Fourth Ring Road, Haidian District, Beijing.

Applicant before: BEIJING SANKUAI ONLINE TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination