A training method and device for a recommendation model, a recommendation method and device
By training the recommendation model and dividing the set of entities to be recommended into small-scale candidate groups, and using deep learning to process each candidate group, the problems of slow calculation and low prediction accuracy in large-scale data recommendation are solved, and the computing power and accuracy are improved. .
Patent Information
- Application Number
- CN202010307848.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-17
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2040-04-17
AI Technical Summary
Existing large-scale data recommendation solutions have slow calculation processes and low prediction accuracy when processing large-scale entity collections to be recommended, and cannot directly calculate large-scale entity collections.
Train the recommendation model by obtaining training samples and labels, divide the set of entities to be recommended into small-scale recommendation candidate groups, use deep learning methods to process each candidate group, and build an input model for the subset to be tested to obtain recommendation scores. Generate recommendation list.
It improves the computing power and prediction accuracy of large-scale entity collections to be recommended, and achieves efficient processing of large-scale entity collections.
Smart Images

Figure CN113538079B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a training method and device for a recommendation model, a recommendation method and device, a computing device, and a computer-readable storage medium. Background Art
[0002] Existing large-scale data recommendation solutions need to filter out a smaller set of entities to be recommended from a large set of entities to be recommended for sorting or recommendation through non-deep learning. Large-scale entity sets to be recommended cannot be calculated directly, such as a set of recommended items containing more than 1 million items to be recommended. If large-scale entity sets to be recommended are trained and calculated directly, the calculation process will be slow and the model prediction accuracy will be low. How to use a unified method to directly calculate a large set of entities to be recommended has become an urgent problem to be solved. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a training method and apparatus for a recommendation model, a recommendation method and apparatus, a computing device, and a computer-readable storage medium to solve the technical defects existing in the prior art.
[0004] According to a first aspect of an embodiment of this specification, a training method for a recommendation model is provided, comprising:
[0005] Acquire a training sample and a corresponding training label, wherein the training sample includes user information of a sample user and a sample recommendation set including a first target number of sample recommendation entities, and the training label includes the sample recommendation entity finally selected by the sample user from the sample recommendation set;
[0006] The recommendation model is trained using the training samples and corresponding training labels, and the parameters of the recommendation model are adjusted according to the loss value of the recommendation model until a training termination condition is met.
[0007] According to a second aspect of the embodiments of this specification, a recommendation method is provided, including:
[0008] Acquire a set of entities to be recommended, and divide the set of entities to be recommended into a second target number of recommendation candidate groups, so that each of the recommendation candidate groups includes the first target number of entities to be recommended;
[0009] Acquire user information of the user to be recommended, match the user information of the user to be recommended with each of the recommendation candidate groups respectively, and construct a second target number of subsets to be tested;
[0010] The second target number of to-be-tested subsets are respectively input into the recommendation model as described above, the recommendation score corresponding to each to-be-recommended entity in the to-be-recommended entity set is obtained, and a recommendation list is determined.
[0011] According to a third aspect of an embodiment of this specification, a training device for a recommendation model is provided, including:
[0012] A training information acquisition module is configured to acquire training samples and corresponding training labels, wherein the training samples include user information of a sample user and a sample recommendation set including a first target number of sample recommendation entities, and the training labels include the sample recommendation entities finally selected by the sample user from the sample recommendation set;
[0013] The model training module is configured to train the recommendation model through the training samples and corresponding training labels, and adjust the parameters of the recommendation model according to the loss value of the recommendation model until the training termination condition is met.
[0014] According to a fourth aspect of an embodiment of this specification, a training device for a recommendation model is provided, including:
[0015] A candidate group construction module is configured to obtain a set of entities to be recommended, and divide the set of entities to be recommended into a second target number of recommendation candidate groups, so that each of the recommendation candidate groups includes the first target number of entities to be recommended;
[0016] A test set construction module is configured to obtain user information of a user to be recommended, match the user information of the user to be recommended with each of the recommendation candidate groups, and construct a second target number of subsets to be tested;
[0017] The entity recommendation module is configured to input the second target number of tested subsets into the recommendation model as described above, obtain the recommendation score corresponding to each entity to be recommended in the set of entities to be recommended, and determine the recommendation list.
[0018] According to a fifth aspect of an embodiment of this specification, a computing device is provided, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the training method of the recommendation model when executing the instructions.
[0019] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer instructions, and when the instructions are executed by a processor, the steps of the training method of the recommendation model are implemented.
[0020] The recommendation model of the present application utilizes the user information of sample users and a sample recommendation set containing a small number of sample recommendation entities for training during the training process, so that the recommendation model has the ability to score and sort a small number of sample recommendation entities, and is applied when predicting and calculating large-scale sets of entities to be recommended, thereby realizing the use of deep learning methods to process large-scale sets of entities to be recommended, and improving the computing power and prediction accuracy for large-scale sets of entities to be recommended. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a structural block diagram of a computing device provided in an embodiment of the present application;
[0022] Figure 2 is a flow chart of a training method for a recommendation model provided in an embodiment of the present application;
[0023] Figure 3 is another flow chart of the training method of the recommendation model provided in the embodiment of the present application;
[0024] Figure 4a is another flow chart of the training method of the recommendation model provided in the embodiment of the present application;
[0025] Figure 4b It is a structural diagram of a convolutional neural network provided in an embodiment of the present application;
[0026] Figure 5 is a flowchart of a recommended method provided in an embodiment of the present application;
[0027] Figure 6 is another flow chart of the recommended method provided in the embodiment of the present application;
[0028] Figure 7 It is a schematic diagram of a recommended method provided in an embodiment of the present application;
[0029] Figure 8 It is a structural schematic diagram of a training device for a recommendation model provided in an embodiment of the present application;
[0030] Fig. 9 It is a schematic diagram of the structure of the recommended device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0031] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0032] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0033] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0034] First, the terms involved in one or more embodiments of the present invention are explained.
[0035] Entity: An entity refers to something that is identifiable and exists independently, such as a person's name, a city's name, a plant's name, a product's information name, etc.
[0036] Deep learning model: Deep learning is a general term for a class of pattern analysis methods. In terms of specific research content, it mainly involves three types of methods: (1) Neural network systems based on convolution operations, namely convolutional neural networks (CNNs). (2) Autoencoder neural networks based on multi-layer neurons, including autoencoders and sparse coding, which has received widespread attention in recent years. (3) Deep belief networks (DBNs) that perform pre-training in the form of multi-layer autoencoder neural networks and then combine identification information to further optimize the weights of the neural network. Through multi-layer processing, the initial "low-level" feature representation is gradually converted into a "high-level" feature representation, and complex learning tasks such as classification can be completed using a "simple model". Therefore, deep learning can be understood as "feature learning" or "representation learning". Typical deep learning models include convolutional neural networks, DBN and stacked auto-encoder network models. Among them, convolutional neural networks are a type of feedforward neural networks that include convolution calculations and have a deep structure. It is one of the representative algorithms of deep learning. Convolutional neural networks have representation learning capabilities and can perform translation-invariant classification of input information according to their hierarchical structure.
[0037] Softmax activation function: The softmax logistic regression model is a generalized form of the Sigmoid function for multi-classification problems. Similar to the Sigmoid function, it also produces values in the range of (0, 1), so it is used as the last layer of the classification model to map the outputs of multiple neurons to the interval (0, 1), which can be regarded as the probability that the current output belongs to each category, thereby performing multi-classification.
[0038] Sample recommendation entities: entities such as goods, people, and specific objective things that serve as samples when training recommendation models.
[0039] Sample recommendation set: a sample recommendation set consisting of a specific number of sample recommendation entities, for example, a set of recommended products consisting of 10 products.
[0040] Recommendation score: The probability obtained by the recommendation model after feature extraction for each entity, which corresponds to the score of each entity as a recommended entity in this application.
[0041] User characteristic information: user's personal information, such as gender, age, place of origin or occupation.
[0042] User context information: information such as the time or location when the user browses the entity.
[0043] User browsing history information: historical browsing records generated by entity records browsed by the user within a valid time period.
[0044] Entity set to be recommended: a set of entities to be recommended consisting of a large number of entities to be recommended, for example, a set of commodities to be recommended consisting of tens of thousands of commodities.
[0045] Recommendation candidate group: a set of entities to be recommended that includes a first target number, for example, a set of product information including 10 products to be recommended.
[0046] Entities to be recommended: Recommended entities such as commodities, people or specific objective things that require recommendation models to make recommendations when applied in specific scenarios.
[0047] Test subset: a test set consisting of each recommendation candidate group and the user information to be recommended.
[0048] Recommendation list: a recommendation list obtained by sorting all recommended entities in the recommended entity set. For example, a ranked list of products that are most likely to be selected by the recommended user is obtained by sorting the product information of 10 products according to the recommendation scores.
[0049] First target number: the number of entities such as goods, people or other objects that need to be recommended by the recommendation model, and the first target number is a small-scale controllable number, such as 10, 20 or 30.
[0050] Second target number: the number of recommendation candidate groups obtained by grouping a large set of entities to be recommended according to the first target number, and the second target number is calculated from the number of entities to be recommended and the first target number.
[0051] In the present application, a training method, apparatus, computing device and computer-readable storage medium for a recommendation model are provided, which are described in detail one by one in the following embodiments.
[0052] Figure 1 The structure block diagram of a computing device 100 according to an embodiment of the present specification is shown. The components of the computing device 100 include but are not limited to a memory 110 and a processor 120. The processor 120 is connected to the memory 110 via a bus 130, and the database 150 is used to store data.
[0053] The computing device 100 also includes an access device 140 that enables the computing device 100 to communicate via one or more networks 160. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 140 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0054] In one embodiment of the present specification, the above components of the computing device 100 and Figure 1 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 1 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0055] The computing device 100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 100 may also be a mobile or stationary server.
[0056] The processor 120 may execute Figure 2 Steps in the method shown. Figure 2 is a schematic flowchart showing a training method for a recommendation model according to an embodiment of the present application, including steps 202 to 204.
[0057] Step 202: Obtain training samples and corresponding training labels, wherein the training samples include user information of sample users and a sample recommendation set including a first target number of sample recommendation entities, and the training labels include the sample recommendation entities finally selected by the sample users from the sample recommendation set.
[0058] In the embodiments of the present application, Figure 3 As shown, obtaining training samples and corresponding training labels includes steps 302 to 304.
[0059] Step 302: Obtain user feature information, user environment information, and user browsing history information corresponding to the sample user, and obtain a first target number of sample recommendation entities based on the user browsing history information corresponding to the sample user to obtain the sample recommendation set.
[0060] In an embodiment of the present application, the user feature information corresponding to the sample user refers to the attribute information of the sample user itself used for recommendation model training, such as the sample user's gender, age, place of origin or occupation, etc. The user environment information corresponding to the sample user refers to the information used to describe the scene environment in which the sample user is located, such as time or place, etc. The user history browsing information corresponding to the sample user refers to the entities to be recommended that the sample user has paid attention to or is paying attention to, and the first target number of sample recommendation entities that the sample user may choose is obtained based on the user history browsing information of the sample user, thereby constructing a sample recommendation set containing the first target number of sample recommendation entities, wherein the first target number should be a small-scale controllable number, for example, 10 related products are obtained as sample recommendation entities based on the sample user's history browsing information, and a sample recommendation set containing 10 products is constructed.
[0061] This application combines the user characteristics and current environment of sample users to truly reflect the specific situation in actual applications, so that the recommendation model of this application has strong practicality and ideal effect after application.
[0062] Step 304: According to the user feature information, user environment information and user historical browsing information corresponding to the sample user, the sample recommendation entity finally selected by the sample user from the sample recommendation set is obtained as a training label.
[0063] In an embodiment of the present application, by labeling the user information of the sample user, the sample recommendation entity finally selected by the sample user from the sample recommendation set with the current user information as the label is obtained. For example, the user information of the sample user A includes gender: male, age: 20 years old, and occupation: worker. The current environment includes 7:35 pm on December 27, 2019, and the product "basketball" is finally selected from the sample recommendation set containing 10 product information.
[0064] The present application forms a sample recommendation set by constructing a small-scale sample recommendation entity, and uses the user information of the sample user to form a training sample. The user information of the sample user is labeled at the same time to obtain the sample recommendation entity that the sample user finally selects from the sample recommendation set as the training label, thereby training a highly accurate recommendation model for classification and recommendation of a small-scale sample recommendation set.
[0065] Step 204: Train the recommendation model using the training samples and corresponding training labels, and adjust the parameters of the recommendation model according to the loss value of the recommendation model until a training termination condition is met.
[0066] In the embodiments of the present application, Figure 4a As shown, the recommendation model is trained using the training samples and corresponding training labels, including steps 402 to 406.
[0067] Step 402: Train any initialized deep learning model using the training samples. The initialized deep learning model scores each sample recommendation entity in the sample recommendation set to obtain a corresponding recommendation score.
[0068] In the embodiments of the present application, Figure 4b As shown, any initialized deep learning model is trained by the training samples, for example, an initialized convolutional neural network model is trained by the training samples, the initialized convolutional neural network model includes an input layer, an intermediate layer and a fully connected layer, the intermediate layer includes a first convolutional layer, a first pooling layer, a second convolutional layer and a second pooling layer connected by connection, specifically, during training, firstly, the user information of the sample user and the sample recommendation entity in the sample recommendation set are encoded, and a total of 14 feature representations are obtained, and each of the feature representations is regarded as a feature picture of size 32x32 and input into the first convolutional layer;
[0069] The first convolution layer uses a convolution kernel of size 28x28 to perform a convolution operation with a step size of 1 to obtain 14x5x5 first feature maps of size 28x28, and inputs the convolution result to the first pooling layer;
[0070] The first pooling layer performs a pooling operation on the first feature map, compresses 14x5x5 first feature maps of size 28x28 using a filter of size 2x2 to obtain 14x5x5 first feature maps of size 14x14, and inputs the 14x5x5 first feature maps of size 14x14 into the second convolutional layer;
[0071] The second convolution layer uses a convolution kernel of size 10x10 to perform a convolution operation with a step size of 1, and obtains 14x5x5x5x5 second feature maps of size 14x14, and inputs the convolution result to the second pooling layer;
[0072] The second pooling layer performs a pooling operation on the second feature map, compresses 14x5x5x5x5 second feature maps of size 14x14 using a filter of size 2x2 to obtain 14x5x5x5x5 second feature maps of size 7x7, and inputs the 14x5x5x5x5 second feature maps of size 7x7 to the fully connected layer;
[0073] The fully connected layer expands the second feature map to obtain a 14x30625-dimensional feature vector, and then uses a matrix of size [14, 30625, 10] to reduce the dimension of the feature vector and output a 10-dimensional feature vector. The vector value of the feature vector in each dimension represents the probability that each sample recommendation entity will be finally selected as the sample user from the sample recommendation set. Finally, the 10-dimensional feature vector is mapped in the interval of (0, 1) through the Softmax function activation mapping, so that the sum of the vector values in each dimension is 1, and the vector value of the feature vector in each dimension represents the recommendation score of each sample recommendation entity.
[0074] This application uses any initial deep learning for training, has wide applicability, and is highly operable for information processing.
[0075] Step 404: sort each sample recommendation entity from high to low according to the corresponding recommendation score.
[0076] In an embodiment of the present application, after obtaining the vector value mapped to (0, 1) for each sample recommendation entity in the sample recommendation set as the recommendation score of the corresponding sample recommendation entity, each sample recommendation entity is sorted from high to low according to the corresponding recommendation score. For example, the vector values of 10 products in the sample recommendation set are sorted as recommendation probabilities, thereby realizing the recommendation model's ability to sort the sample recommendation entities in the sample recommendation set.
[0077] This application trains a recommendation model with deep learning capabilities, so that it can classify small-scale entities to be recommended and calculate the recommendation probability based on user information, thereby providing a basis for subsequent processing of large-scale sets of entities to be recommended.
[0078] Step 406: When the training termination condition is met, the training is stopped to obtain the recommendation model.
[0079] In an embodiment of the present application, the present application iterates and trains the initialized convolutional neural network, multiplies the prediction result after each iteration by the training label to calculate the loss value, and when the loss value is less than a preset threshold, the model training is considered to be completed, and the training is stopped to obtain the recommended model of the present application.
[0080] The recommendation model of the present application has the ability to score and rank recommended entities of a small number of samples, and can be applied to the prediction and calculation of large-scale sets of entities to be recommended. The recommendation model greatly improves the computing power and prediction accuracy of large-scale sets of entities to be recommended.
[0081] The processor 120 may execute Figure 5 Steps in the method shown. Figure 5 It is a schematic flow chart showing a recommendation method according to an embodiment of the present application, including steps 502 to 506.
[0082] Step 502: Acquire a set of entities to be recommended, and divide the set of entities to be recommended into a second target number of recommendation candidate groups, so that each of the recommendation candidate groups includes a first target number of entities to be recommended.
[0083] In an embodiment of the present application, the present application first processes a large-scale set of entities to be recommended that need to be recommended, such as a set of entities to be recommended that includes tens of thousands of entities to be recommended, and divides the set of entities to be recommended into a second target number of subsets to be tested, so that the candidate group includes the first target number of entities to be recommended. For example, when the set of entities to be recommended includes N entities to be recommended, the first target number can be divided by N entities to be recommended to obtain the second target number, wherein N, the second target number and the first target number are positive integers.
[0084] The present application splits and integrates a large-scale set of entities to be recommended into a number of recommendation candidate groups of the same number, thereby directly processing a large-scale set of entities to be recommended while ensuring that the recommendation information remains unchanged, thereby facilitating the calculation of the recommendation model.
[0085] Step 504: Obtain user information of the user to be recommended, match the user information of the user to be recommended with each of the recommendation candidate groups respectively, and construct a second target number of subsets to be tested.
[0086] In an embodiment of the present application, the user information of the user to be recommended includes user feature information, user environment information and user historical browsing information corresponding to the user to be recommended. For example, the user feature information, user environment information and user historical browsing information corresponding to user B who needs to be recommended are copied as the second target quantity and matched with each of the recommendation candidate groups, thereby constructing a subset to be tested of the second target quantity.
[0087] The present application achieves the scale of the information to be predicted by matching the user information of the user to be recommended with each of the recommendation candidate groups respectively through simple information backup, and cleverly forms multiple subsets to be tested suitable for the calculation of the recommendation model with each of the recommendation candidate groups, thereby facilitating the accurate calculation of the recommendation model.
[0088] Step 506: Input the second target number of to-be-tested subsets into the recommendation model of the present application respectively, obtain the recommendation score corresponding to each to-be-recommended entity in the to-be-recommended entity set, and determine the recommendation list.
[0089] In an embodiment of the present application, the present application inputs each subset to be tested into the recommendation model of the present application respectively, takes the user information of the users to be recommended contained in the subset to be tested and the feature information corresponding to each entity to be recommended as input, and scores the first target number of entities to be recommended in each subset to be tested through the recommendation model, thereby obtaining the recommendation scores of all the entities to be recommended in the set of entities to be recommended corresponding to the users to be recommended, and determining the recommendation list.
[0090] The present application divides a large-scale set of entities to be recommended into several recommendation candidate groups according to the number that the recommendation model can process at a single time, and then copies and matches the user information of the users to be recommended, thereby forming several subsets to be tested that require model calculation, and then processes each subset to be tested by linear operations, thereby achieving direct calculation and processing of the large-scale set of entities to be recommended, and achieving direct prediction or recommendation of the selected set using a unified method, thereby improving the processing speed and accuracy of the large-scale set of entities to be recommended.
[0091] Figure 6 The recommendation method of an embodiment of the present specification is shown. The training method of the recommendation model is described by taking commodity recommendation as an example, and includes steps 602 to 612.
[0092] Step 602: Acquire a set of entities to be recommended, and divide the set of entities to be recommended into a second target number of recommendation candidate groups, so that each of the recommendation candidate groups includes a first target number of entities to be recommended.
[0093] In the embodiments of the present application, Figure 7 As shown, when it is necessary to recommend products for a set of entities to be recommended including 1,000 products to be recommended, each recommendation candidate group is set to include 10 products to be recommended, thereby dividing the set of entities to be recommended into 100 recommendation candidate groups, so that each recommendation candidate group includes 10 products to be recommended.
[0094] Step 604: Acquire user information of the user to be recommended, and copy the user information of the user to be recommended to obtain the user information of the second target number of users to be recommended.
[0095] In the embodiments of the present application, Figure 7 As shown, the user information of the user B to be recommended is copied 100 times to obtain the same number of user information of the user B to be recommended as the recommendation candidate group, wherein the user information of the user B to be recommended includes the user characteristic information, user environment information and user history browsing information corresponding to the user B to be recommended, including the gender, age, native place or occupation of the user B to be recommended, and the scene environment information of the user B to be recommended, such as time or place, etc., and the user history browsing information of the user B to be recommended refers to the commodities that the user to be recommended has been or is paying attention to. For example, user B, female, 33 years old, native place of Shandong, professional teacher, browsed xx commodities in Beijing on xx / xx / 20xx.
[0096] Step 606: Combine the user information of each of the to-be-recommended users with each of the recommendation candidate groups to construct a second target number of subsets to be tested.
[0097] In the embodiments of the present application, Figure 7 As shown, the 100 recommendation candidate groups are matched with the user information of the 100 users B to be recommended, thereby constructing 100 subsets to be tested.
[0098] Step 608: Input the second target number of to-be-tested subsets into the recommendation model of the present application respectively, and obtain the recommendation score corresponding to each of the to-be-recommended entities in the second target number of to-be-tested subsets.
[0099] In the embodiments of the present application, Figure 7 As shown, the recommendation model of the present application is used to score the 100 subsets to be tested respectively, that is, the recommendation model outputs the feature vectors between (0, 1) of the 10 recommended products contained in each of the 100 subsets to be tested, and uses the vector values of the feature vectors in 10 dimensions as the recommendation scores, and a total of 1000 recommended products have recommendation scores. The specific calculation process is as described above, and the present application will not repeat it here.
[0100] Step 610: Summarize the recommendation scores corresponding to all entities to be recommended, and sort each entity to be recommended from high to low according to the corresponding recommendation score, to obtain the total ranking corresponding to all entities to be recommended in the set of entities to be recommended.
[0101] In the embodiments of the present application, Figure 7As shown, each to-be-recommended product is sorted from high to low according to its corresponding recommendation score, and the total ranking corresponding to all 1000 to-be-recommended products in the to-be-recommended entity set is obtained.
[0102] Step 612: Obtain the entities to be recommended that are in the first n positions from the total ranking corresponding to all the entities to be recommended, and generate a recommendation list of the entities to be recommended, wherein the n positions are positive integers greater than or equal to 1.
[0103] In the embodiments of the present application, Figure 7 As shown, by aggregating and sorting the recommendation scores of all 1000 recommended products corresponding to the recommended users, a total ranking of the 1000 recommended products can be obtained, and then the top 10 (ties are allowed) recommended products with the highest scores are selected from the total ranking of the 1000 recommended products as the final recommended products, and a recommendation list of recommended products is generated.
[0104] The present application splits and reorganizes a large-scale set of entities to be recommended to construct multiple subsets to be tested containing small-scale information, and uses an accurate small-scale recommendation model to calculate the reorganized multiple subsets to be tested, thereby realizing the direct processing of large-scale sets of entities to be recommended using deep learning methods, improving the recommendation speed of entities to be recommended, and realizing a deep learning-based recommendation method for large-scale sets of entities to be recommended.
[0105] Corresponding to the above method embodiment, this specification also provides a training device embodiment of a recommendation model. Figure 8 FIG. 1 is a schematic diagram showing a structure of a training device for a recommendation model according to an embodiment of the present specification. Figure 8 As shown, the device comprises:
[0106] The training information acquisition module 801 is configured to acquire training samples and corresponding training labels, wherein the training samples include user information of a sample user and a sample recommendation set including a first target number of sample recommendation entities, and the training labels include the sample recommendation entities finally selected by the sample user from the sample recommendation set;
[0107] The model training module 802 is configured to train the recommendation model through the training samples and the corresponding training labels, and adjust the parameters of the recommendation model according to the loss value of the recommendation model until the training termination condition is met.
[0108] Optionally, the training information acquisition module 801 includes:
[0109] A user information acquisition unit is configured to acquire user feature information, user environment information, and user historical browsing information corresponding to the sample user, and acquire a first target number of sample recommendation entities according to the user historical browsing information corresponding to the sample user to obtain the sample recommendation set;
[0110] The label acquisition unit is configured to acquire the sample recommendation entity finally selected by the sample user from the sample recommendation set according to the user feature information, user environment information and user historical browsing information corresponding to the sample user.
[0111] Optionally, the model training module 802 includes:
[0112] A first model training unit is configured to train any initialized deep learning model through the training sample, wherein the initialized deep learning model scores each sample recommendation entity in the sample recommendation set to obtain a corresponding recommendation score;
[0113] The second model training unit is configured to sort each sample recommendation entity from high to low according to the corresponding recommendation score;
[0114] The third model training unit is configured to stop training when a training termination condition is met to obtain the recommendation model.
[0115] The recommendation model of the present application utilizes user information of sample users and a large-scale set of entities to be recommended for training during the training process, so that the recommendation model has the ability to score and rank multiple entities to be recommended, and the trained recommendation model has the ability to score and rank a small number of sample recommendation entities, and is applied when predicting and calculating large-scale sets of entities to be recommended, realizing the use of deep learning methods to process large-scale sets of entities to be recommended, and improving the computing power and prediction accuracy for large-scale sets of entities to be recommended.
[0116] Corresponding to the above method embodiments, this specification also provides a recommended device embodiment. Fig. 9 FIG. 1 is a schematic diagram showing a structure of a training device for a recommendation model according to an embodiment of the present specification. Fig. 9 As shown, the device comprises:
[0117] The candidate group construction module 901 is configured to obtain a set of entities to be recommended, and divide the set of entities to be recommended into a second target number of recommendation candidate groups, so that each of the recommendation candidate groups includes a first target number of entities to be recommended;
[0118] The test set construction module 902 is configured to obtain user information of a user to be recommended, match the user information of the user to be recommended with each of the recommendation candidate groups, and construct a second target number of subsets to be tested;
[0119] The entity recommendation module 903 is configured to obtain user information of a user to be recommended, match the user information of the user to be recommended with each of the recommendation candidate groups respectively, and construct a second target number of subsets to be tested.
[0120] Optionally, the test set construction module 902 includes:
[0121] an information copying unit configured to copy the user information of the to-be-recommended user to obtain a second target amount of user information of the to-be-recommended user, wherein the user information of the to-be-recommended user includes user feature information, user environment information, and user browsing history information corresponding to the to-be-recommended user;
[0122] The information matching unit is configured to combine the user information of each of the to-be-recommended users with each of the recommendation candidate groups to construct a second target number of subsets to be tested.
[0123] Optionally, the entity recommendation module 903 includes:
[0124] A total ranking unit is configured to obtain a recommendation score corresponding to each of the entities to be recommended in the subsets to be tested of the second target number;
[0125] A score aggregation unit is configured to aggregate the recommendation scores corresponding to all entities to be recommended, and sort each of the entities to be recommended from high to low according to the corresponding recommendation scores, to obtain a total ranking corresponding to all entities to be recommended in the set of entities to be recommended;
[0126] The recommendation list unit is configured to obtain the entities to be recommended that are located in the first n positions from the total ranking corresponding to all the entities to be recommended, and generate a recommendation list of the entities to be recommended, wherein the n positions are positive integers greater than or equal to 1.
[0127] The present application divides a large-scale set of entities to be recommended into several recommendation candidate groups according to the single processing quantity of the recommendation model, and then copies and matches the user information of the users to be recommended, thereby forming several subsets to be tested that require model calculation. By linearly calculating each subset to be tested, the large-scale set of entities to be recommended can be directly calculated and processed, and a unified method can be used to directly predict or recommend the selected set, thereby improving the processing speed and accuracy of the large-scale set of entities to be recommended.
[0128] An embodiment of the present application further provides a computing device, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the instructions:
[0129] Acquire a training sample and a corresponding training label, wherein the training sample includes user information of a sample user and a sample recommendation set including a first target number of sample recommendation entities, and the training label includes the sample recommendation entity finally selected by the sample user from the sample recommendation set;
[0130] The recommendation model is trained using the training samples and corresponding training labels, and the parameters of the recommendation model are adjusted according to the loss value of the recommendation model until a training termination condition is met.
[0131] An embodiment of the present application further provides a computing device, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the instructions:
[0132] Acquire a set of entities to be recommended, and divide the set of entities to be recommended into a second target number of recommendation candidate groups, so that each of the recommendation candidate groups includes the first target number of entities to be recommended;
[0133] Acquire user information of the user to be recommended, match the user information of the user to be recommended with each of the recommendation candidate groups respectively, and construct a second target number of subsets to be tested;
[0134] The second target number of to-be-tested subsets are respectively input into the recommendation model as described above, the recommendation score corresponding to each to-be-recommended entity in the to-be-recommended entity set is obtained, and a recommendation list is determined.
[0135] An embodiment of the present application also provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the training method of the recommendation model or the steps of the recommendation method as described above.
[0136] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the computer-readable storage medium and the technical scheme of the training method of the recommendation model or the recommendation method mentioned above belong to the same concept, and the details not described in detail in the technical scheme of the computer-readable storage medium can be referred to the description of the technical scheme of the training method of the recommendation model mentioned above.
[0137] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0138] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0139] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0140] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0141] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is limited only by the claims and their full scope and equivalents.
Claims
1. A recommendation method, characterized in that: include: Acquire a set of entities to be recommended, and divide the set of entities to be recommended into a second target number of recommendation candidate groups, so that each of the recommendation candidate groups includes a first target number of entities to be recommended, wherein the set of entities to be recommended is composed of a large number of the entities to be recommended; Acquire user information of the user to be recommended, and copy the user information of the user to be recommended to obtain a second target number of user information of the user to be recommended, wherein the user information of the user to be recommended includes user feature information, user environment information, and user browsing history information corresponding to the user to be recommended; Combining the user information of each of the to-be-recommended users with each of the recommendation candidate groups to construct a second target number of subsets to be tested; Inputting the second target number of to-be-tested subsets into the recommendation model respectively, obtaining the recommendation score corresponding to each to-be-recommended entity in the to-be-recommended entity set and determining the recommendation list; wherein the training process of the recommendation model includes: Acquire training samples and corresponding training labels, wherein the training samples include user information of sample users and a sample recommendation set including a first target number of sample recommendation entities, wherein the first target number is a small-scale number; The recommendation model is trained using the training samples and corresponding training labels, and the parameters of the recommendation model are adjusted according to the loss value of the recommendation model until a training termination condition is met.
2. The method according to claim 1, characterized in that Get training samples and corresponding training labels, including: Acquire user feature information, user environment information, and user browsing history information corresponding to the sample user, and acquire a first target number of sample recommendation entities according to the user browsing history information corresponding to the sample user to obtain the sample recommendation set; According to the user feature information, user environment information and user historical browsing information corresponding to the sample user, the sample recommendation entity finally selected by the sample user from the sample recommendation set is obtained as a training label.
3. The method according to claim 2, characterized in that The recommendation model is trained using the training samples and corresponding training labels, including: Using the training samples, any initialized deep learning model is trained; the initialized deep learning model scores each sample recommendation entity in the sample recommendation set to obtain a corresponding recommendation score; Sort each sample recommendation entity from high to low according to the corresponding recommendation score; When the training termination condition is met, the training is stopped to obtain the recommendation model.
4. The method according to claim 1, characterized in that: Obtaining the recommendation score corresponding to each entity to be recommended in the set of entities to be recommended and determining a recommendation list includes: Obtaining a recommendation score corresponding to each of the to-be-recommended entities in the to-be-tested subset of the second target number; Summarizing the recommendation scores corresponding to all entities to be recommended, and sorting each of the entities to be recommended from high to low according to the corresponding recommendation scores, to obtain the total ranking corresponding to all entities to be recommended in the set of entities to be recommended; The entities to be recommended that are in the first n positions are obtained from the total ranking corresponding to all the entities to be recommended, and a recommendation list of the entities to be recommended is generated, wherein the n positions are positive integers greater than or equal to 1.
5. A recommendation device, characterized in that: include: A candidate group construction module is configured to obtain a set of entities to be recommended, and divide the set of entities to be recommended into a second target number of recommendation candidate groups, so that each of the recommendation candidate groups includes the first target number of entities to be recommended; A test set construction module is configured to obtain user information of a user to be recommended, copy the user information of the user to be recommended, and obtain user information of a second target number of the users to be recommended, wherein the user information of the users to be recommended includes user feature information, user environment information, and user historical browsing information corresponding to the users to be recommended; and combine the user information of each user to be recommended with each of the recommendation candidate groups to construct a second target number of subsets to be tested; An entity recommendation module is configured to input the second target number of to-be-tested subsets into the recommendation model respectively, obtain a recommendation score corresponding to each to-be-recommended entity in the to-be-recommended entity set, and determine a recommendation list; A training information acquisition module is configured to acquire training samples and corresponding training labels, wherein the training samples include user information of sample users and a sample recommendation set including a first target number of sample recommendation entities, wherein the first target number is a small-scale number; The model training module is configured to train the recommendation model through the training samples and corresponding training labels, and adjust the parameters of the recommendation model according to the loss value of the recommendation model until the training termination condition is met.
6. The device according to claim 5, characterized in that The training information acquisition module includes: A user information acquisition unit is configured to acquire user feature information, user environment information, and user historical browsing information corresponding to the sample user, and acquire a first target number of sample recommendation entities according to the user historical browsing information corresponding to the sample user to obtain the sample recommendation set; The label acquisition unit is configured to acquire the sample recommendation entity finally selected by the sample user from the sample recommendation set as a training label according to the user feature information, user environment information and user historical browsing information corresponding to the sample user.
7. The device according to claim 6, characterized in that The model training module includes: A first model training unit is configured to train any initialized deep learning model through the training sample, wherein the initialized deep learning model scores each sample recommendation entity in the sample recommendation set to obtain a corresponding recommendation score; The second model training unit is configured to sort each sample recommendation entity from high to low according to the corresponding recommendation score; The third model training unit is configured to stop training when a training termination condition is met to obtain the recommendation model.
8. The device according to claim 5, characterized in that The entity recommendation module includes: A total ranking unit is configured to obtain a recommendation score corresponding to each of the entities to be recommended in the subsets to be tested of the second target number; A score aggregation unit is configured to aggregate the recommendation scores corresponding to all entities to be recommended, and sort each of the entities to be recommended from high to low according to the corresponding recommendation scores, to obtain a total ranking corresponding to all entities to be recommended in the set of entities to be recommended; The recommendation list unit is configured to obtain the entities to be recommended that are located in the first n positions from the total ranking corresponding to all the entities to be recommended, and generate a recommendation list of the entities to be recommended, wherein the n positions are positive integers greater than or equal to 1.
9. A computing device comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the instructions, the steps of the method according to any one of claims 1 to 4 are implemented.
10. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by a processor, the steps of the method described in any one of claims 1 to 4 are implemented.
