A method and device for training behavior prediction model
By splitting and time encoding the user behavior sequence and combining behavior prediction model training, the problem of time information blurring in traditional methods is solved, and accurate modeling of behavior sequences and accurate prediction of future behaviors is achieved.
Patent Information
- Application Number
- CN202211513095.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-29
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-11-29
AI Technical Summary
Traditional behavioral sequence modeling methods discrete multiple behavioral sequences, resulting in blurring the original time information and inaccurate the time and type of future behavior predictions.
By splitting the user's behavior sequence, multiple single behavior sequences are obtained, and a single behavior time sequence is generated using time encoding and trigonometric functions. It is trained in combination with the behavior prediction model, focusing on the time points and causal relationships in the behavior sequence, and optimizing the model training process using multiple loss values.
More accurate modeling of user behavior sequences is achieved, and more accurately predicts the time points and types of future behaviors.
Smart Images

Figure CN115828991B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of computer technology, and more specifically, to a method and apparatus for training a behavior prediction model in the field of computer technology. Background Art
[0002] In daily life, users often perform a variety of actions. Data analysis techniques can be used to analyze and process historical user behavior to predict when future actions will occur. For example, a user can create a time series of clicks based on the chronological order of clicks. By analyzing this time series, it is possible to predict when a user will click on a specific product in the future.
[0003] For a user's multi-behavior sequence in a non-uniform, continuous time domain, the traditional behavior sequence modeling method is to discretize the multi-behavior sequence and convert it into a problem on multiple uniform time intervals, perform time aggregation on multiple behaviors in each time interval and obtain the corresponding features. In the process of processing the multi-behavior sequence, the above method fuzzifies the original time information of each behavior in the multi-behavior sequence. The multi-behavior sequence obtained by modeling is significantly different from the original behavior sequence (unprocessed multi-behavior sequence). As a result, the time and type of future behaviors predicted by the modeled multi-behavior sequence are inaccurate. Therefore, it is necessary to provide a more accurate method for modeling multi-behavior sequences. Summary of the Invention
[0004] One or more embodiments of this specification provide a method and apparatus for training a behavior prediction model, which can accurately model the time point information of each behavior in a user's multi-behavior sequence.
[0005] In a first aspect, a method for training a behavior prediction model is provided, the method comprising: splitting a user's behavior sequence to obtain multiple single behavior sequences, each single behavior sequence corresponding to a behavior, for recording the correspondence between the behavior and the time point; time-encoding the multiple single behavior sequences to obtain multiple single behavior time series of the multiple single behavior sequences; inputting the multiple single behavior time series into a behavior prediction model, having the behavior prediction model perform modeling of the time point for each single behavior time series in the multiple single behavior time series to obtain the temporal distribution of the behaviors corresponding to the multiple single behavior time series; training the behavior prediction model based on the temporal distribution of the behaviors corresponding to the multiple single behavior time series and a first loss value between the multiple single behavior time series, the behavior prediction model being used to predict the time point and type of at least one future behavior of the user based on the user's behavior sequence.
[0006] In the above technical solution, one or more embodiments of this specification split the user's behavior sequence to obtain multiple single behavior sequences; time-code all time points in the multiple single behavior sequences to obtain multiple single behavior time series of the multiple single behavior sequences; input the multiple single behavior time series into the behavior prediction model to obtain the temporal distribution of the behaviors corresponding to the multiple single behavior time series predicted by the behavior prediction model; thereby, the behavior prediction model can be trained based on the temporal distribution of the behaviors corresponding to the multiple single behavior time series and the first loss value between the multiple single behavior time series. In other words, the behavior prediction model focuses on each time point of multiple single behaviors in the user's behavior sequence and models each time point. Thus, a more accurate behavior prediction model can be modeled, and the behavior prediction model can be used to predict more accurate time points and types of future behaviors.
[0007] In combination with the first aspect, in some possible implementations, the user's behavior sequence is split to obtain multiple single behavior sequences, including: splitting the user's behavior sequence according to the type of behavior to obtain the multiple single behavior sequences, and the user's behavior sequence corresponds to multiple behavior types.
[0008] In the above technical solution, since a user's behavior sequence corresponds to multiple behavior types, the user's behavior sequence can be split according to the behavior type, into multiple single behavior sequences, each of which corresponds to a behavior type. This allows the multiple single behavior sequences to be time-coded to obtain multiple single behavior time series, which can then be used to train a behavior prediction model.
[0009] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the multiple single-behavior sequences are time-encoded to obtain multiple single-behavior time sequences of the multiple single-behavior sequences, including: using trigonometric functions to time-encode the multiple single-behavior sequences to obtain the multiple single-behavior time sequences.
[0010] In the above technical solution, by using trigonometric functions to time-code multiple single-behavior sequences, all time features of each single-behavior sequence in the multiple single-behavior sequences can be obtained, and multiple single-behavior time series of the multiple single-behavior sequences can be obtained.
[0011] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the behavior prediction model models each of the multiple single behavior time series at the time point to obtain the temporal distribution of the behaviors corresponding to the multiple single behavior time series, including: the behavior prediction model performs the intensity value of the time point within a preset time period on each of the multiple single behavior time series to obtain the temporal distribution of the behaviors corresponding to the multiple single behavior time series.
[0012] It should be understood that the above technical solution is to obtain the temporal distribution of behaviors corresponding to multiple single-behavior time series, but in fact it is to obtain the probability density distribution function of behaviors corresponding to multiple single-behavior time series within a certain time period.
[0013] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the behavior prediction model includes a behavior time sub-model, the multiple single behavior time series are input into the behavior prediction model, and the behavior prediction model models each single behavior time series in the multiple single behavior time series at the time point to obtain the temporal distribution of the behaviors corresponding to the multiple single behavior time series, including: inputting the multiple single behavior time series into the behavior time sub-model in the behavior prediction model, and the behavior time sub-model models each single behavior time series in the multiple single behavior time series at the time point to obtain the temporal distribution of the behaviors corresponding to the multiple single behavior time series.
[0014] In the above technical solution, when the behavior prediction model includes a behavior time sub-model, the behavior time sub-model is trained using the first loss value between the multiple single behavior time series and the temporal distribution of the behaviors corresponding to the multiple single behavior time series. The temporal distribution of the behaviors corresponding to the multiple single behavior time series is obtained by modeling the multiple single behavior time series at that time point using the behavior time sub-model.
[0015] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the behavior prediction model is trained based on the temporal distribution of the behaviors corresponding to the multiple single behavior time series and the first loss value between the multiple single behavior time series, including: training the behavior time sub-model in the behavior prediction model based on the temporal distribution of the behaviors corresponding to the multiple single behavior time series and the first loss value between the multiple single behavior time series.
[0016] In the above technical solution, the behavior prediction model is trained based on the first loss value, so that the behavior prediction model obtained can better predict the time and type of future behavior based on the behavior sequence to be predicted.
[0017] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the behavior prediction model also includes a behavior relationship sub-model and a prediction sub-model, and the method also includes: inputting the multiple single behavior sequences into the behavior relationship sub-model to obtain a causal relationship between each two single behavior sequences in the multiple single behavior sequences, and the causal relationship is used to characterize the relationship between the occurrence of the behavior of one single behavior sequence and the occurrence of the behavior of another single behavior sequence in each two single behavior sequences; inputting the causal relationship between each two single behavior sequences in the multiple single behavior sequences, and the temporal distribution of the behaviors corresponding to the multiple single behavior time series into the prediction sub-model, and the prediction sub-model performs sequence prediction based on the causal relationship and the distribution to obtain a predicted behavior sequence; based on the first loss value and the second loss value between the predicted behavior sequence and the user's behavior sequence, the behavior relationship sub-model and the prediction sub-model are trained.
[0018] In the above technical solution, when the behavior prediction model also includes a behavior relationship sub-model and a prediction sub-model, multiple single behavior sequences can be input into the behavior relationship sub-model to obtain the causal relationship between every two single behavior sequences in the multiple single behavior sequences; the causal relationship between every two single behavior sequences in the multiple single behavior sequences, as well as the temporal distribution of behaviors corresponding to the multiple single behavior time series, are input into the prediction sub-model, and the predicted user sequence is obtained by the prediction sub-model; thereby, the behavior relationship sub-model and the prediction sub-model are trained based on the first loss value and the second loss value between the predicted behavior sequence and the user's behavior sequence. In other words, the behavior prediction model not only focuses on the time point information of the user's behavior sequence, but also focuses on the causal relationship between multiple behaviors in the user's behavior sequence, thereby more accurately modeling the user's behavior sequence.
[0019] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the multiple single behavior sequences are input into the behavior relationship sub-model to obtain the causal relationship between every two single behavior sequences in the multiple single behavior sequences, including: obtaining the causal relationship between every two single behavior sequences in the multiple single behavior sequences based on the sum of the covariance values of every two single behavior sequences in the multiple single behaviors at all time points.
[0020] It should be understood that obtaining the causal relationship between every two single-behavior sequences in the plurality of single-behavior sequences is to determine the Granger causal relationship between every two single-behavior sequences.
[0021] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the behavior relationship sub-model and the prediction sub-model are trained based on the first loss value and the second loss value between the predicted behavior sequence and the user's behavior sequence, including: determining a third loss value between the predicted label and the true label of the user's behavior sequence, the true label is used to indicate the user's true information, and the predicted label is used to indicate the user's information predicted by the prediction sub-model; averaging the second loss value and the third loss value to obtain a fourth loss value; and training the behavior relationship sub-model and the prediction sub-model based on the first loss value and the fourth loss value.
[0022] In the above technical solution, compared to training the behavior relationship sub-model and prediction sub-model based solely on the first and second loss values, this solution also introduces a third loss value between the predicted label and the true label. The average of the third and second loss values is determined as a fourth loss value, and the behavior relationship sub-model and prediction sub-model are trained based on the first and fourth loss values. The introduction of the third loss value in this solution is equivalent to introducing more information to train the behavior relationship sub-model and prediction sub-model, resulting in more accurate behavior relationship sub-model and prediction sub-model.
[0023] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, before determining the third loss value between the predicted label and the true label of the user's behavior sequence, the method also includes: inputting the causal relationship between each two single behavior sequences in the multiple single behavior sequences and the temporal distribution of the behaviors corresponding to the multiple single behavior time series into the prediction sub-model to obtain the predicted label corresponding to the user's behavior sequence.
[0024] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the behavior relationship sub-model and the prediction sub-model are trained based on the first loss value and the second loss value between the predicted behavior sequence and the user's behavior sequence, including: obtaining a fifth loss value based on the first loss value and the second loss value; training the behavior relationship sub-model based on the fifth loss value, and training the prediction sub-model based on the second loss value.
[0025] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, a fifth loss value is obtained based on the first loss value and the second loss value, including: determining the first numerical value based on the matrix composed of the second-order partial derivatives of each weight in the behavior relationship sub-model and the vector composed of each weight in the behavior relationship sub-model; and obtaining the fifth loss value based on the first numerical value, the first loss value and the second loss value.
[0026] It should be understood that the above process of determining the first value is achieved by utilizing the Pareto optimal solution principle.
[0027] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the method also includes: inputting the behavior sequence to be predicted into the behavior prediction model, and obtaining the time point and type corresponding to at least one future behavior of the behavior sequence to be predicted predicted by the behavior prediction model.
[0028] In summary, one or more embodiments of this specification propose a method for training a behavior prediction model, which splits the user's behavior sequence to obtain multiple single behavior sequences; time-codes all time points in the multiple single behavior sequences to obtain multiple single behavior time series of the multiple single behavior sequences; inputs the multiple single behavior time series into the behavior prediction model to obtain the temporal distribution of the behaviors corresponding to the multiple single behavior time series predicted by the behavior prediction model; thereby, the behavior prediction model can be trained based on the temporal distribution of the behaviors corresponding to the multiple single behavior time series and the first loss value between the multiple single behavior time series. In other words, the behavior prediction model focuses on the information of each time point of multiple single behaviors in the user's behavior sequence and models each time point. This avoids the fuzzification of the original time information of each behavior in the multiple behavior sequences in the related art, thereby modeling a more accurate behavior prediction model, which can be used to predict more accurate time points and types of future behaviors.
[0029] In addition, when the behavior prediction model includes a behavior time sub-model, a behavior relationship sub-model, and a prediction sub-model, multiple single behavior sequences can be input into the behavior relationship sub-model to obtain the causal relationship between each two single behavior sequences in the multiple single behavior sequences; the causal relationship between each two single behavior sequences in the multiple single behavior sequences, as well as the temporal distribution of the behaviors corresponding to the multiple single behavior time series, are input into the prediction sub-model, and the predicted user sequence is obtained from the prediction sub-model; thereby, the behavior relationship sub-model and the prediction sub-model are trained based on the first loss value and the second loss value between the predicted behavior sequence and the user's behavior sequence. In other words, the behavior prediction model not only focuses on the time point information of the user's behavior sequence, but also focuses on the causal relationship between multiple behaviors in the user's behavior sequence, thereby more accurately modeling the user's behavior sequence.
[0030] Finally, the obtained behavior prediction model can be used to predict the time point and type corresponding to at least one future behavior in the behavior sequence to be predicted.
[0031] In a second aspect, a device for training a behavior prediction model is provided, which includes: a determination module for splitting a user's behavior sequence to obtain multiple single behavior sequences, each single behavior sequence corresponding to a behavior, and recording the correspondence between the behavior and the time point; the determination module is also used to time-code the multiple single behavior sequences to obtain multiple single behavior time series of the multiple single behavior sequences; the determination module is also used to input the multiple single behavior time series into a behavior prediction model, and the behavior prediction model performs modeling on the time point for each single behavior time series in the multiple single behavior time series to obtain the temporal distribution of the behaviors corresponding to the multiple single behavior time series; a training module is used to train the behavior prediction model based on the temporal distribution of the behaviors corresponding to the multiple single behavior time series and the first loss value between the multiple single behavior time series, and the behavior prediction model is used to predict the time point and type of at least one future behavior of the user based on the user's behavior sequence.
[0032] In conjunction with the second aspect, in some possible implementations, the determination module is specifically configured to split the user's behavior sequence according to the type of behavior to obtain the multiple single behavior sequences, where the user's behavior sequence corresponds to multiple behavior types.
[0033] In combination with the second aspect and the above implementation, in some possible implementations, the determination module is further configured to perform time encoding on the multiple single-behavior sequences using a trigonometric function to obtain the multiple single-behavior time sequences.
[0034] In combination with the second aspect and the above-mentioned implementation method, in some possible implementation methods, the determination module is specifically used to use the behavior prediction model to perform intensity value of each single behavior time series in the multiple single behavior time series at the time point within a preset time period to obtain the temporal distribution of the behaviors corresponding to the multiple single behavior time series.
[0035] It should be understood that the above scheme is to obtain the temporal distribution of behaviors corresponding to multiple single-behavior time series, but in fact it is to obtain the probability density distribution function of behaviors corresponding to multiple single-behavior time series within a certain time period.
[0036] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the behavior prediction model includes a behavior time sub-model, and the determination module is specifically used to input the multiple single behavior time series into the behavior time sub-model in the behavior prediction model, and the behavior time sub-model models each single behavior time series in the multiple single behavior time series at the time point to obtain the temporal distribution of the behaviors corresponding to the multiple single behavior time series.
[0037] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the training module is specifically used to train the behavior time sub-model in the behavior prediction model based on the temporal distribution of the behaviors corresponding to the multiple single behavior time series and the first loss value between the multiple single behavior time series.
[0038] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the behavior prediction model also includes a behavior relationship sub-model and a prediction sub-model. The determination module is further used to input the multiple single behavior sequences into the behavior relationship sub-model to obtain the causal relationship between each two single behavior sequences in the multiple single behavior sequences, and the causal relationship is used to characterize the relationship between the occurrence of the behavior of one single behavior sequence and the occurrence of the behavior of another single behavior sequence in each two single behavior sequences; the causal relationship between each two single behavior sequences in the multiple single behavior sequences, and the temporal distribution of the behaviors corresponding to the multiple single behavior time series are input into the prediction sub-model, and the prediction sub-model performs sequence prediction based on the causal relationship and the distribution to obtain a predicted behavior sequence; the training module is also used to train the behavior relationship sub-model and the prediction sub-model based on the first loss value and the second loss value between the predicted behavior sequence and the user's behavior sequence.
[0039] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the determination module is specifically used to obtain the causal relationship between each two single behavior sequences in the multiple single behavior sequences based on the sum of the covariance values of each two single behavior sequences in the multiple single behaviors at all time points.
[0040] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the training module is further used to determine a third loss value between the predicted label and the true label of the user's behavior sequence, the true label is used to indicate the real information of the user, and the predicted label is used to indicate the information of the user predicted by the prediction sub-model; the second loss value and the third loss value are averaged to obtain a fourth loss value; and the behavior relationship sub-model and the prediction sub-model are trained based on the first loss value and the fourth loss value.
[0041] In combination with the second aspect and the above-mentioned implementation method, in some possible implementation methods, the determination module is also used to input the causal relationship between each two single behavior sequences in the multiple single behavior sequences and the temporal distribution of the behaviors corresponding to the multiple single behavior time series into the prediction sub-model to obtain the prediction label corresponding to the user's behavior sequence.
[0042] In combination with the second aspect and the above-mentioned implementation method, in some possible implementation methods, the training module is specifically used to obtain a fifth loss value based on the first loss value and the second loss value; train the behavior relationship sub-model based on the fifth loss value, and train the prediction sub-model based on the second loss value.
[0043] In combination with the second aspect and the above-mentioned implementation method, in some possible implementation methods, the determination module is specifically used to determine the first numerical value based on the matrix composed of the second-order partial derivatives of each weight in the behavior relationship sub-model and the vector composed of each weight in the behavior relationship sub-model; and obtain the fifth loss value based on the first numerical value, the first loss value and the second loss value.
[0044] It should be understood that the above process of determining the first value is achieved by utilizing the Pareto optimal solution principle.
[0045] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the determination module is also used to input the behavior sequence to be predicted into the behavior prediction model to obtain the time point and type corresponding to at least one future behavior of the behavior sequence to be predicted predicted by the behavior prediction model.
[0046] In a third aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the electronic device executes the method in the above-mentioned first aspect or any possible implementation of the first aspect.
[0047] In a fourth aspect, a computer-readable storage medium is provided, which stores instructions. When the instructions are executed on a computer or a processor, the computer or the processor executes the method in the first aspect or any possible implementation of the first aspect.
[0048] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer or processor, enables the computer or processor to execute the method in the first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 This is a schematic diagram of temporal aggregation of multiple behavior sequences provided by one or more embodiments of this specification;
[0050] Figure 2 is a schematic flow chart of a method for training a behavior prediction model provided in one or more embodiments of this specification;
[0051] Figure 3This is a schematic diagram of splitting a user's behavior sequence provided by one or more embodiments of this specification;
[0052] Figure 4 is a schematic diagram of the structure of a behavior prediction model provided by one or more embodiments of this specification;
[0053] Figure 5 is a schematic structural diagram of a device for training a behavior prediction model provided by one or more embodiments of this specification;
[0054] Figure 6 This is a schematic diagram of the structure of an electronic device provided by one or more embodiments of this specification. DETAILED DESCRIPTION
[0055] The technical solutions in one or more embodiments of this specification will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of one or more embodiments of this specification, "multiple" refers to two or more than two. The terms "first" and "second" are used for descriptive purposes only and cannot be understood as implying or suggesting relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. "And / or" in the text is merely a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone.
[0056] Figure 1 This is a schematic diagram of temporal aggregation of multiple behavior sequences provided by one or more embodiments of this specification.
[0057] For example, Figure 1 The multi-behavior sequence shown in FIG. 1 corresponds to multiple behavior types, and each behavior type corresponds to a time point. Figure 1 As shown in the chart, at 0 minutes, the behavior is a pentagon; at 1 minute, it is a circle; at 2.2 minutes, it is a triangle; at 3 minutes, it is a triangle; at 3.5 minutes, it is a pentagon; and so on, until finally, at 27 minutes, it is a rectangle. Among them, the pentagon type represents online purchases, the circle type represents transfers, the triangle type represents fund subscriptions, and the rectangle type represents chats.
[0058] In the related art, Figure 1The multi-behavior sequence shown is divided equally into multiple evenly spaced time segments according to preset time intervals to obtain multiple evenly spaced time segments. Time aggregation is performed on each segment of the multi-behavior sequence to obtain the number of occurrences of each behavior in each segment. Assuming that the preset time interval is 4 minutes, the multiple behavior sequences are divided equally and after time aggregation, the following are obtained: 0-4 minutes: 2 online purchase behaviors, 1 transfer behavior, 2 fund subscription behaviors and 0 chat behaviors; 4-8 minutes: 0 online purchase behavior, 1 transfer behavior, 1 fund subscription behavior and 2 chat behaviors; 8-12 minutes: 2 online purchase behaviors, 1 transfer behavior, 0 fund subscription behaviors and 1 chat behavior; 12-16 minutes: 1 online purchase behavior, 1 transfer behavior, 1 fund subscription behavior and 1 chat behavior; 16-20 minutes: 1 online purchase behavior, 2 transfer behaviors, 0 fund subscription behaviors and 0 chat behaviors; 20-24 minutes: 0 online purchase behavior, 0 transfer behavior, 2 fund subscription behaviors and 1 chat behavior; and 24-28 minutes: 1 online purchase behavior, 0 transfer behavior, 2 fund subscription behaviors and 2 chat behaviors.
[0059] Based on the above-mentioned pattern of multi-behavior sequences counted every four minutes, the prediction is the time period of a certain type of behavior in the future, not the time point. Therefore, this prediction method is inaccurate in predicting the time information of future behavior occurrence.
[0060] Figure 2 This is a schematic flowchart of a method for training a behavior prediction model provided in one or more embodiments of this specification.
[0061] It should be understood that a method for training a behavior prediction model provided in one or more embodiments of this specification can be applied to any electronic device, which may be a computer terminal (a display device with data processing function, a mobile phone terminal) or a server, etc.
[0062] It should also be understood that the determination process of the behavior prediction model in one or more embodiments of this specification is based on the recurrent neural network (RNN) in deep learning, which can be a long short-term memory (LSTM) unit and a gated recurrent unit (GRU).
[0063] For example, Figure 2 As shown, the method 200 includes:
[0064] 202 , the electronic device splits the user's behavior sequence to obtain multiple single behavior sequences, each of which corresponds to a behavior and is used to record the corresponding relationship between the behavior and a time point.
[0065] It should be understood that the user's behavior sequence in the above scheme refers to Figure 1 The multi-behavior sequence shown, the user's behavior sequence is the same as the multi-behavior sequence, and corresponds to multiple types of behaviors.
[0066] It should also be understood that each type of behavior in the user's behavior sequence has a corresponding time point, that is, the specific time when a certain type of behavior occurs.
[0067] In a possible implementation, step 202 includes: the electronic device splits the user's behavior sequence according to the type of behavior to obtain the multiple single behavior sequences, where the user's behavior sequence corresponds to multiple behavior types.
[0068] In the above technical solution, since a user's behavior sequence corresponds to multiple behavior types, the user's behavior sequence can be split according to the behavior type, into multiple single behavior sequences, each of which corresponds to a behavior type. This allows the multiple single behavior sequences to be time-coded to obtain multiple single behavior time series, which can then be used to train a behavior prediction model.
[0069] Figure 3 This is a schematic diagram of splitting a user's behavior sequence provided by one or more embodiments of this specification.
[0070] For example, Figure 3 Specifically, Figure 1 The multiple behavior sequences shown (specifically, the behavior sequence of the user with sequence number ①) are split into multiple single behavior sequences. Among them, the types of behaviors corresponding to the user's behavior sequence are specifically the pentagonal type, i.e., the online purchase type, the circular type, i.e., the transfer type, the triangular type, i.e., the fund subscription type, and the rectangular type, i.e., the chat type. The user's behavior sequence is split into multiple single behavior sequences according to the type of behavior, namely, the sequence with sequence number ②, the sequence with sequence number ③, the sequence with sequence number ④, and the sequence with sequence number ⑤, that is, the user's behavior sequence is split into a behavior sequence of the online purchase type, a behavior sequence of the transfer type, a behavior sequence of the fund subscription type, and a behavior sequence of the chat type.
[0071] 204 , the electronic device performs time coding on the multiple single-behavior sequences to obtain multiple single-behavior time sequences of the multiple single-behavior sequences.
[0072] In a possible implementation, step 204 includes: the electronic device uses a trigonometric function to time-code the multiple single-behavior sequences to obtain the multiple single-behavior time sequences.
[0073] In the above technical solution, by using trigonometric functions to time-code multiple single-behavior sequences, all time features of each single-behavior sequence in the multiple single-behavior sequences can be obtained, and multiple single-behavior time series of the multiple single-behavior sequences can be obtained.
[0074] Specifically, the electronic device uses the following trigonometric function formula (1) to time-code each single-behavior sequence in the multiple single-behavior sequences to obtain multiple single-behavior time sequences.
[0075]
[0076] Among them, Φ T Represents the mapping of a behavior sequence over a period of time; b1,...,b d is the phase difference parameter; ω1,...,ω d is the frequency parameter; d is the dimension after a behavior sequence is mapped using a trigonometric function; t-τ represents a time period.
[0077] 206 , the electronic device inputs the multiple single behavior time series into a behavior prediction model, and the behavior prediction model models each of the multiple single behavior time series at the time point to obtain the temporal distribution of the behaviors corresponding to the multiple single behavior time series.
[0078] In one possible implementation, step 206 includes: the behavior prediction model performs intensity value analysis on each of the multiple single behavior time series at the time point within a preset time period to obtain the temporal distribution of behaviors corresponding to the multiple single behavior time series.
[0079] It should be understood that the above technical solution is to obtain the temporal distribution of behaviors corresponding to multiple single-behavior time series, but in fact it is to obtain the probability density distribution function of behaviors corresponding to multiple single-behavior time series within a certain time period.
[0080] It should be understood that the behavior prediction model calculates the intensity value of each single behavior time series in the preset time period at the time point to obtain the temporal distribution of the behaviors corresponding to the multiple single behavior time series. In other words, the probability density distribution function of the behaviors corresponding to each single behavior time series in the multiple single behavior time series over a certain period of time is obtained as expressed by the following formula (2).
[0081]
[0082] Among them, τ i Indicates a period of time; p * (τ i ) is the probability density distribution function of the behavior corresponding to a single behavior time series over a certain period of time; p * (τ i ):=p(τ i |H ti ) indicates that the probability density distribution function of the behavior corresponding to a single behavior time series over a certain period of time is related to the historical behavior in the single behavior sequence; * (t i-1 +τ i ) is the i-1 to τ i The intensity function (intensity value) of a behavior occurring within a time period of t, that is, the probability of a behavior occurring; s represents the intensity function (intensity value) of a behavior occurring within a time period of t i-1 to τ i A point in time within a certain period of time.
[0083] In one possible implementation, when the behavior prediction model includes a behavior time sub-model, step 206 includes: the electronic device inputs the multiple single behavior time series into the behavior time sub-model in the behavior prediction model, and the behavior time sub-model models each single behavior time series in the multiple single behavior time series at the time point to obtain the temporal distribution of the behaviors corresponding to the multiple single behavior time series.
[0084] The above technical solution is a more specific implementation method of step 206. Specifically, when the behavior prediction model includes a behavior time sub-model, multiple single behavior time series can be input into the behavior time sub-model, and the behavior time sub-model models each single behavior time series in the multiple single behavior time series at the time point.
[0085] 208. The electronic device trains the behavior prediction model based on the temporal distribution of the behaviors corresponding to the multiple single behavior time series and the first loss value between the multiple single behavior time series. The behavior prediction model is used to predict the time point and type of at least one future behavior of the user based on the user's behavior sequence.
[0086] In one possible implementation, when the behavior prediction model includes a behavior time sub-model, step 208 includes: the electronic device trains the behavior time sub-model in the behavior prediction model based on the temporal distribution of the behaviors corresponding to the multiple single behavior time series and the first loss value between the multiple single behavior time series.
[0087] In the above technical solution, when the behavior prediction model includes a behavior time sub-model, the behavior time sub-model is trained using the first loss value between the multiple single behavior time series and the temporal distribution of the behaviors corresponding to the multiple single behavior time series. The temporal distribution of the behaviors corresponding to the multiple single behavior time series is obtained by modeling the multiple single behavior time series at that time point using the behavior time sub-model.
[0088] In one possible implementation, when the behavior prediction model also includes a behavior relationship sub-model and a prediction sub-model, the method also includes: the electronic device inputs the multiple single behavior sequences into the behavior relationship sub-model to obtain a causal relationship between every two single behavior sequences in the multiple single behavior sequences, and the causal relationship is used to characterize the relationship between the occurrence of the behavior of one single behavior sequence and the occurrence of the behavior of another single behavior sequence in every two single behavior sequences; the electronic device inputs the causal relationship between every two single behavior sequences in the multiple single behavior sequences, and the temporal distribution of the behaviors corresponding to the multiple single behavior time series into the prediction sub-model, and the prediction sub-model performs sequence prediction based on the causal relationship and the distribution to obtain a predicted behavior sequence; the electronic device trains the behavior relationship sub-model and the prediction sub-model based on the first loss value and the second loss value between the predicted behavior sequence and the user's behavior sequence.
[0089] In the above technical solution, when the behavior prediction model also includes a behavior relationship sub-model and a prediction sub-model, multiple single behavior sequences can be input into the behavior relationship sub-model to obtain the causal relationship between every two single behavior sequences in the multiple single behavior sequences; the causal relationship between every two single behavior sequences in the multiple single behavior sequences, as well as the temporal distribution of behaviors corresponding to the multiple single behavior time series, are input into the prediction sub-model, and the predicted user sequence is obtained by the prediction sub-model; thereby, the behavior relationship sub-model and the prediction sub-model are trained based on the first loss value and the second loss value between the predicted behavior sequence and the user's behavior sequence. In other words, the behavior prediction model not only focuses on the time point information of the user's behavior sequence, but also focuses on the causal relationship between multiple behaviors in the user's behavior sequence, thereby more accurately modeling the user's behavior sequence.
[0090] In one possible implementation, the electronic device inputs the multiple single behavior sequences into the behavior relationship sub-model to obtain the causal relationship between every two single behavior sequences in the multiple single behavior sequences, including: the electronic device obtains the causal relationship between every two single behavior sequences in the multiple single behavior sequences based on the sum of the covariance values of every two single behavior sequences in the multiple single behavior sequences at all time points.
[0091] It should be understood that obtaining the causal relationship between every two single-behavior sequences in the plurality of single-behavior sequences specifically refers to determining the Granger causal relationship between every two single-behavior sequences.
[0092] It should also be understood that the electronic device obtains the causal relationship between every two single-behavior sequences in the multiple single-behavior sequences according to the following Granger causality formula (3).
[0093]
[0094] Among them, X i and are any two different single-behavior sequences in multiple single-behavior sequences; i is the i-th behavior in the single-behavior sequence; any two single-behavior sequences in multiple single-behavior sequences can form a sequence in k groups; represents the Granger causality between two single-behavior sequences in the kth group of sequences; represents the covariance of the i-th behavior between two single-behavior sequences in the k-th group of sequences.
[0095] In one possible implementation, the electronic device trains the behavior relationship sub-model and the prediction sub-model based on the first loss value and the second loss value between the predicted behavior sequence and the user's behavior sequence, including: the electronic device determines a third loss value between the predicted label and the real label of the user's behavior sequence, the real label is used to indicate the real information of the user, and the predicted label is used to indicate the information of the user predicted by the prediction sub-model; the electronic device averages the second loss value and the third loss value to obtain a fourth loss value; the electronic device trains the behavior relationship sub-model and the prediction sub-model based on the first loss value and the fourth loss value.
[0096] In the above technical solution, compared to training the behavior relationship sub-model and prediction sub-model based solely on the first and second loss values, this solution also introduces a third loss value between the predicted label and the true label. The average of the third and second loss values is determined as a fourth loss value, and the behavior relationship sub-model and prediction sub-model are trained based on the first and fourth loss values. The introduction of the third loss value in this solution is equivalent to introducing more information to train the behavior relationship sub-model and prediction sub-model, resulting in more accurate behavior relationship sub-model and prediction sub-model.
[0097] In one possible implementation, before the electronic device determines the third loss value between the predicted label and the true label of the user's behavior sequence, the method also includes: the electronic device inputs the causal relationship between each two single behavior sequences in the multiple single behavior sequences and the temporal distribution of the behaviors corresponding to the multiple single behavior time series into the prediction sub-model to obtain the predicted label corresponding to the user's behavior sequence.
[0098] Optionally, the true label of the user's behavior sequence may be the user's identity information and / or occupation information.
[0099] The acquisition of the user's identity information and / or occupational information requires the user's consent.
[0100] In one possible implementation, the electronic device trains the behavior relationship sub-model and the prediction sub-model based on the first loss value and the second loss value between the predicted behavior sequence and the user's behavior sequence, including: the electronic device obtains a fifth loss value based on the first loss value and the second loss value; the electronic device trains the behavior relationship sub-model based on the fifth loss value, and trains the prediction sub-model based on the second loss value.
[0101] In one possible implementation, the electronic device obtains a fifth loss value based on the first loss value and the second loss value, including: the electronic device determines the first numerical value based on a matrix composed of second-order partial derivatives of each weight in the behavior relationship sub-model and a vector composed of each weight in the behavior relationship sub-model; the electronic device obtains the fifth loss value based on the first numerical value, the first loss value and the second loss value.
[0102] It should be understood that the above process of determining the first value is achieved by utilizing the Pareto optimal solution principle.
[0103] Specifically, the electronic device obtains the first value according to the following Pareto optimal solution formula (4).
[0104]
[0105] Wherein, H is a matrix composed of the second-order partial derivatives of each weight in the behavior relationship sub-model, specifically a Hessian matrix; υ is the first value; f is the vector value of the behavior relationship sub-model; is the target gradient of each weight; β is the vector value composed of each weight in the behavior relationship sub-model.
[0106] In a possible implementation, the method further includes: the electronic device inputting the behavior sequence to be predicted into the behavior prediction model, and obtaining the time point and type corresponding to at least one future behavior of the behavior sequence to be predicted predicted by the behavior prediction model.
[0107] In the above technical solution, the process of using the trained behavior prediction model is specifically to predict any behavior sequence using the trained behavior prediction model to obtain the time point and type corresponding to at least one future behavior in the behavior sequence.
[0108] In one possible implementation, the electronic device splits the user sequence to be predicted according to the type of behavior to obtain multiple single-behavior user sequences; the electronic device time-encodes the multiple single-behavior user sequences to obtain multiple single-behavior user time sequences. The behavior sequence to be detected includes multiple single-behavior user sequences and multiple single-behavior user time sequences.
[0109] Optionally, the electronic device time-encodes the multiple single-behavior user sequences to obtain the multiple single-behavior user time sequences, including: the electronic device time-encodes the multiple single-behavior user sequences using trigonometric functions to obtain the multiple single-behavior user time sequences.
[0110] In one possible implementation, the electronic device inputs multiple single-behavior user time series into a behavior time sub-model to obtain the temporal distribution of the behaviors corresponding to the multiple single-behavior user time series; the electronic device inputs multiple single-behavior user sequences into the behavior relationship sub-model to obtain the causal relationship between every two single-behavior user sequences in the multiple single-behavior user sequences; the electronic device inputs the distribution and the causal relationship into a prediction sub-model to obtain the time point and type corresponding to at least one future behavior of the behavior sequence to be predicted.
[0111] Figure 4 This is a structural diagram of a behavior prediction model provided by one or more embodiments of this specification.
[0112] like Figure 4 As shown in , the process of obtaining the behavior prediction model is described in detail. Figure 4 Specifically, the user's behavior sequence is split into multiple single behavior sequences; multiple single behavior sequences are time-encoded to obtain multiple single behavior time series; the time points in the multiple single behavior time series are modeled by the behavior time sub-model to obtain the temporal distribution of behaviors corresponding to the multiple single behavior time series; the multiple single behavior sequences are input into the behavior relationship sub-model, and the behavior relationship sub-model obtains the causal relationship between each two single behavior sequences in the multiple single behavior sequences; the prediction sub-model can predict the predicted behavior sequence and the prediction label based on the temporal distribution of behaviors corresponding to the multiple single behavior time series and the causal relationship between each two single behavior sequences in the multiple single behavior sequences.
[0113] Determine a first loss value between multiple single-behavior time series and the temporal distribution of behaviors corresponding to the multiple single-behavior time series; determine a second loss value between the user's behavior sequence and the predicted behavior sequence; and determine a third loss value between the true label and the predicted label.
[0114] The behavior time sub-model, behavior relationship sub-model and prediction sub-model can be trained based on the first loss value and the second loss value; the fourth loss value can also be obtained based on the average of the second loss value and the third loss value, and the behavior time sub-model, behavior relationship sub-model and prediction sub-model can be trained based on the first loss value and the fourth loss value.
[0115] Figure 5 This is a structural diagram of a device for training a behavior prediction model provided by one or more embodiments of this specification.
[0116] For example, Figure 5 As shown, the apparatus 500 includes:
[0117] Determination module 501 is used to split the user's behavior sequence to obtain multiple single behavior sequences, each of which corresponds to a behavior and is used to record the corresponding relationship between the behavior and the time point;
[0118] The determining module 501 is further configured to perform time coding on the plurality of single-behavior sequences to obtain a plurality of single-behavior time sequences of the plurality of single-behavior sequences;
[0119] The determination module 501 is further configured to input the multiple single-behavior time series into a behavior prediction model, and the behavior prediction model performs modeling on each of the multiple single-behavior time series at the time point to obtain a temporal distribution of behaviors corresponding to the multiple single-behavior time series;
[0120] The training module 502 is used to train the behavior prediction model based on the temporal distribution of the behaviors corresponding to the multiple single behavior time series and the first loss value between the multiple single behavior time series. The behavior prediction model is used to predict the time point and type of at least one future behavior of the user based on the user's behavior sequence.
[0121] Optionally, the determining module 501 is specifically configured to split the user's behavior sequence according to the type of behavior to obtain the multiple single behavior sequences, and the user's behavior sequence corresponds to multiple behavior types.
[0122] Optionally, the determining module 501 is further configured to perform time coding on the multiple single-behavior sequences using a trigonometric function to obtain the multiple single-behavior time sequences.
[0123] Optionally, the determination module 501 is further specifically used to use the behavior prediction model to perform intensity value analysis on each of the multiple single behavior time series at the time point within a preset time period to obtain the temporal distribution of behaviors corresponding to the multiple single behavior time series.
[0124] It should be understood that the above scheme is to obtain the temporal distribution of behaviors corresponding to multiple single-behavior time series, but in fact it is to obtain the probability density distribution function of behaviors corresponding to multiple single-behavior time series within a certain time period.
[0125] Optionally, the behavior prediction model includes a behavior time sub-model, and the determination module 501 is specifically used to input the multiple single behavior time series into the behavior time sub-model in the behavior prediction model, and the behavior time sub-model models each single behavior time series in the multiple single behavior time series at the time point to obtain the temporal distribution of the behaviors corresponding to the multiple single behavior time series.
[0126] Optionally, the training module 502 is specifically used to train the behavior time sub-model in the behavior prediction model based on the temporal distribution of the behaviors corresponding to the multiple single behavior time series and the first loss value between the multiple single behavior time series.
[0127] Optionally, the behavior prediction model also includes a behavior relationship sub-model and a prediction sub-model. The determination module 501 is further used to input the multiple single behavior sequences into the behavior relationship sub-model to obtain the causal relationship between the occurrence of the behavior of each two single behavior sequences in the multiple single behavior sequences, and the causal relationship is used to characterize the relationship between the occurrence of the behavior of one single behavior sequence and the other single behavior sequence in each two single behavior sequences; the causal relationship between each two single behavior sequences in the multiple single behavior sequences and the temporal distribution of the behaviors corresponding to the multiple single behavior time series are input into the prediction sub-model, and the prediction sub-model performs sequence prediction based on the causal relationship and the distribution to obtain a predicted behavior sequence; the training module 502 is further used to train the behavior relationship sub-model and the prediction sub-model based on the first loss value and the second loss value between the predicted behavior sequence and the user's behavior sequence.
[0128] Optionally, the determining module 501 is further configured to obtain the causal relationship between each two single behavior sequences in the multiple single behavior sequences according to the sum of covariance values of each two single behavior sequences in the multiple single behavior sequences at all time points.
[0129] Optionally, the training module 502 is further specifically used to determine a third loss value between the predicted label and the real label of the user's behavior sequence, the real label is used to indicate the real information of the user, and the predicted label is used to indicate the information of the user predicted by the prediction sub-model; averaging the second loss value and the third loss value to obtain a fourth loss value; and training the behavior relationship sub-model and the prediction sub-model based on the first loss value and the fourth loss value.
[0130] Optionally, the determination module 501 is also used to input the causal relationship between each two single behavior sequences in the multiple single behavior sequences and the temporal distribution of the behaviors corresponding to the multiple single behavior time series into the prediction sub-model to obtain the prediction label corresponding to the user's behavior sequence.
[0131] Optionally, the training module 502 is further configured to obtain a fifth loss value based on the first loss value and the second loss value; train the behavior relationship sub-model based on the fifth loss value; and train the prediction sub-model based on the second loss value.
[0132] Optionally, the determination module 501 is further specifically used to determine a first numerical value based on a matrix composed of second-order partial derivatives of each weight in the behavior relationship sub-model and a vector composed of each weight in the behavior relationship sub-model; and obtain the fifth loss value based on the first numerical value, the first loss value and the second loss value.
[0133] It should be understood that the above process of determining the first value is achieved by utilizing the Pareto optimal solution principle.
[0134] Optionally, the determination module 501 is further configured to input the behavior sequence to be predicted into the behavior prediction model, and obtain a time point and a type corresponding to at least one future behavior of the behavior sequence to be predicted predicted by the behavior prediction model.
[0135] Figure 6 This is a schematic diagram of the structure of an electronic device provided by one or more embodiments of this specification.
[0136] For example, Figure 6 As shown, the electronic device 600 includes: a memory 601, a processor 602, and a computer program 603 stored in the memory 601 and running on the processor 602, wherein when the processor 602 executes the computer program 603, the electronic device can execute any one of the methods for training behavior prediction models introduced above.
[0137] One or more embodiments of this specification may divide the electronic device into functional modules based on the above-described method examples. For example, these modules may correspond to individual functional modules, or two or more functions may be integrated into a single processing module. The integrated modules may be implemented in hardware. It should be noted that the module division in one or more embodiments of this specification is illustrative and represents only one logical functional division. In actual implementation, other division methods may be used.
[0138] In the case of dividing each functional module into corresponding functional modules, the electronic device may include: a determination module and a training module, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0139] The electronic device provided in one or more embodiments of this specification is used to execute the above-mentioned method of training a behavior prediction model, and thus can achieve the same effect as the above-mentioned implementation method.
[0140] In the case of an integrated unit, the electronic device may include a processing module and a storage module. The processing module may be used to control and manage the operation of the electronic device, and the storage module may be used to support the electronic device in executing mutual program codes and data.
[0141] The processing module may be a processor or controller that implements or executes various exemplary logic blocks, modules, and circuits disclosed in conjunction with one or more embodiments of this specification. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processing system (DSP) and a microprocessor, and the storage module may be a memory.
[0142] The electronic device provided in one or more embodiments of this specification may specifically be a chip, component or module, and the electronic device may include a connected processor and memory; wherein the memory is used to store instructions, and when the electronic device is running, the processor may call and execute the instructions to enable the chip to execute any of the methods for training behavior prediction models described above.
[0143] One or more embodiments of the present specification provide a computer-readable storage medium having instructions stored therein. When the instructions are executed on a computer or a processor, the computer or the processor executes any one of the aforementioned methods for training a behavior prediction model.
[0144] One or more embodiments of this specification also provide a computer program product comprising instructions, which, when executed on a computer or processor, causes the computer or processor to execute the aforementioned related steps to implement any of the aforementioned methods for training a behavior prediction model.
[0145] Among them, the electronic device, computer-readable storage medium, computer program product or chip containing instructions provided in one or more embodiments of this specification are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.
[0146] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0147] In one or more embodiments of this specification, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0148] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0149] The above content is merely one or more specific implementations in this specification, but the scope of protection of one or more embodiments of this specification is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in one or more embodiments of this specification should be included in the scope of protection of one or more embodiments of this specification. Therefore, the scope of protection of one or more embodiments of this specification should be based on the scope of protection of the claims.
Claims
1. A method for training a behavior prediction model, the method comprising: Splitting the user's behavior sequence to obtain multiple single behavior sequences, each of which corresponds to a behavior and is used to record the corresponding relationship between the behavior and the time point; Time-encoding the multiple single-behavior sequences to obtain multiple single-behavior time series of the multiple single-behavior sequences; Inputting the multiple single-behavior time series into a behavior prediction model, and using the behavior prediction model to model each of the multiple single-behavior time series at the time point to obtain a temporal distribution of behaviors corresponding to the multiple single-behavior time series; Training the behavior prediction model based on the temporal distribution of behaviors corresponding to the multiple single-behavior time series and first loss values between the multiple single-behavior time series, wherein the behavior prediction model is used to predict the timing and type of at least one future behavior of the user based on the user's behavior sequence; The behavior prediction model includes a behavior time sub-model. The multiple single behavior time series are input into the behavior prediction model, and the behavior prediction model performs modeling on each of the multiple single behavior time series at the time point to obtain the temporal distribution of behaviors corresponding to the multiple single behavior time series, including: Inputting the multiple single-behavior time series into the behavior time sub-model in the behavior prediction model, and using the behavior time sub-model to model each of the multiple single-behavior time series at the time point to obtain the temporal distribution of behaviors corresponding to the multiple single-behavior time series; The behavior prediction model further includes a behavior relationship sub-model and a prediction sub-model, and the method further includes: Inputting the plurality of single-behavior sequences into the behavior relationship sub-model to obtain a causal relationship between every two single-behavior sequences in the plurality of single-behavior sequences, wherein the causal relationship is used to characterize the relationship between the occurrence of a behavior in one single-behavior sequence and the occurrence of a behavior in the other single-behavior sequence in each of the two single-behavior sequences; Inputting the causal relationship between every two single-behavior sequences in the multiple single-behavior time sequences and the temporal distribution of behaviors corresponding to the multiple single-behavior time sequences into the prediction sub-model, and performing sequence prediction by the prediction sub-model based on the causal relationship and the distribution to obtain a predicted behavior sequence; Training the behavior relationship sub-model and the prediction sub-model based on the first loss value and a second loss value between the predicted behavior sequence and the user's behavior sequence; The training of the behavior relationship sub-model and the prediction sub-model based on the first loss value and the second loss value between the predicted behavior sequence and the user's behavior sequence includes: Obtaining a fifth loss value according to the first loss value and the second loss value; The behavior relationship sub-model is trained based on the fifth loss value, and the prediction sub-model is trained based on the second loss value.
2. The method according to claim 1, wherein splitting the user's behavior sequence to obtain multiple single behavior sequences comprises: The user's behavior sequence is split according to the type of behavior to obtain the multiple single behavior sequences, and the user's behavior sequence corresponds to multiple behavior types.
3. The method according to claim 1, wherein time encoding the plurality of single-behavior sequences to obtain a plurality of single-behavior time series of the plurality of single-behavior sequences comprises: The multiple single-behavior sequences are time-coded using trigonometric functions to obtain the multiple single-behavior time sequences.
4. The method according to claim 1, wherein the behavior prediction model performs modeling of each of the multiple single-behavior time series at the time point to obtain a temporal distribution of behaviors corresponding to the multiple single-behavior time series, comprising: The behavior prediction model predicts the intensity value of each of the multiple single behavior time series at the time point within a preset time period to obtain the temporal distribution of the behaviors corresponding to the multiple single behavior time series.
5. The method according to claim 1, wherein training the behavior prediction model based on the temporal distribution of behaviors corresponding to the multiple single behavior time series and the first loss values between the multiple single behavior time series comprises: The behavior time sub-model in the behavior prediction model is trained based on the temporal distribution of the behaviors corresponding to the multiple single behavior time series and the first loss values between the multiple single behavior time series.
6. The method according to claim 1, wherein inputting the plurality of single-behavior sequences into the behavior relationship sub-model to obtain a causal relationship between every two single-behavior sequences in the plurality of single-behavior sequences comprises: A causal relationship between each two single behavior sequences in the multiple single behavior sequences is obtained according to the sum of covariance values of each two single behavior sequences in all time points.
7. The method according to claim 1, wherein obtaining a fifth loss value according to the first loss value and the second loss value comprises: Determine a first value according to a matrix formed by second-order partial derivatives of each weight in the relationship sub-model and a vector formed by each weight in the relationship sub-model; The fifth loss value is obtained according to the first numerical value, the first loss value and the second loss value.
8. The method according to claim 1, further comprising: The behavior sequence to be predicted is input into the behavior prediction model to obtain the time point and type corresponding to at least one future behavior of the behavior sequence to be predicted predicted by the behavior prediction model.
9. A device for training a behavior prediction model, the device comprising: a determination module, configured to split the user's behavior sequence into multiple single behavior sequences, each of which corresponds to a behavior and records the corresponding relationship between the behavior and the time point; The determining module is further configured to perform time coding on the plurality of single-behavior sequences to obtain a plurality of single-behavior time sequences of the plurality of single-behavior sequences; The determination module is further configured to input the multiple single-behavior time series into a behavior prediction model, and the behavior prediction model performs modeling on each of the multiple single-behavior time series at the time point to obtain a temporal distribution of behaviors corresponding to the multiple single-behavior time series; a training module, configured to train the behavior prediction model based on a temporal distribution of behaviors corresponding to the multiple single-behavior time series and a first loss value between the multiple single-behavior time series, wherein the behavior prediction model is configured to predict a timing and type of at least one future behavior of the user based on the user's behavior series; The behavior prediction model includes a behavior time sub-model, and the determination module is specifically used to input the multiple single behavior time series into the behavior time sub-model in the behavior prediction model, and use the behavior time sub-model to model each single behavior time series in the multiple single behavior time series at the time point to obtain the temporal distribution of the behaviors corresponding to the multiple single behavior time series; The behavior prediction model further includes a behavior relationship sub-model and a prediction sub-model, and the determination module is further configured to: input the multiple single behavior sequences into the behavior relationship sub-model to obtain a causal relationship between every two single behavior sequences in the multiple single behavior sequences, wherein the causal relationship is used to characterize the relationship between the occurrence of a behavior in one single behavior sequence and the occurrence of a behavior in another single behavior sequence in each of the two single behavior sequences; Inputting the causal relationship between every two single-behavior sequences in the multiple single-behavior time sequences and the temporal distribution of behaviors corresponding to the multiple single-behavior time sequences into the prediction sub-model, and performing sequence prediction by the prediction sub-model based on the causal relationship and the distribution to obtain a predicted behavior sequence; The training module is further configured to train the behavior relationship sub-model and the prediction sub-model based on the first loss value and a second loss value between the predicted behavior sequence and the user's behavior sequence; The training module is further specifically used for: Obtaining a fifth loss value according to the first loss value and the second loss value; The behavior relationship sub-model is trained based on the fifth loss value, and the prediction sub-model is trained based on the second loss value.
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 computer program, the electronic device executes the method for training a behavior prediction model as described in any one of claims 1 to 8.
11. A computer-readable storage medium storing instructions, which, when executed on a computer or processor, causes the computer or processor to execute a method for training a behavior prediction model as described in any one of claims 1 to 8.
12. A computer program product comprising instructions, which, when executed on the computer or processor, causes the computer or processor to execute the method for training a behavior prediction model according to any one of claims 1 to 8.
Citation Information
Patent Citations
Personalized recommendation method and system for next shopping basket and medium
CN114119151A
Training method of behavior prediction model, and risk behavior prediction method and device
CN115169551A