Shop recommendation method, device and equipment
Technical Field
The application relates to the technical field of computers, in particular to a shop recommendation method, device and equipment.
Background
With the advent of the big data age, people are not easy to find the most wanted information on e-commerce websites when facing massive stores or commodity data. It is becoming more and more important for users to find satisfactory stores from massive store or commodity data and for e-commerce websites to mine long-tailed stores or commodities so as to recommend the stores or commodities to the users.
In some internet products, in order to facilitate a user to quickly find a desired product, personalized recommendation needs to be performed, an algorithm model is used to calculate a store recommendation that the user most probably clicks to generate a purchase record to the user, and a store recommendation method in the prior art mainly predicts a user click behavior by using a traditional machine learning model, for example: the user preference shop score is obtained by adopting logistic regression or decision tree, but the method randomly samples partial data, makes logistic regression in statistical software, and estimates the whole by using a sample.
Disclosure of Invention
In view of this, the embodiment of the application provides a store recommendation method, device and equipment, which are used for improving a store recommendation effect.
In order to solve the above technical problem, the embodiments of the present specification are implemented as follows:
the shop recommendation method provided by the embodiment of the specification comprises the following steps:
acquiring a first data characteristic log, wherein the data characteristic log comprises a user identifier, a shop identifier and historical behavior characteristics of a user, the shop identifier represents a shop recommended to the user, and the historical behavior characteristics represent actual operation behaviors of the user to the shop;
extracting a sample set from a database based on a set dimension according to the first data feature log, wherein each sample in the sample set comprises a user feature corresponding to the user identifier, a shop feature corresponding to the shop identifier, a cross feature of the user and the shop and the historical behavior feature, and the cross feature represents an interaction behavior between the user and the shop;
training a deep learning model by using the sample set to obtain a prediction model;
predicting candidate shops corresponding to the online users by adopting the prediction model to obtain shops to be recommended, which meet the conditions;
and recommending the shop to be recommended to the online user.
An embodiment of this specification provides a shop recommendation device, includes:
the system comprises a first data characteristic log obtaining module, a second data characteristic log obtaining module and a control module, wherein the first data characteristic log obtaining module is used for obtaining a first data characteristic log, the data characteristic log comprises a user identifier, a shop identifier and historical behavior characteristics of a user, the shop identifier represents a shop recommended to the user, and the historical behavior characteristics represent actual operation behaviors of the user to the shop;
a sample extraction module, configured to extract a sample set from a database based on a set dimension according to the first data feature log, where each sample in the sample set includes a user feature corresponding to the user identifier, a store feature corresponding to the store identifier, a cross feature of the user and the store, and the historical behavior feature, and the cross feature represents an interaction behavior between the user and the store;
the prediction model determining module is used for training a deep learning model by utilizing the sample set to obtain a prediction model;
the to-be-recommended shop determining module is used for predicting the candidate shops corresponding to the online users by adopting the prediction model to obtain the to-be-recommended shops meeting the conditions;
and the shop recommending module is used for recommending the shop to be recommended to the online user.
The shop recommendation device provided by the embodiment of the specification comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
acquiring a first data characteristic log, wherein the data characteristic log comprises a user identifier, a shop identifier and historical behavior characteristics of a user, the shop identifier represents a shop recommended to the user, and the historical behavior characteristics represent actual operation behaviors of the user to the shop;
extracting a sample set from a database based on a set dimension according to the first data feature log, wherein each sample in the sample set comprises a user feature corresponding to the user identifier, a shop feature corresponding to the shop identifier, a cross feature of the user and the shop and the historical behavior feature, and the cross feature represents an interaction behavior between the user and the shop;
training a deep learning model by using the sample set to obtain a prediction model;
predicting candidate shops corresponding to the online users by adopting the prediction model to obtain shops to be recommended, which meet the conditions;
and recommending the shop to be recommended to the online user.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects: selecting a sample set according to multiple dimensions; inputting the sample set into a deep learning model for training to obtain a prediction model; and (4) scoring the stores to be predicted by using a prediction model, and determining the stores recommended to the user according to the prediction scores. Because the sample set comprises the user characteristics, the shop characteristics, the cross characteristics and the historical behavior characteristics, the prediction accuracy of the deep learning model obtained by training is improved, and the deep learning model obtained by training is used for shop recommendation, the automatic characteristic cross combination capability of the model is effectively utilized, the recommendation diversity is increased, and the recommendation effect is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a schematic diagram of an application scenario of a store recommendation system in an embodiment of the present specification;
FIG. 2 is a schematic flow chart of a store recommendation method provided in an embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram of a store recommendation device corresponding to FIG. 2 provided in an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a store recommendation device corresponding to fig. 2 provided in an embodiment of the present specification.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
In the prior art, a store recommendation method mainly adopts a traditional machine learning model to predict a user click behavior, such as: the method comprises the steps of adopting logistic regression or decision trees to obtain the scores of user-preferred shops, determining which features are independent variables in a logistic regression calculation formula and which factor combinations are used as labels of a logistic regression model through an analyst, then extracting a part of sample data, performing logistic regression in statistical software, and calculating to obtain a commodity feature coefficient. However, the logistic regression method in the prior art needs to manually provide a coefficient for the screened features according to the business experience to obtain a formula for calculating the quality score of the commodity, the method has a large dependence on the business experience of an analyst, when the commodity is recommended, the coefficient for screening the features is given by the analyst, sample data is part of randomly sampled data, logistic regression is performed in statistical software, the whole sample is estimated, and big data analysis is performed on small data, so that deviation exists; potential features and cross features of the commodities are not easy to dig, and the recommendation effect is poor.
In order to solve the defects in the prior art, the scheme provides the following embodiments:
fig. 1 is a schematic diagram of an application scenario of a store recommendation system in an embodiment of the present specification.
As shown in FIG. 1, a personalized shop recommendation system with thousands of people and thousands of faces is realized in the aspect of solving the problem of how to recommend a proper shop for a user, so that the user can click the shop to further carry out a shop transaction. The method is characterized in that thousands of people can be understood as displaying different commodities according to the demands of buyers in the same resource position, and aims to improve the click rate and the transaction rate of the shops and provide better buyer experience. An application scenario diagram of the store recommendation system is shown in fig. 1, and mainly comprises several parts, namely feature extraction (feature extract), training sample generation (training data), model training (model training), model online prediction (model serving), retrieval (retrieval) and ranking (ranking). The operation behavior of the user can generate a corresponding data characteristic log (log), feature extraction can be performed on the data characteristic log according to preset conditions, a training sample is determined according to the extracted features, and the model is trained by adopting the training sample to obtain a prediction model. When the system receives a shop recommendation request, searching is carried out from an open source Database (for example, HBase for short) according to preset conditions, a plurality of shops recalled by the user are taken out, the characteristics of the user and the shops are scored to a model online prediction module in real time, and finally, the shops ranked at the top are recommended and displayed to the user according to the scores in a descending order. When the model scores on line, the feature logs are printed and flow back to an Open Data Processing Service (ODPS) and the trained model is imported and updated to the model online prediction module based on the feature log Data offline training model. The contents are respectively described in detail below, the trained prediction model is adopted to score and sort the candidate stores, and the stores to be recommended are selected according to the sorting and recommended to the user.
Fig. 2 is a schematic flow chart of a store recommendation method provided in an embodiment of the present specification. From the viewpoint of a program, the execution subject of the flow may be a program installed in an application server or an application client.
As shown in fig. 2, the process may include:
step 201: the method comprises the steps of obtaining a first data characteristic log, wherein the first data characteristic log comprises a user identification, a shop identification and historical behavior characteristics of a user, the shop identification represents a shop recommended to the user, and the historical behavior characteristics represent actual operation behaviors of the user on the shop.
A data feature log may represent data generated by a system, device, software, etc. in response to some input. For example, the Unix operating system may record messages that users log in and out. In the scheme, the data characteristic log can record the prediction scores of all shops and behavior data corresponding to behaviors of the recommended shop, such as browsing, clicking, collecting, sharing and purchasing by the user.
The data characteristic log can include user identification (such as user name and user ID), shop identification and operation behavior (such as click) performed by the user for the corresponding shop. The shop with the shop identifier may represent a shop recommended to the user, and the historical behavior feature represents an actual operation behavior made by the user on the shop recommended by the system, for example: may indicate a behavior of whether the user makes a click or a favorite behavior with respect to the recommended store, and the like.
Step 202: extracting a sample set from a database based on a set dimension according to the first data feature log, wherein each sample in the sample set comprises a user feature corresponding to the user identifier, a shop feature corresponding to the shop identifier, a cross feature of the user and the shop, and the historical behavior feature, and the cross feature represents an interaction behavior between the user and the shop.
The data feature log comprises user identification and shop identification, and the user features of the users corresponding to the user identification can be extracted from the database according to the user identification. And extracting the shop characteristics of the shop corresponding to the shop identification from a database according to the shop identification. The user historical behavior characteristics can represent interaction characteristics between the user and the shop, and the interaction characteristics between the user and the shop can represent whether the user clicks, browses and other behaviors exist in the recommended shop (for example, whether the user clicks, browses, collects or shares the shop).
The dimensionality can represent a method for analyzing original data based on multi-azimuth statistics (time, region, user, target object and the like) to obtain data based on each dimensionality. In the above steps, the dimension may represent a reference from which the feature is selected from the database, for example: the features may be selected according to user dimensions, or the features in the database may be sorted according to store dimensions, cross dimensions, or the like.
The Database (Database) may represent a warehouse for organizing, storing and managing data according to a data structure, and in this embodiment, the Database may be a Database corresponding to a certain shopping platform, and user information of each user, historical consumption information of each user, preference information and activity information of each user, and the like may be stored in the Database. The user information may represent basic information of a user, the historical consumption information may include a purchase consumption record of the user on a certain shopping platform, the preference information of the user may include a historical search record, a browsing record, a collection record, a sharing record and the like of the user, and the activity information of the user may include the number of times that the user logs in a shopping APP (application program) within a set time or the number of times of behaviors such as consumption, browsing, search clicking and the like in a certain shopping platform within a set time.
One sample in the sample set may include a user characteristic of a user, a store characteristic corresponding to a store in the store corresponding to the user, a cross-feature between the user and the corresponding store, and an identifier of whether the user clicks on the store, the sample set X may include a plurality of samples, which may be represented as X ═ sample 1, sample 2 … … sample n }, each sample may be represented in a format of (user _ id, item _ id, features, y), where the user _ id may represent a user identifier, the item _ id may represent a store identifier, the features may represent a cross-feature between the user and the store, and y may represent whether the user clicks on the recommended store, for example: y-1 indicates that the user clicked on the recommended shop, and y-0 indicates that the user did not click on the recommended shop.
For example: the system recommends 3 stores A, B, C for a certain user I (3 here are only used to facilitate explanation of the present technical solution, in an actual application process, the number of stores recommended by the system for the user may be set by itself according to an actual situation), and if the user only clicks the store a, the sample set X may be represented as X ═ sample 1, sample 2, sample 3, where sample 1 may be represented as: sample 1 ═ user I, store a, the cross feature between user I and store a, 1 (clicked) ], sample 2 can be expressed as: sample 2 ═ 0 (not clicked) for the cross feature between user I, store B, user I and store B ], sample 3 can be expressed as: sample 3 ═ user I, store C, cross feature between user I and store C, 0.
And acquiring the user and the shop corresponding to the identification from the database according to the user identification and the shop identification in the first characteristic log. The extracting a sample set from a database based on a set dimension according to the first data feature log may specifically include:
extracting user characteristics corresponding to the user identification from the database according to the user identification, wherein the user characteristics comprise one or more of user basic characteristics, user wealth characteristics, user historical behavior characteristics and user interest characteristics;
extracting shop characteristics corresponding to the shop identification from the database according to the shop identification, wherein the shop characteristics comprise shop attribute characteristics and shop history statistical characteristics, and the shop history statistical characteristics comprise one or more of exposure, click rate, purchase amount and click rate of the shop;
extracting cross features of the user and the shop from the database according to the user identification and the shop identification, wherein the cross features comprise one or more of exposure number, click number and click rate of the user to the shop or brand;
obtaining a sample set comprising the user characteristics, the store characteristics, the cross characteristics, and the historical behavior characteristics of the user.
In practical application, the quality of the selected features can determine the prediction effect of the final prediction model, so that the distinguishing degree of the features on positive and negative categories and the covering condition of the features are considered in the process of constructing the features. In the scheme, related features are mainly extracted from aspects of users, item (namely shops), intersection and the like, and the number of the features can be more than 200 in total, including off-line features and on-line features (such as positioning distance features of on-line users). When corresponding features are extracted from the database, the features can be extracted from the database according to specific identifiers, specifically, the features of users with user identifiers can be selected from the database according to the user identifiers, the features with store identifiers can be selected from the database according to the store identifiers, and the like.
More specifically, the user characteristics may include a user basic characteristic, a user wealth class characteristic, a user historical behavior characteristic and an interest characteristic of the user; the user basic features may include age, gender, constellation, occupation, education level, life stage, place of birth, workplace, home location, ordinary location, etc., wherein the life stage may represent a use stage when the user registers an application platform, a preference stage, a shopping level stage, etc. The wealth-like characteristics may include income, purchasing power, probability of having a room, probability of having a car, and the like. The income can be comprehensively evaluated according to the professional information filled by the user, the professional age and the purchasing price energy of the user. The purchasing power can be obtained through comprehensive calculation according to the historical purchasing records of the users, and the probability of having a car and a room can be evaluated according to the probability of household articles or car articles and car refitted accessories contained in the historical purchasing records of the users. The historical behavior characteristics of the user may include: the system comprises a user searching (query) feature, a commodity purchasing feature, an activity feature, a historical transaction feature and the like, wherein the activity feature can be evaluated according to the times of logging in a shopping APP by a user within a set time or the times of consuming, browsing, searching and clicking and other behaviors in a certain shopping platform within the set time. The interest characteristics of the user can be predicted according to shops or commodities which are selected from a large number of user history records and have high purchase frequency, high search frequency or high collection frequency. For example: the user purchases a snack gift bag 20 times in one year, purchases a clothing store a 20 times or more, and the like, and it is possible to predict that the user likes to purchase a snack gift bag on the internet and that the user likes to purchase clothing in the store a.
When the interest characteristics of the user are evaluated, the corresponding behavior data of the user can be acquired within a set time. The behavior data may represent user attention behavior, click behavior, browsing behavior, sharing behavior, purchasing behavior, and/or recommending behavior with respect to the store or brand, among other things. Such as: the behavior data of the user 1 in one month is acquired, and the data can indicate that the user 1 browses 200 stores in one month, 10 stores for generating purchase records and 15 stores for collecting. The behavior data can be stored in a database corresponding to the shopping platform, and the behavior data extracted offline can be synchronized into the HBase (open source database), wherein the HBase can represent a distributed and column-oriented open source database.
The setting time can be set as required, for example: when the preference of the user is judged, the short-term behavior data of the user can be extracted to judge the short-term requirement of the user, and the long-term behavior data of the user can also be obtained to judge the habit and hobbies of the user. In practice, when recommending stores for users, the user's preferences are generally learned and analyzed according to recent behavior data records (e.g., 1-3 months) of the users.
The store characteristics can comprise store attribute characteristics and store history statistical characteristics, and the store attribute characteristics can comprise the attribute positioning characteristics of the store (for example, the store is a wholesale store facing to the middle and old aged clothes and has the price of less than 200 RMB), the number of tickets in the store, the score, the number of comments, whether the payment is supported or not and the like. The historical statistics of the stores include exposure, click rate, purchase amount, and click rate of the stores. The exposure amount may represent the number of stores displayed on the user terminal interface, the click rate may represent the number of stores clicked by the user, the purchase amount may represent the number of stores having a purchase transaction with the user, and the click rate may represent the ratio of the number of stores clicked to the total number of exposed stores.
The cross-features may include the number of exposures the user has to stores (or brands), the number of clicks, and the click-through rate.
The feature data extracted off line can be synchronized into HBase, so that the model on-line prediction module can take off-line features from HBase when needed, update and train the prediction model, and print out corresponding feature logs for backflow.
Step 203: and training a deep learning model by using the sample set to obtain a prediction model.
Deep Learning (Deep Learning) forms a more abstract class or feature of high-level representation properties by combining low-level features to find a distributed feature representation of the data. Compared with the traditional machine learning, the deep learning can automatically find out important characteristics required by the classification problem or the prediction problem; whereas conventional machine learning requires features to be given manually.
And taking the sample set as the input of the deep learning model, and training the deep learning model to obtain a prediction model. The predictive models may be used to score the predictions for the stores.
Step 204: and predicting the candidate shop corresponding to the online user by adopting the prediction model to obtain the shop to be recommended meeting the conditions.
The preset conditions may include a prediction threshold of the prediction score and a preset number of stores.
The number of stores recommended to the user at each time can be set randomly, and the number of stores recommended to the user at each time can be set according to the display form of the user terminal and the maximum area which can be displayed by the application program interface. For example: the shop scores obtained by scoring the shop to be recommended by using the trained prediction model are { shop A0.8, shop B0.7, shop C0.7, shop D0.6, shop E0.4, shop F0.2, shop G0.8, shop H0.9, shop I0.3, shop J0.5}, and the number of the display areas of the user terminal is set to 6 at a time, so that six shops (shop A0.8, shop B0.7, shop C0.7, shop D0.6, shop G0.8, shop H0.9) with large scores are recommended to the user. Of course, the number of stores exceeding the maximum display area of the display screen of the user terminal may be displayed at one time, and the recommended store may be exposed by sliding the screen when viewed by the user.
Step 205: and recommending the shop to be recommended to the online user.
Recommending the determined stores to be recommended to the online users, wherein the specific recommending mode can be that the stores to be recommended are displayed in the current interface of the user terminal.
In the method in fig. 2, by performing feature selection based on multiple dimensions, features can be selected from a database in a targeted manner, the data volume of sample data is increased, and the user behavior feature set is input into a deep learning model for training to obtain a prediction model; the prediction model is used for scoring the stores to be predicted to obtain the prediction scores corresponding to all stores; and determining the shop recommended to the user according to the prediction score. Because the store recommendation is carried out by using the deep learning model obtained by the user behavior characteristic training, the automatic characteristic cross combination capability of the model is effectively utilized, the potential characteristics and the cross characteristics of the commodities or the stores can be mined, the recommendation diversity is increased, and the recommendation effect is improved.
Based on the method of fig. 2, the present specification also provides some specific embodiments of the method, which are described below.
On a big data platform, with the rapid development of internet transaction, online transaction becomes mainstream, the data volume of behavior data of each user on a corresponding shopping platform is huge, the number of shops browsed by each user, clicked shops or shops generating purchase records can be different, the number of really clicked shops or traded shops is obviously reduced compared with the number of exposed shops, and the number of shops generating purchase records is also obviously changed compared with the clicked shops (for example, a user browses 200 shops in a day, but the clicked shops are only 100, and the last shop of the user for purchase transaction is only 3), therefore, when recommending the shops for the user, if all the shops which have interaction relationship with the user are taken as the shops to be scored and predicted, the predicted data volume is huge, the server pressure is increased, therefore, before the trained model is adopted for prediction scoring, the candidate stores of the user need to be screened. For a specific method for selecting a candidate store, the following method may be referred to.
The predicting the candidate stores corresponding to the online users by using the prediction model to obtain the stores to be recommended meeting the conditions may specifically include:
acquiring personal information of an online user;
determining candidate stores for the online user;
inputting the personal information and the shop information of the candidate shops into the prediction model to obtain the prediction score of each candidate shop;
and determining a shop to be recommended from the candidate shops according to the prediction scores, wherein the prediction scores of the shops to be recommended meet a preset threshold value.
When the same shop corresponds to different users, the scoring results or the matching degree can be different. (for example, user 1 likes outdoor sports, and outdoor sports clothes are more in the types of clothes purchased, and store A is a more popular store in the sports clothes brand store. at this time, the matching degree of store A is higher relative to user 1, user 2 does not like sports, and many casual clothes are purchased, and at this time, the matching degree of store A and user 1 is lower), so it is necessary to first obtain personal information corresponding to the user, and input the personal information and store information of the candidate stores into the prediction model, and obtain the prediction score of each candidate store.
The determining of the candidate stores for the online users may specifically include:
obtaining a shop recommendation request;
and screening candidate shops corresponding to the shop recommendation request from a database according to the shop recommendation request.
The screening of the candidate stores meeting the store recommendation request from the database according to the store recommendation request may specifically include:
acquiring user characteristics of a user corresponding to the shop recommendation request and a currently positioned distance characteristic;
and acquiring candidate shops meeting preset conditions of the user characteristics and the distance characteristics from the database according to the user characteristics and the currently positioned distance characteristics.
When the candidate stores are selected, the candidate stores can be selected according to the user characteristics of the online users and the current positioning distance characteristics of the online users, and because the calculation amount of online real-time prediction scoring for the whole stores is huge, a large number of stores are not within a current ten-kilometer radius from the users, and some stores are not high in quality (for example, a store with one transaction in one year), the selection of one user and the nearby stores needs to be performed first. The purpose of the screening is to roughly screen out about a hundred stores for each user that are close in distance and likely to be of interest and of relatively high quality.
Through the mode, the candidate shop corresponding to each user is screened out preliminarily, the operation pressure of the server can be reduced, and the prediction efficiency is improved. When prediction is performed, the user characteristics corresponding to the user and the shop characteristics are input into the prediction model together for prediction, so that the prediction precision can be improved, and the click rate of the recommended shop can be increased.
In actual applications, as the amount of data increases, there is a possibility that the user characteristics, the shop characteristics, and the like change, and therefore, it is necessary to update the prediction model to ensure the prediction accuracy of the prediction model. When updating the prediction model, the following method can be adopted:
after recommending the store to be recommended to the user, the method may further include:
acquiring a second data characteristic log corresponding to the user recommended by the shop to be recommended;
and correcting the prediction model according to the second data characteristic log to obtain an updated prediction model.
The modifying the prediction model according to the second data feature log to obtain an updated prediction model may specifically include:
acquiring a current sequence position corresponding to a shop clicked by a user from the second data characteristic log;
determining a training sample according to the current sequence position;
and training the prediction model through the training samples to obtain an updated prediction model.
The determining a training sample according to the current sequence position may specifically include:
determining behavior data corresponding to shops before the current sequence position and shops which are positioned behind the current sequence position and meet preset conditions as training samples; the shop meeting the preset condition represents a set number of shops sequentially selected backwards according to the current sequence position.
In the specific model training process, a supervised learning method can be adopted. The largest difference between supervised and unsupervised learning is whether the input data has a label (label). If the input data has a label, the supervised learning is performed, and if the input data does not have the label, the unsupervised learning is performed.
Because the current spot burying technology does not support exposure spot burying to a shop level of horizontal screen sliding, in the following embodiments, the shop sample before the user clicks is added as an approximate exposure sample, and the approximate exposure processing of gradually increasing the right according to the position is performed on the shop sample after the user clicks, the total sample amount can be obtained by about 100 ten thousand, wherein the ratio of positive and negative samples is about 1: 30. After the to-be-recommended stores are obtained through prediction by the prediction model, the system recommends the to-be-recommended stores to the user, and the operation behavior data of the to-be-recommended stores are stored in the second data characteristic log. Therefore, the prediction model can be modified by acquiring and analyzing the second data feature log, and more specifically, the training sample can be generated according to the click condition on the subscriber line. Specifically, a current sequence position corresponding to a shop clicked by a user is obtained from the second data feature log, and behavior data corresponding to shops before the current sequence position and shops behind the current sequence position and meeting a preset condition are determined as training samples; the shop meeting the preset condition represents a set number of shops sequentially selected backwards according to the current sequence position.
The predicting the candidate shop corresponding to the online user by using the prediction model to obtain the shop to be recommended meeting the condition may further include:
and reflowing the corresponding data characteristic log in the prediction process to the database.
After the updating of the prediction model, the verifying may further use a verification sample for verification, and after the obtaining of the updated prediction model, the method may further include:
obtaining a verification sample; the verification sample is behavior data which is positioned behind the current sequence position and is except for a training sample;
and verifying the updated prediction model through the verification sample.
For example: 5 ten thousand samples can be randomly selected from the samples of the last 1 day as verification samples, and the rest samples are used as training samples.
By the method, the data characteristic logs can be printed and flow back to a data warehouse (ODPS), and the prediction model is updated based on the data characteristic logs, so that the prediction accuracy of the prediction model can be ensured.
Traditional machine learning algorithms, such as: the Logistic Regression (LR) or the iterative Decision Tree (GBDT) is widely used in recommendation and advertisement scenes, but it has a disadvantage that a large number of features need to be extracted manually according to experience, and the training model efficiency is low. A DNN (Deep Neural Network) based model is established, the automatic feature cross combination capability of the model and behavior data of shop clicking are fully utilized, shop samples before the user clicking positions are added to serve as exposure samples, approximate exposure processing of gradually increasing and reducing the weight according to the positions is carried out on the shop samples after the user clicks, the problem of data sparsity is solved, and the recommendation effect is improved.
The training of the deep learning model by using the sample set to obtain a prediction model specifically may include:
grouping the sample set based on a user dimension, a store dimension, a cross dimension, and a real-time distance dimension;
determining an embedding vector corresponding to each group of samples to obtain an embedding vector set;
and inputting the embedded vector set into a deep learning model for training to obtain a prediction model.
By grouping samples, adopting a DNN (deep learning) model, high-order combination characteristics can be extracted, the samples are grouped, an embedding vector is generated for each grouped sample and used as model input, one embedding vector is correspondingly generated for a group of samples, the data dimension reduction effect can be achieved, and therefore the model training efficiency is improved.
The trained model needs to be deployed to an online server for online real-time scoring. When a user requests a recommendation system, the system first recalls a preset number (e.g., nearly one hundred) of stores to the user based on the rules. And the characteristics of the user and the shop (including off-line characteristics and on-line characteristics) are scored to the model on-line prediction module in real time. And finally, sequencing the prediction scores in a descending order, and recommending and displaying the stores meeting the preset score threshold value to the user.
In the aspect of experimental effect, an AB experimental platform 'Darwin' is utilized to carry out online comparison experiment on matching algorithm, characteristics and models. The results of some experiments are given here, the main comparative indices: individual Visitor (UV for short) click rate (number of clicks/number of exposures).
The scheme is that the stores are predicted based on the rule scores of the stores, the distance equal scores and the sum of certain weights, and the UV click rate of the recommended stores is obtained mainly based on rules set by artificial experience.
In the second scheme, the shop is predicted by using the prediction model obtained in the first scheme and a Deep FM algorithm, so that the UV click rate of the recommended shop is obtained.
Deep FM (neural network factorization machine algorithm) consists of two parts: the system comprises a neural network part and a factorization machine part, wherein an FM algorithm (factorization machine) is responsible for extracting features of a first-order feature and a second-order feature formed by pairwise combination of the first-order features; the DNN (deep neural network) algorithm is responsible for extracting features of high-order features formed by fully connecting input first-order features and the like, and two schemes are compared firstly through experiments, wherein model structures and input features in the two schemes are completely the same. The experimental results data are shown in the following table:
through comparison in the table, the UV click rate is improved by 1.14% relatively in the scheme two relative to the scheme one, online real-time recommendation is performed by adopting a model based on deep learning, the automatic feature cross combination capability of the model is effectively utilized, the waste of human resources for manually selecting features is reduced, the model training efficiency is improved, the click behavior data is used, the recommendation diversity is increased, and the recommendation effect is improved.
Based on the same idea, the embodiment of the present specification further provides a device corresponding to the above method. Fig. 3 is a schematic structural diagram of a store recommendation device corresponding to fig. 2 provided in an embodiment of the present specification. As shown in fig. 3, the apparatus may include:
a first data feature log obtaining module 301, configured to obtain a first data feature log, where the data feature log includes a user identifier, a store identifier, and a historical behavior feature of a user, the store identifier indicates a store recommended to the user, and the historical behavior feature indicates an actual operation behavior of the store by the user;
a sample extraction module 302, configured to extract a sample set from a database based on a set dimension according to the first data feature log, where each sample in the sample set includes a user feature corresponding to the user identifier, a store feature corresponding to the store identifier, a cross feature of the user and the store, and the historical behavior feature, where the cross feature represents an interaction behavior between the user and the store;
the prediction model determining module 303 is configured to train a deep learning model by using the sample set to obtain a prediction model; the to-be-recommended shop determining module 304 is configured to predict candidate shops corresponding to the online user by using the prediction model, so as to obtain a to-be-recommended shop meeting a condition;
a store recommending module 305, configured to recommend the store to be recommended to the online user.
Optionally, the sample extraction module 302 may specifically include;
the user characteristic extraction unit is used for extracting user characteristics corresponding to the user identification from the database according to the user identification, wherein the user characteristics comprise one or more of user basic characteristics, user wealth characteristics, user historical behavior characteristics and user interest characteristics;
a shop feature extraction unit, configured to extract, from the database, a shop feature corresponding to the shop identifier according to the shop identifier, where the shop feature includes a shop attribute feature and a shop history statistical feature, and the shop history statistical feature includes one or more of an exposure amount, a click rate, a purchase amount, and a click rate of the shop;
a cross feature extraction unit, configured to extract, from the database, a cross feature of the user and the store according to the user identifier and the store identifier, where the cross feature includes one or more of the number of exposures of the user to the store or the brand, the number of clicks, and a click rate;
a sample set determination unit, configured to obtain a sample set including the user characteristic, the store characteristic, the cross characteristic, and the historical behavior characteristic of the user.
Optionally, the to-be-recommended store determining module 304 may specifically include:
a personal information acquisition unit for acquiring personal information of an online user;
a candidate shop determination unit for determining a candidate shop for the online user;
a store prediction unit configured to input the personal information and store information of the candidate stores into the prediction model to obtain a prediction score of each of the candidate stores;
and the to-be-recommended shop determining unit is used for determining the to-be-recommended shop from the candidate shops according to the prediction score, and the prediction score of the to-be-recommended shop meets a preset threshold value.
Optionally, the apparatus may further include:
the second data characteristic log acquisition module is used for acquiring a second data characteristic log corresponding to the store to be recommended to the user;
and the prediction model correction module is used for correcting the prediction model according to the second data characteristic log to obtain an updated prediction model.
Optionally, the prediction model modification module may be specifically configured to:
a current sequence position clicking acquisition unit, configured to acquire a current sequence position corresponding to a store clicked by a user from the second data feature log;
a training sample determining unit, configured to determine a training sample according to the current sequence position;
and the prediction model updating unit is used for training the prediction model through the training samples to obtain an updated prediction model.
Optionally, the training sample determining unit may be specifically configured to:
determining behavior data corresponding to shops before the current sequence position and shops which are positioned behind the current sequence position and meet preset conditions as training samples; the shop meeting the preset condition represents a set number of shops sequentially selected backwards according to the current sequence position.
Optionally, the prediction model modification module may further include:
a verification sample acquisition unit for acquiring a verification sample; the verification sample is behavior data which is positioned behind the current sequence position and is except for a training sample;
and the verification unit is used for verifying the updated prediction model through the verification sample.
Optionally, the candidate shop determining unit may be specifically configured to:
obtaining a shop recommendation request;
and screening candidate shops corresponding to the shop recommendation request from a database according to the shop recommendation request.
Optionally, the candidate shop determining unit may be specifically configured to:
acquiring user characteristics of a user corresponding to the shop recommendation request and a currently positioned distance characteristic;
and acquiring candidate shops meeting preset conditions of the user characteristics and the distance characteristics from the database according to the user characteristics and the currently positioned distance characteristics.
Optionally, the prediction model determining module 303 may specifically include:
a grouping unit for grouping the sample set based on a user dimension, a store dimension, a cross dimension, and a real-time distance dimension;
the embedded vector determining unit is used for determining an embedded vector corresponding to each group of samples to obtain an embedded vector set;
and the prediction model determining unit is used for inputting the embedded vector set into a deep learning model for training to obtain a prediction model.
Optionally, the apparatus may further include:
and the data characteristic log refluxing module is used for refluxing the corresponding data characteristic log in the prediction process to the database.
Based on the same idea, the embodiment of the present specification further provides a device corresponding to the above method.
Fig. 4 is a schematic structural diagram of a store recommendation device corresponding to fig. 2 provided in an embodiment of the present specification. As shown in fig. 4, the apparatus 400 may include:
at least one processor 410; and the number of the first and second groups,
a memory 430 communicatively coupled to the at least one processor; wherein,
the memory 430 stores instructions 420 executable by the at least one processor 410 to enable the at least one processor 410 to:
acquiring a first data characteristic log, wherein the data characteristic log comprises a user identifier, a shop identifier and historical behavior characteristics of a user, the shop identifier represents a shop recommended to the user, and the historical behavior characteristics represent actual operation behaviors of the user to the shop;
extracting a sample set from a database based on a set dimension according to the first data feature log, wherein each sample in the sample set comprises a user feature corresponding to the user identifier, a shop feature corresponding to the shop identifier, a cross feature of the user and the shop and the historical behavior feature, and the cross feature represents an interaction behavior between the user and the shop;
training a deep learning model by using the sample set to obtain a prediction model; predicting candidate shops corresponding to the online users by adopting the prediction model to obtain shops to be recommended, which meet the conditions;
and recommending the shop to be recommended to the online user.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Language Description Language), traffic, pl (core unified Programming Language), HDCal, JHDL (Java Hardware Description Language), langue, Lola, HDL, laspam, hardsradware (Hardware Description Language), vhjhd (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.