User behavior prediction method, device, equipment, medium and product
Through the time-aware user interest extraction network model, the user's historical behavior and candidate object attributes are processed, and the user's future behavior is predicted. This solves the problem in the existing technology of being unable to predict the user's behavior in a specific future time period, and improves the timeliness of recommendation services. and accuracy.
Patent Information
- Application Number
- CN202210594016.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-27
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-05-27
AI Technical Summary
Existing recommendation algorithms cannot predict the probability of users clicking on candidates such as videos at a specific time in the future. They lack timeliness and cannot predict the user's behavior in a specific time period in the future.
Using a time-aware user interest extraction network model, the behavior sequence is determined by obtaining the user's historical behavior data and candidate object attribute information, and through the behavior embedding layer, low-order interest extractor, high-order interest extractor and behavior predictor , processes future time, attribute information and behavior sequences, and predicts the user's behavior towards candidate objects in the future time.
It achieves precise prediction of user behavior of candidate objects in a specific time period in the future, improves the timeliness and accuracy of recommendation services, and meets users' needs for efficient acquisition of personalized information.
Smart Images

Figure CN114880575B
Abstract
Description
Technical Field
[0001] The present invention relates to technical fields such as behavior prediction and machine learning, and in particular to a user behavior prediction method, device, equipment, medium and product. Background Art
[0002] Since the 21st century, with the rapid development of information, Internet and other technologies, various Internet products have emerged continuously, the content in the network environment has become richer, and the amount of information has grown very fast. The personalized information that users really need is submerged in a large amount of useless information, making it difficult for users to find it efficiently. As one of the effective solutions to the above problems, the recommendation system can effectively learn the user's internal behavior patterns based on the user's historical behavior records, accurately capture the user's interests, and then predict the user's future behavior. At the same time, the recommendation system's advantages in accurate content distribution are also very obvious, and it can connect information and users more effectively. In recent years, with the rapid development of Internet applications, recommendation systems have been applied to all aspects of people's lives, such as shopping, news, live broadcasts, takeout, and videos.
[0003] In video content, especially video on demand scenarios, users' video clicks and viewing behaviors are significantly affected by time. However, previous recommendation algorithms rarely take the impact of target prediction time into account when predicting users' future behaviors (including clicks, views, etc.). In other words, previous recommendation algorithms only predict whether users will interact with candidate videos in the future, but do not limit or predict the time when the behavior will occur. It is impossible to give the probability of users clicking on candidate videos at a specific time in the future (such as within a certain time period of a day), and the timeliness of the recommendation service cannot be effectively guaranteed.
[0004] Therefore, how to achieve, for example, predicting the probability of a user clicking on a candidate video at a specific time in the future becomes a technical problem that needs to be solved urgently. Summary of the invention
[0005] The present invention provides a user behavior prediction method, device, equipment, medium and product to solve the defects in the prior art, such as the inability to predict the probability of a user clicking on a candidate object (such as a product, video, etc.) at a specific moment or time period in the future, and to predict the user's execution of a preset behavior on the candidate object at a specific moment or time period in the future.
[0006] The present invention provides a user behavior prediction method, comprising:
[0007] Obtain multiple historical behavior data pairs of users;
[0008] Obtaining future time and attribute information of candidate objects;
[0009] Determine a behavior sequence based on a future time and multiple historical behavior data pairs;
[0010] By extracting a network model of user interests based on time perception, the future time, attribute information and behavior sequence are processed to obtain a predicted value of the user performing a preset behavior on the candidate object in the future time; the future time is a future moment or a future period.
[0011] According to a user behavior prediction method provided by the present invention, each historical behavior data pair includes: attribute information of a historical object and the historical time when a user performs a preset behavior on the historical object; based on the future time and multiple historical behavior data pairs, determining a behavior sequence includes:
[0012] Based on historical time, multiple historical behavior data pairs are sorted and processed to obtain a historical sequence;
[0013] For each data pair in the historical sequence, attribute information of the historical object in the data pair, a first time interval between the historical time in the data pair and the historical time in a previous data pair of the data pair, and a second time interval between the future time and the historical time in the data pair are determined as a target pair corresponding to the data pair;
[0014] The behavior sequence includes a target pair corresponding to each data pair in the history sequence.
[0015] According to a user behavior prediction method provided by the present invention, a user interest extraction network model based on time perception includes: a behavior embedding layer, a low-order interest extractor, a high-order interest extractor, an interest fusion layer and a behavior predictor;
[0016] Through the user interest extraction network model based on time perception, the future time, attribute information and behavior sequence are processed to obtain the prediction value of the user's preset behavior on the candidate object in the future time, including:
[0017] Through the behavior embedding layer, the future time is converted into a future time vector; the behavior sequence is converted into a target behavior vector; the attribute information of the candidate object is converted into a target attribute vector;
[0018] Through the low-order interest extractor, feature extraction is performed on the target behavior vector to obtain a primary interest feature vector;
[0019] Through the high-order interest extractor, the primary interest feature vector is subjected to feature extraction processing to obtain a high-order interest feature vector;
[0020] Through the interest fusion layer, the high-order interest feature vector, or the primary interest feature vector and the high-order interest feature vector are fused to obtain a fused feature vector;
[0021] The fused feature vector, future time vector and target attribute vector are processed by the behavior predictor to obtain the predicted value of the user performing the preset behavior on the candidate object in the future.
[0022] According to a user behavior prediction method provided by the present invention, the low-order interest extractor includes a plurality of sequentially connected time-aware gated recurrent units T-GRU, or includes a plurality of sequentially connected time-aware long short-term memory networks T-LSTM.
[0023] According to a user behavior prediction method provided by the present invention, the calculation method of T-GRU is:
[0024]
[0025] Among them, h t-1 represents the output of the previous T-GRU connected to T-GRU, x t Represents the vector representation corresponding to the attribute information of the historical object input to T-GRU, The vector representation of the first time interval input to T-GRU, The vector representation of the second time interval of the input T-GRU, u t represents the output of the update gate σ1 in T-GRU, r t represents the output of the reset gate σ2 in T-GRU, t il and t in Respectively and In the vector representation of the T-GRU model feature space, t sl represents the output of the time-aware gate σ3 in T-GRU, t sn represents the output of the time-aware gate σ4 in T-GRU, h′ t Indicates that h t The middle value of tanh represents the hyperbolic tangent function, h t Represents the output of T-GRU. The subscript t in the calculation method of T-GRU represents the current time step, the subscript t-1 represents the previous time step, and W u , W r , W ti , W sl , W tsl , W sn , W tsn , W h , b u , b r , b ti , b sl , b sn and b h is the hyperparameter of T-GRU.
[0026] According to a user behavior prediction method provided by the present invention, the calculation method of T-LSTM is:
[0027]
[0028] Among them, h t-1 and c t-1 is the output of the previous T-LSTM connected to the T-LSTM, x t The vector representation corresponding to the attribute information of the historical object input to T-LSTM, The vector representation of the first time interval input to T-LSTM, The vector representation of the second time interval input to T-LSTM, f t is the output of the forget gate σ1 in T-LSTM, i t is the output of the input gate σ2 in T-LSTM, t il and t in express and In the vector representation of the T-LSTM model feature space, t sl represents the output of the time-aware gate σ4 in T-LSTM, t sn represents the output of the time-aware gate σ5 in T-LSTM, t ol and t on t il and t in The vector representation after mapping transformation is: is the candidate value vector, o t is the output of the output gate σ3 in T-LSTM, c t and h t is the output of T-LSTM, tanh represents the hyperbolic tangent function, the subscript t in the calculation method of T-LSTM represents the current time step, the subscript t-1 represents the previous time step, and W f , W i , W ti , W sl , W tsl , W sn , W tsn , W to , W c , W o , W ot , b f , b i , b ti , b sl , b sn , b c and b o is the hyperparameter of T-LSTM.
[0029] According to a user behavior prediction method provided by the present invention, the high-order interest extractor includes: a position encoding module, a multi-head self-attention module, a first residual connection and normalization module, a feedforward neural network, and a second residual connection and normalization module;
[0030] The calculation method of the position encoding module is:
[0031]
[0032] Among them, pos i express The corresponding position encoding vector, PosEnc represents the encoding function of the position encoding module, represents the i-th primary vector in the primary interest feature vector, k is a positive integer, t represents the current time step, sin(·) represents the sine function, and cos(·) represents the cosine function;
[0033] The calculation method of the multi-head self-attention module is:
[0034]
[0035] Among them, O mha Represents the output of the multi-head self-attention module, MultiHeadAttention represents the function of the multi-head self-attention module, I mha The input of the multi-head self-attention module is represented by I mha =P L +Pos,P L represents the primary interest feature vector, Pos represents the position encoding vector (including all pos i ), Concatenate represents the concatenation function, head i is the output of the i-th self-attention head in the multi-head self-attention module. Attention represents the function of each attention head. Q i , K i and V i Represent the Query vector, Key vector and Value vector of the i-th self-attention head respectively, is the hyperparameter of the i-th self-attention head, Q represents the Query vector, K represents the Key vector, V represents the Key vector, 1≤i≤h, h represents the number of high-order vectors included in the high-order interest feature vector, is the arithmetic square root of the dimension of the primary vector in the primary interest feature vector;
[0036] The comprehensive model of the first residual connection and normalization module, the feedforward neural network and the second residual connection and normalization module is:
[0037]
[0038] Among them, O an represents the output of the first residual connection and normalization module, LayerNorm1 represents the layer normalization function of the first residual connection and normalization module, Dropout represents the preset processing function, W Q The multiple self-attention heads in the multi-head self-attention module Splicing, O f represents the high-order interest feature vector output by the high-order interest extractor, LayerNorm2 represents the layer normalization function of the second residual connection and normalization module, and FFN represents the function of the feedforward neural network.
[0039] According to a user behavior prediction method provided by the present invention, the interest fusion layer has an average pooling fusion strategy, an attention weighted fusion strategy, a direct splicing fusion strategy or an adaptive weighted fusion strategy;
[0040] The calculation method of the average pooling fusion strategy is:
[0041]
[0042] The calculation method of the attention weighted fusion strategy is:
[0043]
[0044] The calculation method of the direct splicing fusion strategy is:
[0045]
[0046] The calculation method of the adaptive weighted fusion strategy is:
[0047]
[0048] Among them, p f represents the fused feature vector, h represents the number of high-order vectors included in the high-order interest feature vector, ∑· represents the summation function, Represents the jth high-order vector in the high-order interest feature vector, alpha j express The corresponding weight, for or The square root of the dimension of represents the last primary-order vector in the primary-order interest feature vector, Concatenate represents the concatenation function, α represents the adaptive weighting coefficient in the adaptive weighted fusion strategy, σ(·) represents the sigmoid activation function, and W, b are the model hyperparameters in the adaptive formaldehyde fusion strategy.
[0049] According to a user behavior prediction method provided by the present invention, the number of candidate objects is multiple, and the method further includes:
[0050] According to the predicted value of the user performing a preset behavior on each candidate object at a future time, multiple candidate objects are sorted to obtain a candidate sequence, and the candidate sequence is output; the candidate sequence includes multiple candidate objects sorted according to the predicted value.
[0051] The present invention also provides a user behavior prediction device, comprising:
[0052] A first acquisition module, used to acquire multiple historical behavior data pairs of a user;
[0053] The second acquisition module is used to acquire attribute information of future time and candidate objects;
[0054] A determination module, for determining a behavior sequence based on a future time and a plurality of historical behavior data pairs;
[0055] The prediction module is used to process future time, attribute information and behavior sequence through the user interest extraction network model based on time perception, and obtain the prediction value of the user performing the preset behavior on the candidate object in the future time; the future time is a future moment or a future period.
[0056] According to a user behavior prediction device provided by the present invention, each historical behavior data pair includes: attribute information of a historical object and the historical time when the user performs a preset behavior on the historical object; the determination module is specifically used for:
[0057] Based on historical time, multiple historical behavior data pairs are sorted and processed to obtain a historical sequence;
[0058] For each data pair in the historical sequence, attribute information of the historical object in the data pair, a first time interval between the historical time in the data pair and the historical time in a previous data pair of the data pair, and a second time interval between the future time and the historical time in the data pair are determined as a target pair corresponding to the data pair;
[0059] The behavior sequence includes a target pair corresponding to each data pair in the history sequence.
[0060] According to a user behavior prediction device provided by the present invention, a user interest extraction network model based on time perception includes: a behavior embedding layer, a low-order interest extractor, a high-order interest extractor, an interest fusion layer and a behavior predictor; the prediction module is specifically used for:
[0061] Through the behavior embedding layer, the future time is converted into a future time vector; the behavior sequence is converted into a target behavior vector; the attribute information of the candidate object is converted into a target attribute vector;
[0062] Through the low-order interest extractor, feature extraction is performed on the target behavior vector to obtain a primary interest feature vector;
[0063] Through the high-order interest extractor, the primary interest feature vector is subjected to feature extraction processing to obtain a high-order interest feature vector;
[0064] Through the interest fusion layer, the high-order interest feature vector, or the primary interest feature vector and the high-order interest feature vector are fused to obtain a fused feature vector;
[0065] The fused feature vector, future time vector and target attribute vector are processed by the behavior predictor to obtain the predicted value of the user performing the preset behavior on the candidate object in the future.
[0066] According to a user behavior prediction device provided by the present invention, the low-order interest extractor includes a plurality of sequentially connected time-aware gated recurrent units T-GRU, or includes a plurality of sequentially connected time-aware long short-term memory networks T-LSTM.
[0067] According to a user behavior prediction device provided by the present invention, the calculation method of T-GRU is:
[0068]
[0069] Among them, h t-1 represents the output of the previous T-GRU connected to T-GRU, x t Represents the vector representation corresponding to the attribute information of the historical object input to T-GRU, The vector representation of the first time interval input to T-GRU, The vector representation of the second time interval of the input T-GRU, u t represents the output of the update gate σ1 in T-GRU, r t represents the output of the reset gate σ2 in T-GRU, t il and t in Respectively and In the vector representation of the T-GRU model feature space, t sl represents the output of the time-aware gate σ3 in T-GRU, t sn represents the output of the time-aware gate σ4 in T-GRU, h′ t Indicates that h t The middle value of tanh represents the hyperbolic tangent function, ht Represents the output of T-GRU. The subscript t in the calculation method of T-GRU represents the current time step, the subscript t-1 represents the previous time step, and W u , W r , W ti , W sl , W tsl , W sn , W ts , W h , b u , b r , b ti , b sl , b sn and b h is the hyperparameter of T-GRU.
[0070] According to a user behavior prediction device provided by the present invention, the calculation method of T-LSTM is:
[0071]
[0072] Among them, h t-1 and c t-1 is the output of the previous T-LSTM connected to the T-LSTM, x t The vector representation corresponding to the attribute information of the historical object input to T-LSTM, The vector representation of the first time interval input to T-LSTM, The vector representation of the second time interval input to T-LSTM, f t is the output of the forget gate σ1 in T-LSTM, i t is the output of the input gate σ2 in T-LSTM, t il and t in express and In the vector representation of the T-LSTM model feature space, t sl represents the output of the time-aware gate σ4 in T-LSTM, t sn represents the output of the time-aware gate σ5 in T-LSTM, t ol and t on t il and t in The vector representation after mapping transformation is: is the candidate value vector, o t is the output of the output gate σ3 in T-LSTM, c t and h t is the output of T-LSTM, tanh represents the hyperbolic tangent function, the subscript t in the calculation method of T-LSTM represents the current time step, the subscript t-1 represents the previous time step, and Wf , W i , W ti , W sl , W tsl , W sn , W tsn , W to , W c , W o , W ot、 b f , b i , b ti , b sl , b sn , b c and b o is the hyperparameter of T-LSTM.
[0073] According to a user behavior prediction device provided by the present invention, the high-order interest extractor includes: a position encoding module, a multi-head self-attention module, a first residual connection and normalization module, a feedforward neural network, and a second residual connection and normalization module;
[0074] The calculation method of the position encoding module is:
[0075]
[0076] Among them, pos i express The corresponding position encoding vector, PosEnc represents the encoding function of the position encoding module, represents the i-th primary vector in the primary interest feature vector, k is a positive integer, t represents the current time step, sin(·) represents the sine function, and cos(·) represents the cosine function;
[0077] The calculation method of the multi-head self-attention module is:
[0078]
[0079] Among them, O mha Represents the output of the multi-head self-attention module, MultiHeadAttention represents the function of the multi-head self-attention module, I mha The input of the multi-head self-attention module is represented by I mha =P L +Pos,P L represents the primary interest feature vector, Pos represents the position encoding vector (including all pos i ), Concatenate represents the concatenation function, head iis the output of the i-th self-attention head in the multi-head self-attention module. Attention represents the function of each attention head. Q i , K i and V i Represent the Query vector, Key vector and Value vector of the i-th self-attention head respectively, is the hyperparameter of the i-th self-attention head, Q represents the Query vector, K represents the Key vector, V represents the Key vector, 1≤i≤h, h represents the number of high-order vectors included in the high-order interest feature vector, is the arithmetic square root of the dimension of the primary vector in the primary interest feature vector;
[0080] The comprehensive model of the first residual connection and normalization module, the feedforward neural network and the second residual connection and normalization module is:
[0081]
[0082] Among them, O an represents the output of the first residual connection and normalization module, LayerNorm1 represents the layer normalization function of the first residual connection and normalization module, Dropout represents the preset processing function, W Q The multiple self-attention heads in the multi-head self-attention module Splicing, O f represents the high-order interest feature vector output by the high-order interest extractor, LayerNorm2 represents the layer normalization function of the second residual connection and normalization module, and FFN represents the function of the feedforward neural network.
[0083] According to a user behavior prediction device provided by the present invention, the interest fusion layer has an average pooling fusion strategy, an attention weighted fusion strategy, a direct splicing fusion strategy or an adaptive weighted fusion strategy;
[0084] The calculation method of the average pooling fusion strategy is:
[0085]
[0086] The calculation method of the attention weighted fusion strategy is:
[0087]
[0088] The calculation method of the direct splicing fusion strategy is:
[0089]
[0090] The calculation method of the adaptive weighted fusion strategy is:
[0091]
[0092] Among them, p f represents the fused feature vector, h represents the number of high-order vectors included in the high-order interest feature vector, ∑· represents the summation function, Represents the jth high-order vector in the high-order interest feature vector, alpha j express The corresponding weight, for or The square root of the dimension of represents the last primary-order vector in the primary-order interest feature vector, Concatenate represents the concatenation function, α represents the adaptive weighting coefficient in the adaptive weighted fusion strategy, σ(·) represents the sigmoid activation function, and W, b are the model hyperparameters in the adaptive formaldehyde fusion strategy.
[0093] According to a user behavior prediction device provided by the present invention, the number of candidate objects is multiple, and the device also includes: a sorting processing module, which is used to sort the multiple candidate objects according to the predicted value of the user performing a preset behavior on each candidate object at a future time, obtain a candidate sequence, and output the candidate sequence; the candidate sequence includes the multiple candidate objects sorted according to the predicted value.
[0094] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned user behavior prediction methods is implemented.
[0095] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the computer program implements any of the user behavior prediction methods described above.
[0096] The present invention also provides a computer program product, including a computer program, which implements any of the above-mentioned user behavior prediction methods when executed by a processor.
[0097] The present invention provides a user behavior prediction method, device, equipment, medium and product. In the user behavior prediction method, a behavior sequence is determined based on future time and multiple historical behavior data pairs. By extracting a user interest network model based on time perception, the future time, attribute information and behavior sequence are processed to obtain a prediction value of the user's execution of a preset behavior on a candidate object at a future time, thereby predicting the user's execution of a preset behavior on a candidate object at a future time. BRIEF DESCRIPTION OF THE DRAWINGS
[0098] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0099] Figure 1 A flowchart of the user behavior prediction method provided by the invention;
[0100] Figure 2 One of the structural schematic diagrams of the model of the time-aware user interest extraction network model provided by the present invention;
[0101] Figure 3 The second structural diagram of the model of the time-aware user interest extraction network model provided by the present invention;
[0102] Figure 4 A schematic diagram of the structure of the T-GRU provided by the present invention;
[0103] Figure 5 A schematic diagram of the structure of the T-LSTM provided by the present invention;
[0104] Figure 6 A schematic diagram of the structure of a high-order interest extractor provided by the present invention;
[0105] Figure 7 This is one of the structural schematic diagrams of the user behavior prediction device provided by the present invention;
[0106] Figure 8 The second structural diagram of the user behavior prediction device provided by the present invention;
[0107] Fig. 9 A schematic diagram of the physical structure of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0108] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0109] It should be noted that the features shown in the figures are not necessarily drawn to scale. The present invention omits the description of known materials, components and process technologies so as not to obscure the exemplary embodiments of the present invention. The examples given are only intended to facilitate understanding of the implementation of the exemplary embodiments of the present invention, and to further enable those skilled in the art to implement the exemplary embodiments. Thus, these examples should not be construed as limiting the scope of the embodiments of the present invention.
[0110] Unless otherwise specifically defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. In addition, in various embodiments of the present invention, the same or similar reference numerals represent the same or similar components.
[0111] In the present invention, solving technical problems such as predicting the probability of users clicking on candidate videos at a specific time in the future becomes an urgent problem to be solved. The inventors have thought of designing a user interest extraction network model based on time perception. The user interest extraction network model based on time perception processes the future time, the attribute information of the candidate objects and the obtained behavior sequence based on historical behavior data to obtain the predicted value of the user performing the preset behavior on the candidate object in the future, thereby achieving, for example, predicting the user's click probability or viewing probability of the candidate video in the future.
[0112] The user behavior prediction method provided by the present invention is described below in conjunction with specific embodiments. Figure 1 The flowchart of the user behavior prediction method provided by the invention is as follows. Figure 1 As shown, the user behavior prediction method includes:
[0113] S101, obtaining multiple historical behavior data pairs of a user.
[0114] The plurality of historical behavior data pairs are recorded based on platforms such as content distribution and / or object recommendation.
[0115] Each historical behavior data pair includes attribute information of the historical object and the historical time when the user performs a preset behavior on the historical object.
[0116] Historical objects can be products, videos, audios, advertisements, etc.
[0117] When the historical object is a video, the attribute information of the historical object may include at least one of the video ID, video category, clarity, video length, related characters (such as director, actors, etc.), whether payment is required, release time, and content synopsis or introduction.
[0118] The historical time may be the start time when the user executes a preset action on the historical object.
[0119] Optionally, the preset behavior may be a touch behavior (eg, a click behavior, etc.) performed by a user (eg, through a mouse or other device).
[0120] S102, obtaining attribute information of future time and candidate objects.
[0121] The future time is the time that is after the historical time and has not yet arrived. For example, the future time may be a future moment or a future period.
[0122] The candidate object and the historical object may be the same. For example, if the historical object is a commodity, the candidate object is the commodity. For example, if the historical object is a video, the candidate object is the video.
[0123] When the historical object and the candidate object are, for example, videos, the historical object and the candidate object may be different videos or the same video.
[0124] The attribute information of the candidate object corresponds to the attribute information of the history object. For example, when the attribute information of the history object includes a video ID, the attribute information of the candidate object also includes the video ID.
[0125] It should be noted that in the intelligent recommendation application scenario, the candidate object is an object among multiple candidate objects, and in the precise content distribution application scenario, the candidate object is an object carrying information such as video, picture or voice that needs to be distributed.
[0126] S103, determining a behavior sequence based on the future time and multiple historical behavior data pairs.
[0127] In some embodiments, when each historical behavior data pair includes attribute information of a historical object and a historical time when a user performs a preset behavior on the historical object, S103 specifically includes: sorting the plurality of historical behavior data pairs based on the historical time to obtain a historical sequence;
[0128] For each data pair in the historical sequence, attribute information of the historical object in the data pair, a first time interval between the historical time in the data pair and the historical time in the previous data pair of the data pair, and a second time interval between the future time and the historical time in the data pair are determined as a target pair corresponding to the data pair; the behavior sequence includes the target pair corresponding to each data pair in the historical sequence.
[0129] For example, when the total number of multiple historical behavior data pairs is l, the multiple historical behavior data pairs are sorted according to the order of historical time to obtain the historical sequence shown in the following formula 1:
[0130] Seq u ={(v1,t1),(v2,t2),...,(v l , t l )} Formula 1;
[0131] Among them, Seq u represents the historical sequence of user u, (v i , t i ) represents the historical behavior data pair, v i Represents the attribute information of the historical object, t i Indicates the historical time when the user performs the preset behavior on the historical object, 1≤i≤l, l is a positive integer not less than 2, t1<t2<…<t i <…<t l .
[0132] For the i-th data pair in the historical sequence, based on Formula 1, Formula 2 is used to obtain the first time interval:
[0133]
[0134] in, represents the first time interval, t i represents the historical time of the i-th data pair in the historical sequence, t i-1 Indicates the historical time in the i-1th data pair (i.e., the previous data pair of the i-th data pair) in the historical sequence. Initially, i=0, t0=0.
[0135] For the i-th data pair in the historical sequence, based on Formula 1, Formula 3 is used to obtain the second time interval:
[0136]
[0137] in, represents the second time interval, t target Indicates future time.
[0138] Furthermore, based on Formula 1, Formula 2, and Formula 3, the behavior sequence shown in Formula 4 is obtained:
[0139]
[0140] Among them, S u Represents a sequence of behaviors, is the same as (v1, t1), ..., (v l , t l ) corresponding to the target pair.
[0141] S104, extracting a network model of user interests based on time perception, processing future time, attribute information and behavior sequence, and obtaining a prediction value of the user performing a preset behavior on the candidate object at a future time.
[0142] In the user behavior prediction method provided in the embodiment of FIG. 1, based on the future time and multiple historical behavior data pairs, the behavior sequence is determined, and the future time, attribute information and behavior sequence are processed by extracting the network model of user interest based on time perception, so as to obtain the prediction value of the user performing the preset behavior on the candidate object in the future time, thereby realizing the prediction of the user performing the preset behavior on the candidate object in the future time (for example, predicting the probability of the user clicking on the candidate video in the future time). In the present invention, it is possible to predict the execution of the preset behavior on the candidate object in the future time, and improve the fineness of the prediction granularity. In addition, the accuracy of estimating the prediction value obtained by using the present application based on the preset standard parameters (for example, including accuracy, precision, recall, AUC (Area Under Curve of ROC) and F1 value) is higher than the accuracy of estimating the prediction value obtained by using other methods based on the above-mentioned preset standard parameters. Therefore, the user behavior prediction method provided by the present invention can improve the accuracy of the obtained prediction value, thereby improving the accuracy of predicting the user performing the preset behavior on the candidate object in the future time.
[0143] Combine the following Figure 2 and Figure 3 The embodiment describes a model for extracting a user interest network model based on time perception.
[0144] Figure 2 This is one of the structural diagrams of the model of the time-aware user interest extraction network model provided by the present invention. Figure 2 As shown in Figure 1, the user interest extraction network model based on time perception includes: behavior embedding layer, low-order interest extractor, high-order interest extractor, interest fusion layer and behavior predictor. Figure 2 In the CNN, the low-order interest extractor includes l sequentially connected time-aware gated recurrent units (T-GRU).
[0145] Figure 3 The second structural diagram of the model of the time-aware user interest extraction network model provided by the present invention. Figure 3 As shown in Figure 1, the user interest extraction network model based on time perception includes: behavior embedding layer, low-order interest extractor, high-order interest extractor, interest fusion layer and behavior predictor. Figure 3In the proposed method, the low-order interest extractor includes l sequentially connected time-aware long-short term memory networks (T-LSTM).
[0146] exist Figure 2 and Figure 3 In the figure, the high-level interest extractor includes the Transformer network layer. Figure 2 and Figure 3 The time-aware user interest extraction network models shown can obtain the predicted value of the user performing a preset behavior on the candidate object in the future through the following method.
[0147] First, through the behavior embedding layer, the future time is converted into a future time vector, the behavior sequence is converted into a target behavior vector, and the attribute information of the candidate object is converted into a target attribute vector.
[0148] For example, the future time t target Convert to future time vector t tar ; The behavior sequence S u Convert to target behavior vector The attribute information v of the candidate object candidaete Convert to target attribute vector
[0149] Optionally, t tar It can contain attribute values such as month, date, day of the week, whether it is a holiday, etc.
[0150] For the corresponding The vector representation of .
[0151] For the corresponding The vector representation of .
[0152] Among them, dim v for The respective dimensions,∈ indicates belonging to.
[0153] Optionally, dim can be designed according to actual needs v The specific value of .
[0154] Optionally, a time vector corresponding to the time is obtained by normalization or softmax logistic regression.
[0155] For example, in the time series seqT = {T1, T2, ..., T l}、The dimension of the time vector is dim t In this case, for time T in seqTi , by normalizing formula 5, we get T i The corresponding normalized value T′ i :
[0156]
[0157] Among them, min represents the minimum value function, and max represents the maximum value function.
[0158] T i The j-th dimension data in the time vector corresponding to ′ can be obtained using Formula 6:
[0159]
[0160] in, Indicates T i The j-th dimension data in the corresponding time vector, Indicates The intermediate value of , ε represents the preset modified positive value, and e represents the natural constant.
[0161] It should be noted that in the behavior sequence In the other case, seqT is equal to To get Another seqT is equal to To get
[0162] Next, the target behavior vector is subjected to feature extraction processing through a low-order interest extractor to obtain a primary interest feature vector.
[0163] In the target behavior vector In the case of , after feature extraction processing by the low-order interest extractor, the primary interest feature vector is obtained in, It is the initial-order vector obtained by feature extraction processing of the i-th T-GRU or i-th T-LSTM in the low-order interest extractor.
[0164] Secondly, the primary interest feature vector is subjected to feature extraction processing by a high-order interest extractor to obtain a high-order interest feature vector.
[0165] Specifically, the high-order interest extractor captures the synergistic influence between multiple primary-order vectors in the primary-order interest feature vector to obtain a high-order interest feature vector represents the jth high-order vector in the high-order interest feature vector, and h represents P H The number of high-order vectors included in . Optionally, the specific value of h can be designed according to actual needs.
[0166] Thirdly, the high-order interest feature vector, or the primary-order interest feature vector and the high-order interest feature vector are fused through the interest fusion layer to obtain a fused feature vector.
[0167] In some embodiments, when a fused feature vector is obtained by fusing a high-order interest feature vector through an interest fusion layer, the interest fusion layer used is a fusion layer with an average pooling fusion strategy.
[0168] For example, the calculation method of the average pooling fusion strategy is:
[0169]
[0170] Among them, p f represents the fused feature vector, AveragePooling represents the average pooling fusion strategy function, and ∑· represents the summation function.
[0171] In some embodiments, when the primary interest feature vector and the high-order interest feature vector are fused through the interest fusion layer to obtain a fused feature vector, the interest fusion layer is a fusion layer with an attention weighted fusion strategy, a direct splicing fusion strategy, or an adaptive weighted fusion strategy.
[0172] The calculation method of the attention weighted fusion strategy is:
[0173]
[0174] Among them, alpha j express The corresponding weight, For the primary vector (e.g. ) or higher-order vectors (such as ), Represents the last primary-order vector in the primary-order interest feature vector.
[0175] The calculation method of the direct splicing fusion strategy is:
[0176]
[0177] Among them, Concatenate represents the concatenation function.
[0178] The calculation method of the adaptive weighted fusion strategy is:
[0179]
[0180] Among them, σ(·) represents the sigmoid activation function, W,b are the model hyperparameters of the learnable interest fusion layer, and α represents the adaptive weighting coefficient in the adaptive weighted fusion strategy.
[0181] In the present invention, the fusion strategy of the interest fusion layer can be an average pooling fusion strategy, an attention weighted fusion strategy, a direct splicing fusion strategy or an adaptive weighted fusion strategy, so that the fusion strategy of the interest fusion layer has diversity and improves the flexibility of obtaining the fusion feature vector.
[0182] Finally, the fused feature vector, future time vector, and target attribute vector are processed by the behavior predictor to obtain the predicted value of the user performing the preset behavior on the candidate object at a future time.
[0183] The behavior predictor includes a splicing layer, a multi-layer perceptron (MLP), and an output layer connected in sequence. The splicing layer is used to splice the fused feature vector, the future time vector, and the target attribute vector. The MLP is used to predict the output information of the splicing layer to obtain the predicted value. The output layer is used to output the predicted value.
[0184] Specifically, the behavior predictor uses the following formula 11 to obtain the predicted value of the user performing a preset behavior on the candidate object in the future:
[0185]
[0186] in, It represents the predicted value of the user's preset behavior on the candidate object in the future, FUN represents the prediction function of MLP, and Concatenate represents the concatenation function of the concatenation layer.
[0187] In some embodiments, MLP may be replaced by a gradient boosting decision tree (GBDT), etc. In the case where MLP is replaced by GBDT, FUN represents the prediction function of GBDT.
[0188] In some embodiments, when the predicted value is not less than the preset threshold, it indicates that the user will perform the preset behavior on the candidate object at a future time. When the predicted value is less than the preset threshold, it indicates that the user will not perform the preset behavior on the candidate object at a future time.
[0189] In some embodiments, there are multiple candidate objects, and the user behavior prediction method provided by the present invention may further include:
[0190] According to the predicted value of the user performing a preset behavior on each candidate object at a future time, multiple candidate objects are sorted to obtain a candidate sequence, and the candidate sequence is output; the candidate sequence includes multiple candidate objects sorted according to the predicted value.
[0191] In the present invention, in the intelligent recommendation application scenario and the precise content distribution application scenario, after obtaining the candidate sequence, the subsequent business process of the candidate sequence can be performed in combination with the actual business logic of the intelligent recommendation application scenario and the precise content distribution application scenario.
[0192] In some embodiments, a high-order interest feature vector, or a primary interest feature vector and a high-order interest feature vector are fused through an interest fusion layer to obtain a fused feature vector, including: determining a target fusion strategy corresponding to the total number of multiple historical behavior data pairs based on a pre-stored first mapping relationship; and a high-order interest feature vector, or a primary interest feature vector and a high-order interest feature vector are fused through an interest fusion layer with a target fusion strategy to obtain a fused feature vector.
[0193] Among them, the first mapping relationship includes multiple quantity ranges and the fusion strategy corresponding to each quantity range, the target fusion strategy is the fusion strategy corresponding to the target quantity range where the total quantity is located, and the multiple quantity ranges include the target quantity range.
[0194] The target fusion strategy can be an average pooling fusion strategy, an attention weighted fusion strategy, a direct concatenation fusion strategy, or an adaptive weighted fusion strategy.
[0195] In the present invention, a target fusion strategy corresponding to the total number of multiple historical behavior data pairs is determined, and a high-order interest feature vector, or a primary interest feature vector and a high-order interest feature vector are fused through an interest fusion layer with a target fusion strategy to obtain a fused feature vector, which can improve the accuracy and computational efficiency of the obtained fused feature vector.
[0196] In some embodiments, the high-order interest feature vector, or the primary-order interest feature vector and the high-order interest feature vector are fused through the interest fusion layer to obtain a fused feature vector, including:
[0197] The high-order interest feature vector is fused through an interest fusion layer with an average pooling fusion strategy to obtain a first fused feature vector;
[0198] The primary interest feature vector and the high-order interest feature vector are fused through an interest fusion layer with an attention weighted fusion strategy to obtain a second fused feature vector;
[0199] The primary interest feature vector and the high-order interest feature vector are fused through an interest fusion layer with a direct concatenation fusion strategy to obtain a third fused feature vector;
[0200] The primary-order interest feature vector and the high-order interest feature vector are fused through an interest fusion layer with an adaptive weighted fusion strategy to obtain a fourth fused feature vector.
[0201] Furthermore, through the behavior predictor, the first fused feature vector, the future time vector and the target attribute vector are processed to obtain a first prediction value of the user performing a preset behavior on the candidate object at a future time; the second fused feature vector, the future time vector and the target attribute vector are processed to obtain a second prediction value of the user performing the preset behavior on the candidate object at a future time; the third fused feature vector, the future time vector and the target attribute vector are processed to obtain a third prediction value of the user performing the preset behavior on the candidate object at a future time; the fourth fused feature vector, the future time vector and the target attribute vector are processed to obtain a fourth prediction value of the user performing the preset behavior on the candidate object at a future time.
[0202] Optionally, an average of the first prediction value, the second prediction value, the third prediction value, and the fourth prediction value is determined as a prediction value for the user to perform a preset behavior on the candidate object at a future time.
[0203] Optionally, the maximum value among the first prediction value, the second prediction value, the third prediction value, and the fourth prediction value is determined as the prediction value of the user performing a preset behavior on the candidate object at a future time.
[0204] Optionally, the sum of the product of the first prediction value and the first weight, the product of the second prediction value and the second weight, the product of the third prediction value and the third weight, and the product of the fourth prediction value and the fourth weight is determined as the prediction value of the user performing the preset behavior on the candidate object at a future time. The sum of the first weight, the second weight, the third weight, and the fourth weight is equal to 1.
[0205] In the present invention, the above average value, maximum value, or sum value is determined as the predicted value of the user performing the preset behavior on the candidate object at the future time, which can improve the accuracy of the predicted value of the user performing the preset behavior on the candidate object at the future time.
[0206] In some embodiments, a behavior predictor is used to process the fused feature vector, the future time vector, and the target attribute vector to obtain a prediction value of the user performing a preset behavior on the candidate object in the future, including: determining a target prediction model corresponding to the total number of attribute values included in the attribute information based on a pre-stored second mapping relationship; a behavior predictor having a target prediction model is used to process the fused feature vector, the future time vector, and the target attribute vector to obtain a prediction value of the user performing a preset behavior on the candidate object in the future. The second mapping relationship includes multiple quantity ranges and prediction models corresponding to each quantity range, the target prediction model is a prediction model corresponding to the target quantity range where the total number of attribute values is located, and the multiple quantity ranges include the target quantity range;
[0207] Optionally, the target prediction model can be MLP or GBDT.
[0208] For example, when the target number range of the total number of attribute values is (0, 1], the target prediction model is MLP, and when the target number range of the total number of attribute values is not (0, 1], the target prediction model is GBDT.
[0209] In the present invention, based on a pre-stored second mapping relationship, a target prediction model corresponding to the total number of attribute values included in the attribute information is determined; a behavior predictor having a target prediction model is used to process the fused feature vector, the future time vector, and the target attribute vector to obtain a predicted value of a user performing a preset behavior on a candidate object at a future time, so that the total number of attribute values can be matched with the target prediction model, thereby improving the accuracy of the predicted value.
[0210] exist Figure 2 Based on the following Figure 4 The structure of T-GRU is explained.
[0211] Figure 4 This is a schematic diagram of the structure of the T-GRU provided by the present invention. Figure 4 As shown in Figure 2, T-GRU is obtained by adding a time-aware gate to the gated recurrent unit. The structure of the introduced time-aware gate (including σ3 and σ4) is shown in Figure 2. Figure 4 Draw with dotted lines.
[0212] The calculation formula of the time-aware gate is:
[0213]
[0214] exist Figure 4 In , the introduced time-aware gate can introduce the influence of time information into the output state of the gated recurrent unit.
[0215] Furthermore, based on formula 12, the calculation formula of T-GRU can be obtained as follows:
[0216]
[0217] Among them, h t-1 represents the output of the previous T-GRU connected to T-GRU, x t Represents the vector representation corresponding to the attribute information of the historical object input to T-GRU, The vector representation of the first time interval input to T-GRU, The vector representation of the second time interval of the input T-GRU, u t represents the output of the update gate σ1 in T-GRU, r trepresents the output of the reset gate σ2 in T-GRU, t il and t in Respectively and In the vector representation of the T-GRU model feature space, t sl represents the output of the time-aware gate σ3 in T-GRU, t sn represents the output of the time-aware gate σ4 in T-GRU, h′ t Indicates that h t The middle value of tanh represents the hyperbolic tangent function, h t Represents the output of T-GRU. The subscript t in the calculation method of T-GRU represents the current time step, the subscript t-1 represents the previous time step, and W u , W r , W ti , W sl , W tsl , W sn , W tsn , W h , b u , b r , b ti、 b sl , b sn and b h is the hyperparameter of T-GRU.
[0218] exist Figure 2 Based on the following Figure 5 The structure of T-LSTM is described below.
[0219] Figure 5 This is a schematic diagram of the structure of the T-LSTM provided by the present invention. Figure 5 As shown in Figure 1, T-LSTM adds a time-aware gate to the long short-term memory network. The structure of the introduced time-aware gate (including σ4 and σ5) is Figure 5 Draw with dotted lines.
[0220] Among them, the calculation formula of the time perception gate is:
[0221]
[0222] exist Figure 5 In the method, the influence of time information is introduced into the candidate state of the long short-term memory network through the time-aware gate, and the influence of time information is introduced into the output of the long short-term memory network through the output of the time-aware gate.
[0223] Based on formula 14, the calculation formula of T-LSTM is:
[0224]
[0225] Among them, h t-1 and c t-1 is the output of the previous T-LSTM connected to the T-LSTM, x t The vector representation corresponding to the attribute information of the historical object input to T-LSTM, The vector representation of the first time interval input to T-LSTM, The vector representation of the second time interval input to T-LSTM, f t is the output of the forget gate σ1 in T-LSTM, i t is the output of the input gate σ2 in T-LSTM, t il and t in express and In the vector representation of the T-LSTM model feature space, t sl represents the output of the time-aware gate σ4 in T-LSTM, t sn represents the output of the time-aware gate σ5 in T-LSTM, t ol and t on t il and t in The vector representation after mapping transformation is: is the candidate value vector, o t is the output of the output gate σ3 in T-LSTM, c t and h t is the output of T-LSTM, tanh represents the hyperbolic tangent function, the subscript t in the calculation method of T-LSTM represents the current time step, the subscript t-1 represents the previous time step, and W f , W i , W ti , W sl , W tsl , W sn , W ts , W to , W c , W o , W ot , b f , b i , b ti , b sl , b sn , b c and b o is the hyperparameter of T-LSTM.
[0226] Figure 6 The schematic diagram of the structure of the high-order interest extractor provided by the present invention is used to further explore the primary interest and capture the synergistic influence between multiple primary interests. Figure 6 As shown, the high-order interest extractor includes: a position encoding module, a multi-head self-attention module, a first residual connection and normalization module, a feedforward neural network, and a second residual connection and normalization module.
[0227] The calculation formula of the position encoding module is:
[0228]
[0229] Among them, pos i for The corresponding position encoding vector, PosEnc represents the encoding function of the position encoding module, is the i-th primary vector, k is a positive integer, t represents the current time step, sin(·) represents the sine function, and cos(·) represents the cosine function
[0230] The calculation formula of the multi-head self-attention module is:
[0231]
[0232] Among them, O mha Represents the output of the multi-head self-attention module, MultiHeadAttention represents the function of the multi-head self-attention module, I mha The input of the multi-head self-attention module is represented by I mha =P L +Pos,P L represents the primary interest feature vector, Pos represents the position encoding vector (including all pos i ), Concatenate represents the concatenation function, head i is the output of the i-th self-attention head in the multi-head self-attention module. Attention represents the function of each attention head. Q i , K i and V i Represent the Query vector, Key vector and Value vector of the i-th self-attention head respectively, is the hyperparameter of the i-th self-attention head, Q represents the Query vector, K represents the Key vector, V represents the Key vector, 1≤i≤h, h represents the number of high-order vectors included in the high-order interest feature vector, It is the arithmetic square root of the dimension of the primary vector in the primary interest feature vector.
[0233] Furthermore, the comprehensive calculation formula of the first residual connection and normalization module, the feedforward neural network and the second residual connection and normalization module is:
[0234]
[0235] Among them, O an represents the output of the first residual connection and normalization module, LayerNorm1 represents the layer normalization function of the first residual connection and normalization module, Dropout represents the preset processing function, W Q The multiple self-attention heads in the multi-head self-attention module Splicing, O f Represents the high-order interest feature vector output by the high-order interest extractor LayerNorm2 represents the layer normalization function of the second residual connection and normalization module, and FFN represents the function of the feedforward neural network.
[0236] In real application scenarios, user behavior is complex and is not only affected by superficial interests and preferences, but also driven by deeper factors. At the same time, in actual video-on-demand scenarios, there are a large number of family users, and the historical behavior of a single family user is likely to be the synergy of the interests of multiple family members. In other words, there is mutual influence between the multiple interests of a single family user. However, most of the current user representation methods, such as multi-interest representation, long-short interest representation, etc., only characterize user interests from a single dimension, without careful consideration and in-depth exploration of the mutual influence and relationship between the different interests of multiple family members, and do not take time factors into account when predicting user behavior. They cannot fully and accurately describe and characterize user interests and needs, and cannot achieve ideal prediction and recommendation effects.
[0237] In the present application, the mutual influence between multiple primary-order vectors in the primary-order interest feature vector is calculated through a high-order interest extractor, so as to achieve detailed consideration and in-depth exploration of the mutual influence and relationship between the different interests of multiple family members. In addition, when predicting user behavior, the time factor (i.e. future time) is taken into account, which fully and accurately describes and characterizes the user's interests and needs, and it is impossible to obtain an ideal prediction value, thereby achieving a better recommendation effect.
[0238] The user behavior prediction device provided by the present invention is described below. The user behavior prediction device described below and the user behavior prediction method described above can be referenced to each other.
[0239] Figure 7 This is one of the structural schematic diagrams of the user behavior prediction device provided by the present invention.
[0240] like Figure 7 As shown, the user behavior prediction device includes:
[0241] A first acquisition module 710 is used to acquire multiple historical behavior data pairs of a user;
[0242] The second acquisition module 720 is used to acquire attribute information of future time and candidate objects;
[0243] A determination module 730, for determining a behavior sequence based on a future time and a plurality of historical behavior data pairs;
[0244] The prediction module 740 is used to process the future time, attribute information and behavior sequence through the user interest extraction network model based on time perception to obtain the prediction value of the user performing the preset behavior on the candidate object at the future time; the future time is a future moment or a future period.
[0245] According to a user behavior prediction device provided by the present invention, each historical behavior data pair includes: attribute information of the historical object and the historical time when the user performs a preset behavior on the historical object; the determination module 730 is specifically used to: sort multiple historical behavior data pairs based on the historical time to obtain a historical sequence; for each data pair in the historical sequence, the attribute information of the historical object in the data pair, the first time interval between the historical time in the data pair and the historical time in the previous data pair of the data pair, and the second time interval between the future time and the historical time in the data pair are determined as the target pair corresponding to the data pair; the behavior sequence includes the target pair corresponding to each data pair in the historical sequence.
[0246] According to a user behavior prediction device provided by the present invention, a user interest extraction network model based on time perception includes: a behavior embedding layer, a low-order interest extractor, a high-order interest extractor, an interest fusion layer and a behavior predictor; the prediction module 740 is specifically used for:
[0247] Through the behavior embedding layer, the future time is converted into a future time vector; the behavior sequence is converted into a target behavior vector; the attribute information of the candidate object is converted into a target attribute vector;
[0248] Through the low-order interest extractor, feature extraction is performed on the target behavior vector to obtain a primary interest feature vector;
[0249] Through the high-order interest extractor, the primary interest feature vector is subjected to feature extraction processing to obtain a high-order interest feature vector;
[0250] Through the interest fusion layer, the high-order interest feature vector, or the primary interest feature vector and the high-order interest feature vector are fused to obtain a fused feature vector;
[0251] The fused feature vector, future time vector and target attribute vector are processed by the behavior predictor to obtain the predicted value of the user performing the preset behavior on the candidate object in the future.
[0252] According to a user behavior prediction device provided by the present invention, the low-order interest extractor includes a plurality of sequentially connected time-aware gated recurrent units T-GRU, or includes a plurality of sequentially connected time-aware long short-term memory networks T-LSTM.
[0253] According to a user behavior prediction device provided by the present invention, the calculation method of T-GRU is:
[0254]
[0255] Among them, h t-1 represents the output of the previous T-GRU connected to T-GRU, x t Represents the vector representation corresponding to the attribute information of the historical object input to T-GRU, The vector representation of the first time interval input to T-GRU, The vector representation of the second time interval of the input T-GRU, u t represents the output of the update gate σ1 in T-GRU, r t represents the output of the reset gate σ2 in T-GRU, t il and t in Respectively and In the vector representation of the T-GRU model feature space, t sl represents the output of the time-aware gate σ3 in T-GRU, t sn represents the output of the time-aware gate σ4 in T-GRU, h′ t Indicates that h t The middle value of tanh represents the hyperbolic tangent function, h t Represents the output of T-GRU. The subscript t in the calculation method of T-GRU represents the current time step, the subscript t-1 represents the previous time step, and W u , W r , W ti , W sl , W tsl , W sn , W tsn , W h , b u , b r , b ti , b sl , b sn and b h is the hyperparameter of T-GRU.
[0256] According to a user behavior prediction device provided by the present invention, the calculation method of T-LSTM is:
[0257]
[0258] Among them, h t-1 and c t-1 is the output of the previous T-LSTM connected to the T-LSTM, x t The vector representation corresponding to the attribute information of the historical object input to T-LSTM, The vector representation of the first time interval input to T-LSTM, The vector representation of the second time interval input to T-LSTM, f t is the output of the forget gate σ1 in T-LSTM, i t is the output of the input gate σ2 in T-LSTM, t il and t in express and In the vector representation of the T-LSTM model feature space, t sl represents the output of the time-aware gate σ4 in T-LSTM, t sn represents the output of the time-aware gate σ5 in T-LSTM, t ol and t on t il and t in The vector representation after mapping transformation is: is the candidate value vector, o t is the output of the output gate σ3 in T-LSTM, c t and h t is the output of T-LSTM, tanh represents the hyperbolic tangent function, the subscript t in the calculation method of T-LSTM represents the current time step, the subscript t-1 represents the previous time step, and W f , W i , W ti , W sl , W ts , W sn , W tsn , W to , W c , W o , W ot、 b f , b i , b ti , b sl , b sn , b c and b o is the hyperparameter of T-LSTM.
[0259] According to a user behavior prediction device provided by the present invention, the high-order interest extractor includes: a position encoding module, a multi-head self-attention module, a first residual connection and normalization module, a feedforward neural network, and a second residual connection and normalization module;
[0260] The calculation method of the position encoding module is:
[0261]
[0262] Among them, pos i express The corresponding position encoding vector, PosEnc represents the encoding function of the position encoding module, represents the i-th primary vector in the primary interest feature vector, k is a positive integer, t represents the current time step, sin(·) represents the sine function, and cos(·) represents the cosine function;
[0263] The calculation method of the multi-head self-attention module is:
[0264]
[0265] Among them, O mha Represents the output of the multi-head self-attention module, MultiHeadAttention represents the function of the multi-head self-attention module, I mha The input of the multi-head self-attention module is represented by I mha =P L +Pos,P L represents the primary interest feature vector, Pos represents the position encoding vector (including all pos i ), Concatenate represents the concatenation function, head i is the output of the i-th self-attention head in the multi-head self-attention module. Attention represents the function of each attention head. Q i , K i and V i Represent the Query vector, Key vector and Value vector of the i-th self-attention head respectively, is the hyperparameter of the i-th self-attention head, Q represents the Query vector, K represents the Key vector, V represents the Key vector, 1≤i≤h, h represents the number of high-order vectors included in the high-order interest feature vector, is the arithmetic square root of the dimension of the primary vector in the primary interest feature vector;
[0266] The comprehensive model of the first residual connection and normalization module, the feedforward neural network and the second residual connection and normalization module is:
[0267]
[0268] Among them, O an represents the output of the first residual connection and normalization module, LayerNorm1 represents the layer normalization function of the first residual connection and normalization module, Dropout represents the preset processing function, W Q The multiple self-attention heads in the multi-head self-attention module Splicing, O f represents the high-order interest feature vector output by the high-order interest extractor, LayerNorm2 represents the layer normalization function of the second residual connection and normalization module, and FFN represents the function of the feedforward neural network.
[0269] According to a user behavior prediction device provided by the present invention, the interest fusion layer has an average pooling fusion strategy, an attention weighted fusion strategy, a direct splicing fusion strategy or an adaptive weighted fusion strategy;
[0270] The calculation method of the average pooling fusion strategy is:
[0271]
[0272] The calculation method of the attention weighted fusion strategy is:
[0273]
[0274] The calculation method of the direct splicing fusion strategy is:
[0275]
[0276] The calculation method of the adaptive weighted fusion strategy is:
[0277]
[0278] Among them, p f represents the fused feature vector, h represents the number of high-order vectors included in the high-order interest feature vector, ∑· represents the summation function, Represents the jth high-order vector in the high-order interest feature vector, alpha j express The corresponding weight, for or The square root of the dimension of represents the last primary-order vector in the primary-order interest feature vector, Concatenate represents the concatenation function, α represents the adaptive weighting coefficient in the adaptive weighted fusion strategy, σ(·) represents the sigmoid activation function, and W, b are the model hyperparameters in the adaptive formaldehyde fusion strategy.
[0279] Figure 8 This is a second structural diagram of the user behavior prediction device provided by the present invention. Figure 8 As shown, the user behavior prediction device also includes:
[0280] The sorting processing module 750 is used to sort multiple candidate objects according to the predicted value of the user performing a preset behavior on each candidate object at a future time, obtain a candidate sequence, and output the candidate sequence; the candidate sequence includes multiple candidate objects sorted according to the predicted value.
[0281] Fig. 9 The physical structure diagram of the electronic device provided by the present invention is shown in FIG. Fig. 9 As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930 and a communication bus 940, wherein the processor 910, the communication interface 920 and the memory 930 communicate with each other through the communication bus 940. The processor 910 may call the logic instructions in the memory 930 to execute the user behavior prediction method, which includes: obtaining multiple historical behavior data pairs of the user; obtaining the attribute information of the future time and the candidate object; determining the behavior sequence based on the future time and multiple historical behavior data pairs; extracting the network model of the user interest based on time perception, processing the future time, the attribute information and the behavior sequence, and obtaining the prediction value of the user performing the preset behavior on the candidate object in the future time; the future time is a future moment or a future period.
[0282] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0283] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the user behavior prediction method provided by the above methods, which includes: obtaining multiple historical behavior data pairs of the user; obtaining attribute information of future time and candidate objects; determining a behavior sequence based on the future time and multiple historical behavior data pairs; processing the future time, attribute information and behavior sequence through a time-aware user interest extraction network model to obtain a predicted value of the user performing a preset behavior on the candidate object in the future time; the future time is a future moment or a future period.
[0284] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the user behavior prediction method provided by the above-mentioned methods, the method comprising: obtaining multiple historical behavior data pairs of the user; obtaining attribute information of future time and candidate objects; determining a behavior sequence based on the future time and multiple historical behavior data pairs; processing the future time, attribute information and behavior sequence through a user interest extraction network model based on time perception, to obtain a predicted value of the user performing a preset behavior on the candidate object at the future time; the future time is a future moment or a future period.
[0285] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0286] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0287] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A user behavior prediction method, characterized in that: include: Obtain multiple historical behavior data pairs of users; Obtaining future time and attribute information of candidate objects; determining a behavior sequence based on the future time and the plurality of historical behavior data pairs; By extracting a network model of user interests based on time perception, the future time, the attribute information and the behavior sequence are processed to obtain a prediction value of the user performing a preset behavior on the candidate object at the future time; The future time is a future moment or a future period; Each historical behavior data pair includes: attribute information of a historical object and the historical time when the user performs the preset behavior on the historical object; determining the behavior sequence based on the future time and the multiple historical behavior data pairs includes: Based on the historical time, the plurality of historical behavior data pairs are sorted to obtain a historical sequence; For each data pair in the historical sequence, attribute information of the historical object in the data pair, a first time interval between the historical time in the data pair and the historical time in a previous data pair of the data pair, and a second time interval between the future time and the historical time in the data pair are determined as a target pair corresponding to the data pair; The behavior sequence includes a target pair corresponding to each data pair in the history sequence.
2. The user behavior prediction method according to claim 1, characterized in that: The user interest extraction network model based on time perception includes: a behavior embedding layer, a low-order interest extractor, a high-order interest extractor, an interest fusion layer and a behavior predictor; The method of extracting a network model of user interests based on time perception, processing the future time, the attribute information and the behavior sequence, and obtaining a prediction value of the user performing a preset behavior on the candidate object at the future time, includes: Through the behavior embedding layer, the future time is converted into a future time vector; the behavior sequence is converted into a historical behavior vector; the attribute information of the candidate object is converted into a target attribute vector; Performing feature extraction processing on the target behavior vector by the low-order interest extractor to obtain a primary-order interest feature vector; By means of the high-order interest extractor, the primary-order interest feature vector is subjected to feature extraction processing to obtain a high-order interest feature vector; By means of the interest fusion layer, the high-order interest feature vector, or the primary-order interest feature vector and the high-order interest feature vector are fused to obtain a fused feature vector; The fused feature vector, the future time vector and the target attribute vector are processed by the behavior predictor to obtain a predicted value of the user performing a preset behavior on the candidate object at the future time.
3. The user behavior prediction method according to claim 2, characterized in that: The low-order interest extractor includes a plurality of sequentially connected time-aware gated recurrent units T-GRU, or a plurality of sequentially connected time-aware long short-term memory networks T-LSTM.
4. The user behavior prediction method according to claim 3, characterized in that: The calculation method of the T-GRU is: ; in, represents the output of the previous T-GRU connected to the T-GRU, represents the vector representation corresponding to the attribute information of the historical object input to the T-GRU, represents the vector representation of the first time interval input to the T-GRU, represents the vector representation of the second time interval input to the T-GRU, Represents the update gate in the T-GRU The output, Represents the reset gate in the T-GRU The output, and Respectively and The vector representation of the feature space in the T-GRU model is, Represents the time-aware gate in the T-GRU The output, Represents the time-aware gate in the T-GRU The output, Indicates The middle value of represents the hyperbolic tangent function, Represents the output of the T-GRU, the subscript in the calculation method of the T-GRU Indicates the current time step, subscript represents the previous time step, , , , , , , , , , , , , and is the hyperparameter of the T-GRU.
5. The user behavior prediction method according to claim 3, characterized in that: The calculation method of the T-LSTM is: ; in, and is the output of the previous T-LSTM connected to the T-LSTM, The vector representation corresponding to the attribute information of the historical object input to the T-LSTM, represents the vector representation of the first time interval input to the T-LSTM, The vector representation of the second time interval input to the T-LSTM, is the forget gate in the T-LSTM The output, is the input gate in the T-LSTM The output, and express and The vector representation of the feature space in the T-LSTM model is, Represents the time-aware gate in the T-LSTM The output, Represents the time-aware gate in the T-LSTM The output, and They are and The vector representation after mapping transformation is: is the candidate value vector, is the output gate in the T-LSTM The output, and is the output of the T-LSTM, Represents the hyperbolic tangent function, the subscript in the calculation method of T-LSTM Indicates the current time step, subscript represents the previous time step, , , , , , , , , , , , , , , , , and is the hyperparameter of the T-LSTM.
6. The user behavior prediction method according to claim 2, characterized in that: The high-order interest extractor includes: a position encoding module, a multi-head self-attention module, a first residual connection and normalization module, a feedforward neural network, and a second residual connection and normalization module; The calculation method of the position encoding module is: ; in, express The corresponding position encoding vector, represents the encoding function of the position encoding module, represents the first The first-order vector, is a positive integer, , represents the current time step, represents the sine function, represents the cosine function; The calculation method of the multi-head self-attention module is: ; in, represents the output of the multi-head self-attention module, Represents the function of the multi-head self-attention module, represents the input of the multi-head self-attention module, , represents the primary interest feature vector, represents the position encoding vector (including all ), represents the concatenation function, is the first The output of the self-attention head, Represents the function of each attention head, , and Respectively represent the The Query vector, Key vector and Value vector of each self-attention head, , , For the said The hyperparameters of the self-attention heads, represents the Query vector, represents the Key vector, represents the Key vector, , represents the number of high-order vectors included in the high-order interest feature vector, is the arithmetic square root of the dimension of the primary-order vector in the primary-order interest feature vector; The comprehensive calculation method of the first residual connection and normalization module, the feedforward neural network and the second residual connection and normalization module is: ; in, represents the output of the first residual connection and normalization module, represents the layer normalization function of the first residual connection and normalization module, Represents the preset processing function, The multiple self-attention heads in the multi-head self-attention module Splicing obtained, represents the high-order interest feature vector output by the high-order interest extractor, represents the layer normalization function of the second residual connection and normalization module, A function representing the feedforward neural network.
7. The user behavior prediction method according to claim 2, characterized in that: The interest fusion layer has an average pooling fusion strategy, an attention weighted fusion strategy, a direct splicing fusion strategy or an adaptive weighted fusion strategy; The calculation method of the average pooling fusion strategy is: ; The calculation method of the attention weighted fusion strategy is: ; The calculation method of the direct splicing fusion strategy is: ; The calculation method of the adaptive weighted fusion strategy is: ; in, represents the fused feature vector, represents the number of high-order vectors included in the high-order interest feature vector, represents the summation function, represents the first high-order vectors, express The corresponding weights, for or The square root of the dimension of represents the last primary-order vector in the primary-order interest feature vector, represents the concatenation function, represents the adaptive weighting coefficient in the adaptive weighted fusion strategy, express Activation function, is the model hyperparameter in the adaptive weighted fusion strategy.
8. The user behavior prediction method according to claim 1, characterized in that: The number of the candidate objects is multiple, and the method further includes: According to the predicted value of the user performing a preset behavior on each candidate object at the future time, multiple candidate objects are sorted to obtain a candidate sequence, and the candidate sequence is output; the candidate sequence includes the multiple candidate objects sorted according to the predicted value.
9. A user behavior prediction device, characterized in that: include: A first acquisition module, used to acquire multiple historical behavior data pairs of a user; The second acquisition module is used to acquire attribute information of future time and candidate objects; A determination module, configured to determine a behavior sequence based on the future time and the plurality of historical behavior data pairs; A prediction module, configured to process the future time, the attribute information and the behavior sequence by extracting a network model of user interests based on time perception, and obtain a prediction value of the user performing a preset behavior on the candidate object at the future time; Future time refers to a future moment or a future period; Each historical behavior data pair includes: attribute information of the historical object and the historical time when the user performs the preset behavior on the historical object; the determination module is specifically used for: Based on historical time, multiple historical behavior data pairs are sorted and processed to obtain a historical sequence; For each data pair in the historical sequence, attribute information of the historical object in the data pair, a first time interval between the historical time in the data pair and the historical time in a previous data pair of the data pair, and a second time interval between the future time and the historical time in the data pair are determined as a target pair corresponding to the data pair; The behavior sequence includes a target pair corresponding to each data pair in the history sequence.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the user behavior prediction method according to any one of claims 1 to 8 is implemented.
11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the user behavior prediction method according to any one of claims 1 to 8 is implemented.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the user behavior prediction method according to any one of claims 1 to 8 is implemented.
