Conversion Rate Estimation Method, Device, Electronic Device and Storage Medium
By extracting multiple behavior sequence segments from user historical behavior data, building a training sample set and training word embedding matrix, the problem of low conversion rate estimate accuracy in high-frequency scenarios is solved, and more accurate conversion rate estimates are achieved.
Patent Information
- Application Number
- CN201910979124.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-10-15
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2039-10-15
AI Technical Summary
In the high-frequency usage scenarios of the prior art, the accuracy of the conversion rate estimate is low, because only the user's click sequence is used as the training corpus, and the intrinsic connection between clicking and ordering behavior is not fully considered.
By extracting pure click sequence segments, clicking and placing order segments and purely placing order segments from the user's historical behavior data, the training sample set is constructed, and training samples are generated using the Skip-Gram model and negative sampling, the word embedding matrix is trained, and the conversion rate is estimated based on the current and historical merchants' word embedding vectors.
It improves the accuracy of the conversion rate estimate results, is suitable for high-frequency usage scenarios, fully considers the intrinsic connection between clicking and ordering behavior, and the distance expression of trained word embedding vectors in space is more accurate.
Smart Images

Figure CN110838021B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of Internet technologies, and particularly to a method, apparatus, electronic device, and storage medium for predicting conversion rates. Background Art
[0002] In the prior art, when predicting conversion rates using word embedding vectors, generally, the click sequences of users are used to train the word embedding vectors, and the word embedding vectors are used to predict conversion rates. Since only the click sequences of users are used as training corpora, it is not applicable to scenarios with high-frequency usage. In scenarios with high-frequency usage, the accuracy of the predicted conversion rates is relatively low. Summary of the Invention
[0003] Embodiments of the present application provide a method, apparatus, electronic device, and storage medium for predicting conversion rates to improve the accuracy of the predicted conversion rate results.
[0004] To solve the above problems, in a first aspect, embodiments of the present application provide a method for predicting conversion rates, including:
[0005] For each user, respectively extract, in chronological order, a pure click sequence segment, a click-and-place order sequence segment, and a pure place order sequence segment for a merchant from the user's historical behavior data;
[0006] Determine a training sample set for training a word embedding matrix according to the pure click sequence segment, click-and-place order sequence segment, and pure place order sequence segment corresponding to each user;
[0007] Train a word vector model according to the training sample set to obtain a word embedding matrix;
[0008] Determine a word embedding vector corresponding to the current merchant according to the word embedding matrix;
[0009] Determine the historical merchant targeted by the historical behavior data of the current user, and determine the word embedding vector corresponding to the historical merchant according to the word embedding matrix;
[0010] Predict the conversion rate of the current user for the current merchant according to the word embedding vector corresponding to the current merchant and the word embedding vector corresponding to the historical merchant.
[0011] In a second aspect, embodiments of the present application provide a conversion rate prediction apparatus, including:
[0012] A sequence extraction module, configured to, for each user, respectively extract, in chronological order, a pure click sequence segment, a click-and-place order sequence segment, and a pure place order sequence segment for a merchant from the user's historical behavior data;
[0013] A training sample determination module, configured to determine a training sample set for training a word embedding matrix according to the pure click sequence segment, click-and-place order sequence segment, and pure place order sequence segment corresponding to each user;
[0014] A training module, configured to train a word vector model according to the training sample set to obtain a word embedding matrix;
[0015] A current vector determination module, configured to determine a word embedding vector corresponding to the current merchant according to the word embedding matrix;
[0016] A historical vector determination module, configured to determine a historical merchant targeted by the historical behavior data of the current user, and determine a word embedding vector corresponding to the historical merchant according to the word embedding matrix;
[0017] A conversion rate prediction module, configured to predict the conversion rate of the current user for the current merchant according to the word embedding vector corresponding to the current merchant and the word embedding vector corresponding to the historical merchant.
[0018] In a third aspect, an embodiment of the present application further discloses an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the conversion rate prediction method described in the embodiment of the present application is implemented.
[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the conversion rate prediction method disclosed in the embodiment of the present application are implemented.
[0020] The conversion rate prediction method, device, electronic device, and storage medium disclosed in the embodiments of the present application extract, for each user, a pure click sequence segment, a click-and-place order sequence segment, and a pure place order sequence segment for merchants from the historical behavior data of the user in chronological order. According to the pure click sequence segment, click-and-place order sequence segment, and pure place order sequence segment corresponding to each user, a training sample set for training a word embedding matrix is determined. A word vector model is trained according to the training sample set to obtain a word embedding matrix. A word embedding vector corresponding to the current merchant is determined according to the word embedding matrix, and according to the word embedding vector, a historical merchant targeted by the historical behavior data of the current user is determined, and a word embedding vector corresponding to the historical merchant is determined. The conversion rate of the current user for the current merchant is predicted according to the word embedding vector corresponding to the current merchant and the word embedding vector corresponding to the historical merchant. Since the internal connection between click and place order behaviors is fully considered when organizing the training corpus, that is, the training sample set, the corpus contains richer and more reasonable behavior information, so that the distance expression of the trained word embedding vectors in space is more accurate, which is more suitable for high-frequency usage scenarios, thereby improving the accuracy of the conversion rate prediction result. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0022] Figure 1 is a flowchart of the conversion rate prediction method according to the first embodiment of the present application;
[0023] Figure 2 is a flowchart of extracting pure click sequence segments, click-and-order sequence segments, and pure order sequence segments in the embodiments of the present application;
[0024] Figure 3 is a schematic structural diagram of the conversion rate prediction device according to the second embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0025] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts fall within the scope of protection of the present application.
[0026] Embodiment 1
[0027] A conversion rate prediction method disclosed in this embodiment, as Figure 1 shown, the method includes: Step 110 to Step 150.
[0028] Step 110, for each user, respectively extract the pure click sequence segment, click-and-order sequence segment, and pure order sequence segment for the merchant from the user's historical behavior data in chronological order.
[0029] Among them, the pure click sequence segment refers to the sequence composed of the user's click behaviors for the merchant; the click-and-order sequence segment refers to the sequence composed of the user's click behaviors and order behaviors for the merchant, and the last behavior in the sequence segment is the order behavior, and other behaviors are all click behaviors; the pure order sequence segment refers to the sequence composed of the user's order behaviors for the merchant.
[0030] Obtain the historical behavior data of each user, and process the historical behavior data of each user separately to obtain the pure click sequence segment, click-and-place order sequence segment, and pure place order sequence segment of each user for merchants. When extracting the pure click sequence segment, click-and-place order sequence segment, and pure place order sequence segment corresponding to a user, first extract the click behavior and place order behavior for merchants from the historical behavior data of this user, form a behavior sequence with the click behavior and place order behavior in chronological order, and form a place order sequence with the place order behavior in chronological order. Segment the behavior sequence according to the first preset time interval and the place order behavior to obtain the pure click sequence segment and click-and-place order sequence segment, and segment the place order sequence according to the second preset time interval to obtain the pure place order sequence segment.
[0031] In an embodiment of the present application, for each user, respectively extract the pure click sequence segment, click-and-place order sequence segment, and pure place order sequence segment for merchants from the historical behavior data of the user in chronological order, including: Step 111 to Step 117.
[0032] Step 111, determine the currently processed user.
[0033] For a shopping platform or an integrated service platform, there will be many users. When determining the word embedding matrix corresponding to all merchants, the historical behavior data of all users on a platform can be analyzed. Process each user separately, and a user can be selected from all users as the currently processed user.
[0034] Step 112, obtain the historical behavior data of the currently processed user.
[0035] Obtain the historical behavior data of the currently processed user from the database.
[0036] Step 113, extract the behavior sequence of the currently processed user for merchants from the historical behavior data in chronological order.
[0037] Extract the behavior sequence corresponding to the click behavior and place order behavior of the currently processed user for merchants from the historical behavior data in chronological order. The behavior sequence can be expressed as follows:
[0038] click1, click2, click3, order1, click4,..., order n , click m ,... where click m represents the click behavior of the currently processed user for a certain merchant, and order n represents the place order behavior of the currently processed user for a certain merchant. For example, in the takeaway field, click mand order n Both can be represented by the POI (Point of Interest) corresponding to the merchant.
[0039] Step 114: Determine the order sequence corresponding to the order placement behavior according to the behavior sequence.
[0040] Name the behavior sequence as Sequence A, extract all order elements in the behavior sequence, that is, extract the elements corresponding to the order placement behaviors in the behavior sequence, and arrange them in ascending order of time to obtain the order sequence, named Sequence B. Sequence A and Sequence B can be expressed as follows:
[0041] A: click1, click2, click3, order1, click4,..., order n , click m ,...
[0042] B: order1, order2, order3...
[0043] Step 115: Truncate the behavior sequence according to the first preset time interval and the order placement behavior respectively to divide the behavior sequence into a pure click sequence segment and a click-and-order sequence segment.
[0044] For the behavior sequence, that is, Sequence A, starting from the beginning and traversing, if the time interval between two adjacent click behaviors is greater than the first preset time interval or an order placement behavior is encountered, truncate to generate a sequence segment, and then continue to traverse from the next position of the truncation behavior until the end to obtain multiple pure click sequence segments and click-and-order sequence segments. The obtained pure click sequence segments and click-and-order sequence segments can be expressed as follows:
[0045] a. Pure click sequence segment, such as: click1, click2, click3,..., click n
[0046] b. Click-and-order sequence segment, such as: click i , click i+1 , click i+2 ,..., order1
[0047] Step 116: Truncate the order sequence according to the second preset time interval to divide the order sequence into pure order sequence segments.
[0048] For the order placement sequence, i.e., sequence B, starting from the beginning and traversing, if the time interval between two adjacent order placement behaviors is greater than the second preset time interval, a sequence segment is truncated and generated. Then, starting from the next position after the truncated order placement, continue traversing until the end to obtain multiple pure order placement sequence segments. The obtained pure order placement sequence segments can be expressed as follows:
[0049] c. Pure order placement sequence segments, such as: order1, order2, order3, ……
[0050] Among them, the first preset time interval is less than the second preset time interval. The first preset time interval can be, for example, 30 minutes, and the second preset time interval can be, for example, 14 days.
[0051] Step 117, determine whether all pure click sequence segments, click-and-order sequence segments, and pure order placement sequence segments corresponding to all users are obtained. If not, execute step 111; if so, end.
[0052] For high-frequency usage scenarios, that is, scenarios with relatively frequent usage, such as the takeaway field, by generating pure click sequence segments, click-and-order sequence segments, and pure order placement sequence segments according to the behavior sequence, the internal relationship between click and order placement behaviors is fully considered, so that the training corpus contains richer and more reasonable behavior information, and more effective word embedding vectors applicable to high-frequency scenarios can be trained.
[0053] Step 120, determine the training sample set for training the word embedding matrix according to the pure click sequence segments, click-and-order sequence segments, and pure order placement sequence segments corresponding to each user.
[0054] For each sequence segment, determine the training samples corresponding to the sequence segment according to the sample determination method of the word vector (word2vec) model. The training samples of all sequence segments form the training sample set for training the word embedding matrix.
[0055] In an embodiment of the present application, the determining the training sample set for training the word embedding matrix according to the pure click sequence segments, click-and-order sequence segments, and pure order placement sequence segments corresponding to each user includes: generating first training samples according to the pure click sequence segments, generating second training samples according to the click-and-order sequence segments, and generating third training samples according to the pure order placement sequence segments; for each user, respectively mix the first training samples, second training samples, and third training samples to obtain the training sample set for training the word embedding matrix.
[0056] Process the pure click sequence segment, click-and-place order sequence segment, and pure place order sequence segment corresponding to each user respectively to obtain the first training sample, second training sample, and third training sample corresponding to each user. When generating the above first training sample, second training sample, and third training sample, the word2vec method can be used for generation, for example, generated through the CBOW (Continuous Bag-of-Words) or Skip-Gram model. After generating the first training sample, second training sample, and third training sample, randomly shuffle the order of each training sample in the first training sample, second training sample, and third training sample corresponding to one user, so as to mix the first training sample, second training sample set, and third training sample together to obtain all the training samples corresponding to one user, and then arrange the training samples corresponding to all users together to obtain the training sample set for training the word embedding matrix. Mixing the three training samples as the training corpus fully considers the internal connection between click and place order behaviors, making the training corpus contain richer and more reasonable behavior information.
[0057] In an embodiment of the present application, generating the first training sample according to the pure click sequence segment, generating the second training sample according to the click-and-place order sequence segment, and generating the third training sample according to the pure place order sequence segment includes: using the Skip-Gram model and negative sampling to generate the first training sample according to the pure click sequence segment; using the Skip-Gram model and negative sampling to generate the second training sample according to the click-and-place order sequence segment; using the Skip-Gram model and negative sampling to generate the third training sample according to the pure place order sequence segment.
[0058] Among them, the input of the Skip-Gram model is the word vector of a specific word, and the output is the context word vector corresponding to the specific word.
[0059] For example, for the pure click sequence segment "C1, C2, C3, C4, C5, C6, C7, C8", when the center word is C5 and the skip_window of the Skip-Gram model is 2, C3, C4, C5, C6, C7 are the words in the window, then another word in the window is the positive sample (such as C3), and then randomly select a preset number of other words, that is, other merchants, as negative sampling words. For example, the obtained first training sample is "C5, C3, Ci, Cj, Ck, Cm", and Ci, Cj, Ck, Cm are negative sampling words.
[0060] For the click-and-place order sequence segment "C1, C2, C3, C4, C5, C6, C7, C8, O1", when the central word is C5 and the skip_window of the Skip-Gram model is 2, C3, C4, C5, C6, C7 are the words in the window, and O1 is the fixed positive sample. Another word in the window is the positive sample (such as C3). Then, a preset number of other words, that is, other merchants, are randomly selected as negative sampling words. For example, the second training sample obtained is "C5, C3, Ci, Cj, Ck, Cm, O1", where Ci, Cj, Ck, Cm are the negative sampling words.
[0061] For the pure place order sequence segment "O1, O2, O3, O4, O5, O6, O7, O8", when the central word is O5 and the skip_window of the Skip-Gram model is 2, O3, O4, O5, O6, O7 are the words in the window. Another word in the window is the positive sample (such as O3). Then, a preset number of other words, that is, other merchants, are randomly selected as negative sampling words. For example, the third training sample obtained is "O5, O3, Oi, Oj, Ok, Om", where Oi, Oj, Ok, Om are the negative sampling words.
[0062] In the embodiments of the present application, by using the Skip-Gram model and negative sampling to generate a training sample set, it is more suitable for large corpora, such as the takeaway field, and a more reasonable training corpus can be obtained. When training the word embedding matrix subsequently, the word vector model is the Skip-Gram model.
[0063] Step 130: Train the word vector model according to the training sample set to obtain a word embedding matrix.
[0064] The word vector model (i.e., the word2vec model) is used to train the word embedding matrix, including the CBOW model and the Skip-Gram model. In the embodiments of the present application, the Skip-Gram model is used.
[0065] Input the central word in the training sample into the word vector model, and use the other words in the training sample as output words. Adjust the weights in the word vector model according to the probabilities corresponding to each output word. Finally, after the word vector model is trained, extract the weight matrix from the input layer to the hidden layer in the word vector model, and this weight matrix is the word embedding matrix. The word embedding matrix includes the word embedding vectors corresponding to each merchant.
[0066] In an embodiment of the present application, when using the first training sample to train the word vector model, the first loss function is expressed as follows:
[0067]
[0068]
[0069] Among them, Loss1 is the first loss function, and D p1 is the set of sample pairs composed of the central word l1 and the positive sample c1 in the first training sample, and D n1 is the set of sample pairs composed of the central word l1 and the negative sampling word d1 in the first training sample, v l1 is the word embedding vector corresponding to the central word l1, v c1 is the word embedding vector corresponding to the positive sample c1, v′ c1 is the transposed vector of v c1 ; v d1 is the word embedding vector corresponding to the negative sampling word d1, v′ d1 is the transposed vector of v d1 ; refers to the value of the variable θ1 when the expression in the following parentheses takes the maximum value. θ1 is a variable, that is, it refers to v l1 and v c1 and v d1 ;
[0070] The second loss function used when training the word vector model with the second training sample is expressed as follows:
[0071]
[0072]
[0073] Among them, Loss2 is the second loss function, and D p2 is the set of sample pairs composed of the central word l2 and the positive sample c2 in the second training sample, and D n2 is the set of sample pairs composed of the central word l2 and the negative sampling word d2 in the second training sample, v l2 is the word embedding vector corresponding to the central word l2, v c2 is the word embedding vector corresponding to the positive sample c2, v′ c2 is the transposed vector of v c2 ; v d2 is the word embedding vector corresponding to the negative sampling word d2, v lb is the word embedding vector corresponding to the fixed positive sample lb in the second training sample set, v′ lb is the transposed vector of v lb ; refers to the value of the variable θ2 when the expression in the following parentheses takes the maximum value. θ2 is a variable, that is, it refers to v l2 and v c2 and v d2 ;
[0074] The third loss function used when training the word vector model with the third training sample is expressed as follows:
[0075]
[0076]
[0077] Among them, Loss3 is the third loss function, and D p3 is the set of sample pairs composed of the central word l3 and the positive sample c3 in the third training sample, and D n3 is the set of sample pairs composed of the central word l3 and the negative sampling word d3 in the third training sample, v l3 is the word embedding vector corresponding to the central word l3, v c3 is the word embedding vector corresponding to the positive sample c3, v′ c3 is the transposed vector of v c3 , v d3 is the word embedding vector corresponding to the negative sampling word d3, v′ d3 is the transposed vector of v d3 refers to the value of the variable θ3 when the expression in the following parentheses takes the maximum value. θ3 is a variable, that is, it refers to v l3 , v c3 and v d3 .
[0078] The value of the first loss function Loss1(θ1) is determined by the variable θ1, and the value of the variable θ1 is the value of the variable v when the expression takes the maximum value l1 , v c1 and v d1 . At this time, substitute the value of the variable θ1 into the formula of the first loss function Loss1(θ1) to obtain the value of the first loss function. The value of the second loss function Loss2(θ2) is determined by the variable θ2, and the value of the variable θ2 is the value of the variable v when the expression takes the maximum value l2 , v c2 and v d2 . At this time, substitute the value of the variable θ2 into the formula of the second loss function Loss2(θ2) to obtain the value of the second loss function. The value of the third loss function Loss3(θ3) is determined by the variable θ3, and the value of the variable θ3 is the value of the variable v when the expression takes the maximum value l3 , v c3 and v d3 . At this time, substitute the value of the variable θ3 into the formula of the third loss function Loss3(θ3) to obtain the value of the third loss function.
[0079] It should be noted that the word embedding vectors corresponding to the above central words are taken from the word embedding matrix used for the central words. The word embedding vectors of the positive samples, the word embedding vectors of the negative sampling words, and the word embedding vectors of the fixed positive samples are all taken from the word embedding matrix used for the non - central words. Among them, the word embedding matrix used for the central words is the network weight from the input layer to the hidden layer in the word vector model, and the word embedding matrix used for the non - central words is the network weight from the hidden layer to the output layer in the word vector model. After the word vector model is trained, the word embedding matrix used for the central words is used as the word embedding matrix for subsequent conversion rate prediction.
[0080] Taking a training sample "O5, O3, Oi" as an example, where O5 is the central word, O3 is the positive sample, and Oi is the negative sampling word. For the sake of convenience of description, assume that the dimension of the word embedding vector corresponding to each merchant is 2. After training with this training sample, the word embedding vector corresponding to O5 is taken from the word embedding matrix used for the central words, and the word embedding vectors corresponding to O3 and Oi are taken from the word embedding matrix used for the non - central words. Assume that the word embedding vector corresponding to O5 is (0.3, 0.5), the word embedding vector corresponding to O3 is (0.2, 0.8), and the word embedding vector corresponding to Oi is (0.7, 0.4). Then the inner product of the word embedding vector corresponding to O5 and the word embedding vector corresponding to O3 is 0.3 * 0.2 + 0.5 * 0.8 = 0.46. So the first half of the third loss function is log(1 / (1 + e^(-0.46))). The inner product of the word embedding vector corresponding to O5 and the word embedding vector corresponding to Oi is 0.3 * 0.7 + 0.2 * 0.4 = 0.29. Then the second half of the third loss function is log(1 / (1 + e^(0.29))). Therefore, the third loss function corresponding to this training sample is Loss3 = log(1 / (1 + e^(-0.46))) + log(1 / (1 + e^(0.29))).
[0081] Take a batch of training samples in sequence from the training sample set obtained after the mixed samples, use this batch of training samples to train the word vector model, and adjust the parameters of the model. This batch of training samples includes the first training sample, the second training sample, and the third training sample. Calculate the value of the loss function corresponding to each training sample in this batch of training samples according to the formula of the above loss function respectively. Divide the sum of the values of the loss function corresponding to each training sample by the number of training samples to obtain the value of the loss function after this training. Perform backpropagation learning according to the value of this loss function to adjust the parameters in the word vector model, that is, adjust the weights from the input layer to the hidden layer and the weights from the hidden layer to the output layer in the word vector model, so as to realize the adjustment of the word embedding matrix. Then select the next batch of training samples, and adjust the word embedding matrix according to the value of the loss function. Train the word vector model in this way until the value of the loss function meets the requirements, that is, the value of the loss function is less than the preset value, and the word vector model training is completed. Extract the weight matrix from the input layer to the hidden layer in the word vector model, and this weight matrix is the obtained word embedding matrix.
[0082] Step 140: Determine the word embedding vector corresponding to the current merchant according to the word embedding matrix.
[0083] The current merchant is the merchant whose conversion rate is to be estimated. The word embedding matrix is composed of the word embedding vectors corresponding to each merchant. Extract the row vector corresponding to the current merchant from the word embedding matrix, and transpose the row vector to obtain the word embedding vector corresponding to the current merchant. Alternatively, multiply the one-hot encoding of the current merchant by the word embedding matrix to obtain the word embedding vector corresponding to the current merchant.
[0084] Step 150: Determine the historical merchant targeted by the historical behavior data of the current user, and determine the word embedding vector corresponding to the historical merchant according to the word embedding matrix.
[0085] In the embodiment of the present application, the conversion rate of the user to the current merchant is estimated. Therefore, the historical behavior data of the current user can be the order placement behavior. Determine the historical merchant targeted by the user's order placement behavior, and extract the word embedding vector corresponding to the historical merchant from the word embedding matrix.
[0086] In an embodiment of the present application, the determining the historical merchant targeted by the historical behavior data of the current user includes: determining the preset number of merchants that the current user recently placed orders with according to the historical behavior data of the current user as the historical merchant. Taking the preset number of merchants that the current user recently placed orders with as the historical merchant can reflect the user's recent interests, thereby improving the accuracy of subsequent conversion rate estimation.
[0087] Step 160: Estimate the conversion rate of the current user to the current merchant according to the word embedding vector corresponding to the current merchant and the word embedding vector corresponding to the historical merchant.
[0088] In one embodiment of the present application, estimating the conversion rate of the current user to the current merchant based on the word embedding vector corresponding to the current merchant and the word embedding vector corresponding to the historical merchant includes: determining the mean vector of the word embedding vectors corresponding to the historical merchant; calculating the difference vector between the mean vector and the word embedding vector corresponding to the current merchant; and inputting the difference vector into a conversion rate prediction model to obtain the conversion rate of the current user to the current merchant.
[0089] Among them, the conversion rate prediction model can be a neural network model.
[0090] Taking the preset number of merchants that the current user recently placed orders for as historical merchants, obtaining the mean vector of the word embedding vectors of the historical merchants, and using the difference vector between the mean vector and the word embedding vector corresponding to the current merchant as the input feature of the conversion rate prediction model and inputting it into the conversion rate prediction model to obtain the conversion rate of the current user to the current merchant fully considers the user's recent interests and further improves the accuracy of conversion rate prediction.
[0091] For example, for the current merchant, take out the word embedding vector corresponding to the current merchant from the word embedding matrix, assumed to be A (such as a 32-dimensional vector), take the mean vector of the word embedding vectors corresponding to the 15 merchants that the current user recently placed orders for 15 times, assumed to be B (such as a 32-dimensional vector), the 32-dimensional vector obtained by B - A is the difference vector, and this difference vector is used as the input feature of the conversion rate prediction model and input into the conversion rate prediction model to obtain the conversion rate of the current user to the current merchant.
[0092] The conversion rate prediction method disclosed in the embodiments of the present application extracts, for each user, in chronological order, a pure click sequence segment, a click-and-place order sequence segment, and a pure place order sequence segment for merchants from the user's historical behavior data. According to the pure click sequence segment, click-and-place order sequence segment, and pure place order sequence segment corresponding to each user, a training sample set for training the word embedding matrix is determined. The word vector model is trained according to the training sample set to obtain the word embedding matrix. The word embedding vector corresponding to the current merchant is determined according to the word embedding matrix, the historical merchant targeted by the historical behavior data of the current user is determined, and the word embedding vector corresponding to the historical merchant is determined according to the word embedding matrix. The conversion rate of the current user to the current merchant is estimated based on the word embedding vector corresponding to the current merchant and the word embedding vector corresponding to the historical merchant. Since the internal relationship between click and place order behaviors is fully considered when organizing the training corpus, that is, the training sample set, the corpus contains richer and more reasonable behavior information, so that the distance expression of the trained word embedding vectors in space is more accurate, which is more suitable for high-frequency usage scenarios, thereby improving the accuracy of the conversion rate prediction result.
[0093] Example 2
[0094] A conversion rate prediction device disclosed in this embodiment is as follows Figure 3 shown. The conversion rate prediction device 300 includes:
[0095] A sequence extraction module 310, which is used to extract, for each user, a pure click sequence segment, a click-and-place order sequence segment, and a pure place order sequence segment for merchants from the user's historical behavior data respectively in chronological order;
[0096] A training sample determination module 320, which is used to determine a training sample set for training a word embedding matrix according to the pure click sequence segment, the click-and-place order sequence segment, and the pure place order sequence segment corresponding to each user;
[0097] A training module 330, which is used to train a word vector model according to the training sample set to obtain a word embedding matrix;
[0098] A current vector determination module 340, which is used to determine a word embedding vector corresponding to the current merchant according to the word embedding matrix;
[0099] A historical vector determination module 350, which is used to determine a historical merchant targeted by the historical behavior data of the current user, and determine a word embedding vector corresponding to the historical merchant according to the word embedding matrix;
[0100] A conversion rate prediction module 360, which is used to predict the conversion rate of the current user for the current merchant according to the word embedding vector corresponding to the current merchant and the word embedding vector corresponding to the historical merchant.
[0101] Optionally, the sequence extraction module includes:
[0102] A user selection unit, which is used to determine the currently processed user;
[0103] A data acquisition unit, which is used to acquire the historical behavior data of the currently processed user;
[0104] A behavior sequence extraction unit, which is used to extract the behavior sequence of the currently processed user for merchants from the historical behavior data in chronological order;
[0105] An order placement sequence determination unit, which is used to determine an order placement sequence corresponding to the order placement behavior according to the behavior sequence;
[0106] A first sequence segment truncation unit, which is used to truncate the behavior sequence respectively according to a first preset time interval and the order placement behavior, so as to divide the behavior sequence into a pure click sequence segment and a click-and-place order sequence segment;
[0107] A second sequence segment truncation unit, configured to truncate the order placing sequence at a second preset time interval, so as to divide the order placing sequence into pure order placing sequence segments;
[0108] A loop control unit, configured to loop and execute the operations of determining the current processing user, segmenting the behavior sequence, and segmenting the order placing sequence until pure click sequence segments, click-and-order sequence segments, and pure order placing sequence segments corresponding to each user are obtained.
[0109] Optionally, the training sample determination module includes:
[0110] A training sample generation unit, configured to generate a first training sample according to the pure click sequence segments, generate a second training sample according to the click-and-order sequence segments, and generate a third training sample according to the pure order placing sequence segments;
[0111] A training sample mixing unit, configured to mix the first training sample, the second training sample, and the third training sample respectively for each user to obtain a training sample set for training the word embedding matrix.
[0112] Optionally, the training sample generation unit is specifically configured to:
[0113] According to the pure click sequence segments, use the Skip-Gram model and negative sampling to generate a first training sample;
[0114] According to the click-and-order sequence segments, use the Skip-Gram model and negative sampling to generate a second training sample;
[0115] According to the pure order placing sequence segments, use the Skip-Gram model and negative sampling to generate a third training sample.
[0116] Optionally, the first loss function used for training the word vector model with the first training sample is expressed as follows:
[0117]
[0118]
[0119] Where Loss1 is the first loss function, D p1 is a set of sample pairs composed of the central word l1 and the positive sample c1 in the first training sample, D n1 is a set of sample pairs composed of the central word l1 and the negative sampling word d1 in the first training sample, v l1 is the word embedding vector corresponding to the central word l1, v c1 is the word embedding vector corresponding to the positive sample c1, v′ c1 is the transposed vector of v c1 and v d1is the word embedding vector corresponding to the negative sampling word d1, v′ d1 is v d1 's transposed vector, refers to the value of the variable θ1 when the expression in the following parentheses takes the maximum value. θ1 is a variable, that is, it refers to v l1 、v c1 and v d1 ;
[0120] The second loss function used when training the word vector model with the second training sample is expressed as follows:
[0121]
[0122]
[0123] where Loss2 is the second loss function, D p2 is the set of sample pairs composed of the center word l2 and the positive sample c2 in the second training sample, D n2 is the set of sample pairs composed of the center word l2 and the negative sampling word d2 in the second training sample, v l2 is the word embedding vector corresponding to the center word l2, v c2 is the word embedding vector corresponding to the positive sample c2, v′ c2 is v c2 's transposed vector, v d2 is the word embedding vector corresponding to the negative sampling word d2, v′ d2 is v d2 's transposed vector, v lb is the word embedding vector corresponding to the fixed positive sample lb in the second training sample set, v′ lb is v lb 's transposed vector, refers to the value of the variable θ2 when the expression in the following parentheses takes the maximum value. θ2 is a variable, that is, it refers to v l2 、v c2 and v d2 ;
[0124] The third loss function used when training the word vector model with the third training sample is expressed as follows:
[0125]
[0126]
[0127] where Loss3 is the third loss function, D p3 is the set of sample pairs composed of the center word l3 and the positive sample c3 in the third training sample, D n3is the set of sample pairs composed of the central word l3 and the negative sampling word d3 in the third training sample, v l3 is the word embedding vector corresponding to the central word l3, v c3 is the word embedding vector corresponding to the positive sample c3, v′ c3 is v c3 's transposed vector, v d3 is the word embedding vector corresponding to the negative sampling word d3, v′ d3 is v d3 's transposed vector, refers to the value of the variable θ3 when the expression in the following parentheses takes the maximum value. θ3 is a variable, that is, it refers to v l3 、v c3 and v d3 .
[0128] Optionally, the historical vector determination module includes:
[0129] A historical merchant determination unit, configured to determine a preset number of merchants that the current user has recently placed orders with according to the historical behavior data of the current user, as the historical merchants.
[0130] Optionally, the conversion rate prediction module includes:
[0131] A mean vector obtaining unit, configured to determine the mean vector of the word embedding vectors corresponding to the historical merchants;
[0132] A difference vector calculation unit, configured to calculate the difference vector between the mean vector and the word embedding vector corresponding to the current merchant;
[0133] A conversion rate prediction unit, configured to input the difference vector into a conversion rate prediction model to obtain the conversion rate of the current user for the current merchant.
[0134] The conversion rate prediction device provided by the embodiments of the present application is used to implement the steps of the conversion rate prediction method described in Embodiment 1 of the present application. For the specific implementation manners of the modules of the device, refer to the corresponding steps, which will not be elaborated here.
[0135] The conversion rate prediction device disclosed in the embodiments of the present application extracts, for each user, a pure click sequence segment, a click-and-place order sequence segment, and a pure place order sequence segment for merchants from the historical behavior data of the current user in chronological order through a sequence extraction module. A training sample determination module determines a training sample set for training a word embedding matrix based on the pure click sequence segment, the click-and-place order sequence segment, and the pure place order sequence segment corresponding to each user. A training module trains a word vector model based on the training sample set to obtain a word embedding matrix. A current vector determination module determines a word embedding vector corresponding to the current merchant based on the word embedding matrix. A historical vector determination module determines a historical merchant targeted by the historical behavior data of the current user and determines a word embedding vector corresponding to the historical merchant based on the word embedding matrix. A conversion rate prediction module predicts the conversion rate of the current user for the current merchant based on the word embedding vector corresponding to the current merchant and the word embedding vector corresponding to the historical merchant. Since the internal relationship between click and place order behaviors is fully considered when organizing the training corpus, i.e., the training sample set, the corpus contains richer and more reasonable behavior information, so that the distance expression of the trained word embedding vectors in space is more accurate, which is more suitable for frequently used scenarios, thereby improving the accuracy of the conversion rate prediction result.
[0136] Correspondingly, the embodiments of the present application also disclose an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the conversion rate prediction method as described in Embodiment 1 of the present application is implemented. The electronic device can be a server, a PC, a mobile terminal, a personal digital assistant, a tablet computer, etc.
[0137] The embodiments of the present application also disclose a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the conversion rate prediction method as described in Embodiment 1 of the present application are implemented.
[0138] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For the relevant parts, refer to the partial description of the method embodiments.
[0139] The above has introduced in detail a conversion rate prediction method, device, electronic device, and storage medium provided by the embodiments of the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
[0140] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment 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 such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
Claims
1. A conversion rate prediction method, characterized in that, Including: For each user, respectively extract, in chronological order, a pure click sequence segment, a click-and-place order sequence segment, and a pure place order sequence segment for a merchant from the user's historical behavior data; Determine a training sample set for training a word embedding matrix according to the pure click sequence segment, the click-and-place order sequence segment, and the pure place order sequence segment corresponding to each user; Train a word vector model according to the training sample set to obtain a word embedding matrix; Determine a word embedding vector corresponding to the current merchant according to the word embedding matrix; Determine a historical merchant targeted by the historical behavior data of the current user, and determine a word embedding vector corresponding to the historical merchant according to the word embedding matrix; Estimate the conversion rate of the current user for the current merchant according to the word embedding vector corresponding to the current merchant and the word embedding vector corresponding to the historical merchant; Among them, the estimating the conversion rate of the current user for the current merchant according to the word embedding vector corresponding to the current merchant and the word embedding vector corresponding to the historical merchant includes: Determine a mean vector of the word embedding vector corresponding to the historical merchant; Calculate a difference vector between the mean vector and the word embedding vector corresponding to the current merchant; Input the difference vector into a conversion rate estimation model to obtain the conversion rate of the current user for the current merchant; Among them, the extracting, for each user, respectively in chronological order, a pure click sequence segment, a click-and-place order sequence segment, and a pure place order sequence segment for a merchant from the user's historical behavior data includes: Determine the currently processed user; Obtain the historical behavior data of the currently processed user; Extract, in chronological order, a behavior sequence of the currently processed user for a merchant from the historical behavior data; Determine an order sequence corresponding to the place order behavior according to the behavior sequence; Truncate the behavior sequence respectively according to a first preset time interval and the place order behavior to divide the behavior sequence into a pure click sequence segment and a click-and-place order sequence segment; Truncate the order sequence according to a second preset time interval to divide the order sequence into a pure place order sequence segment; Loop and execute the above operations of determining the currently processed user and dividing the behavior sequence and the order sequence until a pure click sequence segment, a click-and-place order sequence segment, and a pure place order sequence segment corresponding to each user are obtained; where the pure click sequence segment refers to a sequence composed of the user's click behaviors for a merchant; the click-and-place order sequence segment refers to a sequence composed of the user's click behaviors and place order behaviors for a merchant, and the last behavior of the sequence segment is a place order behavior, and other behaviors are all click behaviors; the pure place order sequence segment refers to a sequence composed of the user's place order behaviors for a merchant.
2. The method according to claim 1, wherein The determining a training sample set for training a word embedding matrix according to the pure click sequence segment, the click-and-place order sequence segment, and the pure place order sequence segment corresponding to each user includes: Generate a first training sample according to the pure click sequence segment, generate a second training sample according to the click-and-place order sequence segment, and generate a third training sample according to the pure place order sequence segment; For each user, the first training sample, the second training sample, and the third training sample are respectively mixed to obtain a training sample set for training the word embedding matrix.
3. The method according to claim 2, characterized in that, The generating of the first training sample according to the pure click sequence segment, the second training sample according to the click-and-place order sequence segment, and the third training sample according to the pure place order sequence segment includes: Using the Skip-Gram model and negative sampling to generate the first training sample according to the pure click sequence segment; Using the Skip-Gram model and negative sampling to generate the second training sample according to the click-and-place order sequence segment; Using the Skip-Gram model and negative sampling to generate the third training sample according to the pure place order sequence segment.
4. The method according to claim 3, characterized in that The first loss function used when training the word vector model with the first training sample is expressed as follows: Among them, Loss1 is the first loss function, D p1 is the set of sample pairs composed of the central word l1 and the positive sample c1 in the first training sample, D n1 is the set of sample pairs composed of the central word l1 and the negative sampling word d1 in the first training sample, is the word embedding vector corresponding to the central word l1, is the word embedding vector corresponding to the positive sample c1, is the transposed vector of, is the word embedding vector corresponding to the negative sampling word d1, is the transposed vector of, argm refers to the value of the variable when the expression in the following parentheses takes the maximum value, is the variable, that is, refers to, and; The second loss function used when training the word vector model with the second training sample is expressed as follows: Among them, Loss2 is the second loss function, D p2 is the set of sample pairs composed of the central word l2 and the positive sample c2 in the second training sample, D n2 is the set of sample pairs composed of the central word l2 and the negative sampling word d2 in the second training sample, is the word embedding vector corresponding to the central word l2, is the word embedding vector corresponding to the positive sample c2, is the transposed vector of, is the word embedding vector corresponding to the negative sampling word d2, is the transposed vector of, is the word embedding vector corresponding to the fixed positive sample in the second training sample, is the transposed vector of, argm refers to the value of the variable when the expression in the following parentheses takes the maximum value, is the variable, that is, refers to, and; The third loss function used when training the word vector model with the third training sample is expressed as follows: Among them, Loss3 is the third loss function, D p3 is the set of sample pairs composed of the central word l3 and the positive sample c3 in the third training sample, D n3 is the set of sample pairs composed of the central word l3 and the negative sampling word d3 in the third training sample, is the word embedding vector corresponding to the central word l3, is the word embedding vector corresponding to the positive sample c3, is the transposed vector of, is the word embedding vector corresponding to the negative sampling word d3, is the transposed vector of, argm refers to the value of the variable when the expression in the following parentheses takes the maximum value, is the variable, that is, refers to, and.
5. The method according to claim 1, wherein The determining of the historical merchant targeted by the historical behavior data of the current user includes: According to the historical behavior data of the current user, determining the preset number of merchants that the current user recently placed orders with as the historical merchants.
6. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the conversion rate prediction method according to any one of claims 1 to 5.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the conversion rate prediction method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Advertisement putting method and device and computer readable storage medium
CN109801100A
Click rate estimation method and system, medium and computing device
CN109992710A