This patent application claims the benefit and priority of Chinese Patent Application No. 202211505338.3 filed with the China National Intellectual Property Administration on Nov. 29, 2022, the disclosure of which is incorporated by reference herein in its entirety as part of the present application.
The present disclosure belongs to the field of data mining and recommendation systems, and in particular, relates to a sequence recommendation method based on extracting and modeling of complex multi-mode user interests.
With the rapid development of mobile computing technology, the contact between people and devices becomes easier. In the process of digitalization, massive services and data are produced, and users will inevitably face the dilemma of finding the required content from massive data, which is referred to as information overload. A personalized recommendation system solves the problem of information overload by modeling user interests and recommending related content. In particular, the personalized recommendation system can help users find products/contents/projects they are interested in from massive data and create opportunities for product providers to increase their income.
Usually, users access online items in a certain order. Therefore, sequence recommendation has become a hot topic in the construction of the recommendation system in academic circles and industry circles. Given a historical item interaction sequence of a user, sequence recommendation aims to predict a next item that the user may be interested in.
Sequence recommendation takes the sequential item interaction sequence as an input. At present, the methods of sequence recommendation by domestic and international researchers can be mainly divided into three categories, namely, matrix decomposition-based method, Markov chain-based method and deep learning-based method. The matrix decomposition-based method relies on time sequence matrix decomposition to mine dynamic interests of the user. The Markov chain-based method uses first-order or higher-order Markov chains to learn changes of long-term interests and short-term interests of the user. Inspired by the advantages of a natural language processing method in sequence modeling, the deep learning-based method is used to enhance feature learning. The method based on Convolutional Neural Network (CNN), such as Caser, uses CNN to learn an item embedding sequence. The method based on Recurrent Neural Network (RNN) uses RNN or variants of RNN such as a Gated Recurrent Unit (GRU) and a Long Short-Term Memory Network (LSTM) for sequence recommendation. Recently, because Graph Neural Network (GNN) can effectively learn a high-order relationship between items, researchers use GNN for sequence recommendation tasks. SR-GNN learns item embedding by applying GNN to graphs constructed based on item sequences. SURGE uses GNN to dynamically extract user interests from noisy sequences. In addition, the attention-based method such as SASRec uses a self-attention mechanism to adaptively select related items to model user interests. TLSAN learns long-term and short-term interests through an attention network. Generally speaking, the deep learning-based method is superior to the other two kinds of methods.
The existing sequence recommendation methods are usually divided into long-term interests and short-term interests when modeling user interests. The main difference between the long-term interest and the short-term interest lies in the different sequence lengths used for interest mining. However, with the change of the length, the user interests will also change, so that the existing methods based on long-term and short-term interests cannot accurately model the representation of the user interests.
In view of the defects of the existing sequence recommendation for modeling user interests from the perspectives of long-term interests and short-term interests, the present disclosure proposes a sequence recommendation method based on extraction and modeling of complex multi-mode user interests from the perspectives of dynamic interests and static interests, and considers evolutionary interests in the dynamic and static interest modeling process to enhance feature modeling, thereby realizing more accurate personalized sequence recommendation of the user.
The present disclosure provides a sequence recommendation method based on extraction and modeling of complex multi-mode user interests, which includes the following specific steps:
Step 1, acquiring a historical item interaction sequence of a user, and selecting a latest sequence with a length of m as a long-term sequence and a latest sequence with a length of n as a short-term sequence, where m>n is required; based on a self-learning item embedding matrix F∈k×d, items involved in the sequences are embedded to obtain a long-term embedding sequence Fl and a short-term embedding sequence Fs;
Step 2, inputting the long-term embedding sequence Fl and the short-term embedding sequence Fs into two independent multi-head self-attention modules, respectively, to obtain an updated long-term embedding sequence Êl and an updated short-term embedding sequence Ês;
Step 3, with an embedding vector êlm of a last item in the updated long-term embedding sequence as a long-term dynamic interest pld of the user, calculating attention weights of the updated long-term embedding sequence Êl to the embedding vector of the last item, and performing weighted summation to obtain a long-term static interest plx of the user, and similarly, obtaining a short-term dynamic interest psd and a short-term static interest psx based on the updated short-term embedding sequence;
Step 4, concatenating the long-term dynamic interest pld and the long-term static interest plx, and performing nonlinear change to obtain a long-term evolutionary interest ply of the user, and similarly, obtaining a short-term evolutionary interest psy of the user based on the short-term dynamic interest psd and the short-term static interest psx;
Step 5, obtaining a dynamic interest pd of the user through element-wise summation of the long-term dynamic interest pld and the short-term dynamic interest psd; and similarly, obtaining a static interest px and an evolutionary interest py of the user;
Step 6, calculating attention weights of the dynamic interest pd, the static interest px and the evolutionary interest py to the embedding vector of the last item, and performing weighted summation to obtain a fused user interest p;
Step 7, calculating a product of p with embedding F of each item as a recommendation score of each item, and recommending top items with highest scores for the user.
The present disclosure has the following beneficial effects. The user interests are modeled from the perspectives of dynamic interests and static interests, and multi-level dynamic and static interests are modeled based on long-term and short-term sequences, so that more accurate and practical user interest modeling is realized. The difference between a dynamic interest and a static interest lies in whether the interest remains stable for a period of time. The dynamic interest changes with time, while the static interest remains almost unchanged for a period of time. In addition to dynamic and static interests, the evolutionary interest changing from the static interest to the dynamic interest is taken into account, and more accurate personalized sequence recommendation is realized by adaptive fusion of the dynamic interest. the static interest and the evolutionary interest.
Aiming at the defects of the current sequence recommendation method in modeling user interests from the perspectives of long-term interests and short-term interests, the present disclosure designs a sequence recommendation method based on extracting and modeling of complex multi-mode user interests.
A sequence recommendation method based on extracting and modeling of complex multi-mode user interests designed by the present disclosure will be described in detail hereinafter, and the implementation process of the method is shown in
The specific steps of the present disclosure are as follows.
In step (1), sequence division and vector embedding are performed. Specifically, a historical item interaction sequence H=(h1, h2, . . . , ht) of a user is acquired, where hi is an item corresponding to an i-th interaction behavior, a latest sequence Hl=(hl1, hl2, . . . , hlm) with a length of m is selected as a long-term sequence and a latest sequence Hs=(hs1, hs2, . . . , hsn) with a length of n is selected as a short-term sequence, where m>n is required. Based on a self-learning item embedding matrix F∈k×d, items involved in the sequences are embedded to obtain a long-term embedding sequence Fl=(fl1, fl2, . . . , flm) and a short-term embedding sequence Fs=(fs1, fs2, . . . , fsn), where k indicates a number of kinds of all items in all sequences, where F∈m×d, Fs∈n×d, fli∈d, fsi∈d, and d indicates a vector embedding dimension. It is assumed that the user interaction sequence is (a1, a2, a3, a4, a5, a6), m=6, and n=3, a long-term sequence (a1, a2, a3, a4, a5, a6) and a short-term sequence (a4, a5, a6) are obtained by splitting. The long-term embedding sequence Fl=(fla
In step (2), embedding vectors of items are updated based on the multi-head self-attention mechanism. Specifically, the long-term embedding sequence Fl and the short-term embedding sequence Fs are inputted into two independent multi-head self-attention modules, respectively. Specifically, as far as the long-term embedding sequence Fl is concerned. in order to learn the sequence relationship between items, a self-learning position vector posli∈d is assigned to each item on the sequence, and the item vector is updated to gli=fli+posli, so as to obtain the long-term embedding sequence Gl=(gl1, gl2, . . . , glm) after being updated in position. The embedding sequence combined with the position vector is learned by the multi-head self-attention mechanism. The multi-head mechanism can model different information from different spaces, thus improving the representation ability of the model. Each attention head performs independent self-attention learning. Specifically, for the j-th attention head, the following three matrices are obtained by Gl:
Aj=GlWAj,Bj=GlWBj,Cj=GlWCj,
where WAj∈d×d′, WBj∈d×d′ and WCj∈d×d′ are three parameter matrices. Attention operation is performed to obtain the embedding sequence updated under the attention head:
where o indicates the number of attention heads. The updated long-term embedding sequence Êl=(ĝl1, ĝl2, . . . , ĝlm)=(êl1, êl2, . . . , êlm) is obtained by concatenating ĝlj∈m×d′ obtained from o attention heads, where Êl∈m×(o×d′), êli∈(o×d′). Similarly, the updated short-term embedding sequence Ês=(ês1, ês2, . . . , êsn) is obtained by the multi-head attention mechanism. For the example in Step (1), the updated long-term embedding sequence Êl=(êla
In step (3), initial dynamic and static interest modeling are performed. Specifically, an embedding vector êlm of a last item in the long-term embedding sequence Êl is taken as a long-term dynamic interest pld of a user. An attention weight of each vector in the long-term sequence to êlm is calculated:
where Wl∈(o×d′)×(o×d′) is the parameter to be trained, ReLU is an activation function, and the long-term static interest is obtained through weighted summation based on the obtained weights:
plx=Σi=1mαiêli.
Similarly, the short-term dynamic interest psd and the short-term static interest psx are obtained based on the short-term embedding sequence Ês. Specifically,
For the example in step (2), the long-term dynamic interest is pld=êla
In step (4), initial evolutionary interest learning is performed. Specifically, the long-term dynamic interest pld and the long-term static interest plx are concatenated, and then nonlinear transformation is performed to obtain a long-term evolutionary interest of the user:
p
l
y=ReLU(Wly(pld∥plx)).
Wly∈(o×d′)×(2×o×d′) is the parameter to be trained. Similarly, the short-term evolutionary interest psy of the user is obtained based on the short-term dynamic interest psd and the short-term static interest psx.
In step (5), the dynamic interest of the user is obtained by element-wise summation of the long-term static interest pld and the short-term static interest psd:
p
d
=p
l
d
⊕p
s
d,
where ⊕ indicates element-wise addition. Similarly, the static interest px of the user is obtained by element-wise summation of the long-term static interest plx and the short-term static interest psx; and the evolutionary interest py of the user is obtained by element-wise summation of the long-term evolutionary interest ply and the short-term evolutionary interest psy.
In step (6), interest fusion is performed. Specifically, attention weights of the dynamic interest pd, the static interest px and the evolutionary interest py to the embedding vector êlm of the last item are calculated, which are specifically defined as:
where weighted summation and transformation are carried out to obtain the fused user interest p∈d:
p=W
r(αppd+αxpx+αypy)
where Wr∈d×(o×d′) is a parameter to be trained.
In step (7), recommendation is performed. Specifically, a product of p with embedding F of each item is calculated as a recommendation score of each item, and top items with highest scores are recommended for the user.
Number | Date | Country | Kind |
---|---|---|---|
202211505338.3 | Nov 2022 | CN | national |