CPC G06F 16/9535 (2019.01) [G06Q 50/01 (2013.01)] | 7 Claims |
1. A personalized comment recommendation method based on a link prediction model of a graph bidirectional aggregation network, comprising the following steps:
a) building a user-comment bipartite graph, a social network, and a forwarding network based on specific comment content, a user concern relationship, and a comment forwarding relationship;
b) converting a comment made by a user into an N-dimensional original comment feature hcom, and initializing an original feature huser of the user;
c) randomly deleting a comment node from the user-comment bipartite graph, and calculating an aggregated feature agghuseri of an ith user according to a formula agghuseri=SELU(Wagg·concat(huseri, aggregate({hcomi, ∀j∈Ncom(i)}))), wherein an aggregated feature of all users is represented by agghuser, SELU(·) represents an activation function, Wagg represents a weight of a feature extraction part, concat(·) represents a splicing function, huseri represents a user feature of an ith node, hcomj represents a comment feature of a jth node, Ncom(i) represents a quantity of comment nodes associated with an ith user node, and aggregate represents an aggregation function, namely,
wherein ReLU(·) represents an activation function, w represents a weight in the aggregate function, and b represents an offset in the aggregate function;
d) calculating a fused neighbor node feature agghuseri, of the ith user according to a formula agghuseri=SELU(Σj=0N(i)αij·Wagg·huserj), wherein αij represents an attention coefficient of associating the ith user and a jth comment edge, and huserj represents a user feature of the jth node;
e) calculating a new comment feature agghcomi of the ith user according to a formula agghcomi=SELU(Wagg·aggregate({agghuserj−huserj, ∀j∈Nuser(i)})), wherein new comment features of all the users are represented by agghcom, agghuserj represents the fused neighbor node feature of the jth user, and Nuser(i) represents a quantity of user nodes associated with an ith comment node;
f) calculating a loss function value lossagg of a feature aggregation part according to a formula lossagg=smoothL1(hcom, agghcom), wherein smoothL1(·) represents a loss function, hcom represents comment features of all nodes; and establishing a model of the feature extraction part;
g) aggregating neighbor features by using a GraphSAGE algorithm according to a formula preh=GraphSAGE(gretweet, agghuser) to obtain a user feature preh, wherein gretweet represents a graph structure of the forwarding network;
h) calculating a score score of each edge in a positive-sample forwarding network in a form of an inner product according to a formula score=prehu·prehv, wherein prehu represents a user node feature on a left side of a positive-sample edge, and prehv represents a user node feature on a right side of the positive-sample edge; and calculating a score score′ of each edge in a negative-sample forwarding network in the form of an inner product according to a formula score′=prehu′·prehv′, wherein prehu′ represents a user node feature on a left side of a negative-sample edge, and prehv′ represents a node feature on a right side of the negative-sample edge;
i) calculating a loss function value losspre of a link prediction part according to a formula losspre=max(0, M−score+score′), wherein M represents a boundary value, and setting M=1 to establish a model of the link prediction part;
j) calculating a total loss Loss according to a formula Loss=lossagg×agg+losspre×pre, wherein agg represents the weight of the feature extraction part, and pre represents a weight of the link prediction part;
k) repeating steps c) to j) for no less than N times to complete model training and optimization; and
l) generating a recommendation list in descending order based on the score score in step h), and making a recommendation based on the list.
|