Training method, electronic device and storage medium for book sorting and push model
By obtaining and annotating the interactive book list of user interaction periods, combining interaction depth information to form a training sample group, fine-tuning the pre-training model, the problem that cannot be accurately recommended in the existing technology is solved, and a more accurate book push effect is achieved.
Patent Information
- Application Number
- CN202011373709.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-30
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2040-11-30
AI Technical Summary
The existing book recommendation model cannot accurately recommend the user's interactive depth information of different books, resulting in insufficient push results.
By obtaining the interactive book list for the user's interaction period, positive and negative annotation is performed to generate a training sample set, combining interaction depth information to form a training sample group, and fine-tuning the pre-trained model to generate a push model suitable for book sorting.
This enables the book push model to fully consider the differences in interaction depth between different books and improves the accuracy of recommended results.
Smart Images

Figure CN112417290B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a training method, electronic equipment and storage medium for a book sorting and pushing model. Background Art
[0002] Books in the form of e-books are loved by a large number of users due to their advantages such as easy access. Most book reading platforms recommend books based on the similarity of the full text of the book. In the prior art, several books with high similarity in content to books that the user has read before are generally presented to the user as recommended books.
[0003] However, the inventors found that the above recommendation method has at least the following defects in the process of implementing the present invention: since books are long-interaction business objects, the interaction depths corresponding to different interactive books are often different, and the interaction depth can reflect the user's preference for books. However, the existing book push model cannot make accurate recommendations based on the user's interaction depth information for different books. Summary of the invention
[0004] In view of the above problems, the present invention is proposed to provide a book sorting and pushing model training and book sorting and pushing method, electronic device and storage medium that overcome the above problems or at least partially solve the above problems.
[0005] According to one aspect of the present invention, a method for training a book sorting and pushing model is provided, comprising:
[0006] Obtaining a list of interactive books corresponding to the interactive period of the reading user, and performing positive and negative marking on each interactive book in the list of interactive books to obtain a first training sample set;
[0007] Generate a pre-training model and a sample vector and a sample weight corresponding to the pre-training model according to the first training sample set;
[0008] According to the interaction depth information of each interactive book in the first training sample set, the interactive books in the first training sample set are combined into a plurality of training sample groups, and each training sample group is labeled according to a comparison result of the interaction depth information of at least two training samples included in each training sample group, so as to obtain a second training sample set;
[0009] The pre-trained model is fine-tuned by using the second training sample set and the sample vectors and sample weights corresponding to the pre-trained model, and the fine-tuned pre-trained model is used as the book sorting and pushing model.
[0010] According to another aspect of the present invention, a book sorting and pushing method is provided, wherein the method is implemented based on the above-mentioned book sorting and pushing model.
[0011] According to another aspect of the present invention, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;
[0012] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the following operations:
[0013] Obtaining a list of interactive books corresponding to the interactive period of the reading user, and performing positive and negative marking on each interactive book in the list of interactive books to obtain a first training sample set;
[0014] Generate a pre-training model and a sample vector and a sample weight corresponding to the pre-training model according to the first training sample set;
[0015] According to the interaction depth information of each interactive book in the first training sample set, the interactive books in the first training sample set are combined into a plurality of training sample groups, and each training sample group is labeled according to a comparison result of the interaction depth information of at least two training samples included in each training sample group, so as to obtain a second training sample set;
[0016] The pre-trained model is fine-tuned by using the second training sample set and the sample vectors and sample weights corresponding to the pre-trained model, and the fine-tuned pre-trained model is used as the book sorting and pushing model.
[0017] According to another aspect of the present invention, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;
[0018] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the following operations: implementing a book sorting and pushing method based on the above-mentioned book sorting and pushing model.
[0019] According to another aspect of the present invention, a computer storage medium is provided, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute the above method.
[0020] In the training method, electronic device and storage medium of the book sorting and pushing model provided by the present invention, the interactive books in the first training sample set are combined into multiple training sample groups according to the interaction depth information of each interactive book in the first training sample set, and each training sample group is labeled according to the comparison result of the interaction depth information of at least two training samples contained in each training sample group to obtain a second training sample set, and then the obtained pre-trained model is fine-tuned according to the second training sample set, so that the final book sorting and pushing model is adapted to the business scenario of book pushing, and can fully consider the difference in interaction depth between different books, so as to make the pushing result more accurate.
[0021] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0023] Figure 1 A flowchart of a method for training a book sorting and pushing model provided by an embodiment of the present invention is shown;
[0024] Figure 2 A flowchart of a method for training a book sorting and pushing model provided by another embodiment of the present invention is shown;
[0025] Figure 3 A schematic structural diagram of an electronic device according to another embodiment of the present invention is shown. DETAILED DESCRIPTION
[0026] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0027] Embodiment 1
[0028] Figure 1 FIG. 1 is a flowchart showing a book sorting and pushing model training and a book sorting and pushing method provided by an embodiment of the present invention. Figure 1As shown, the method comprises the following steps:
[0029] Step S110: Obtain an interactive book list corresponding to the interactive period of the reading user, and perform positive and negative labeling on each interactive book in the interactive book list to obtain a first training sample set.
[0030] The interactive period refers to a period of time defined by a start time period and an end time period. During the interactive period, user behavior is continuously monitored, and a list of interactive books corresponding to the interactive period of the reading user is obtained based on the monitoring results. The interactive book list is used to store at least one e-book that the reading user has interacted with during the interactive period. The so-called interaction includes: the user has triggered various preset types of interactive operations such as click operations, search operations, and browse operations on the e-book. The types and number of interactive operations can be flexibly set by technicians in this field according to business scenarios.
[0031] Since the interactive book list includes multiple e-books, and the user's interaction with different e-books is different, each interactive book in the interactive book list is labeled positively or negatively according to the user's interaction with each interactive book in the interactive book list, thereby obtaining a first training sample set. Specifically, interactive books with an interaction time longer than a preset time can be marked as positive samples, and interactive books with an interaction time not longer than the preset time can be marked as negative samples. The present invention does not limit the specific implementation method of positive and negative labeling.
[0032] Step S120: Generate a pre-training model and a sample vector and sample weight corresponding to the pre-training model according to the first training sample set.
[0033] Specifically, a model training operation is performed through the first training sample set to obtain a pre-trained model. In addition, during the pre-training process, model parameter information such as sample vectors and sample weights corresponding to the pre-trained model can be learned. The pre-trained model can be implemented based on various neural network models. The sample vector can be an embedding vector of the sample, and the sample weight can be an attention weight determined based on an attention mechanism.
[0034] Step S130: According to the interaction depth information of each interactive book in the first training sample set, the interactive books in the first training sample set are combined into multiple training sample groups, and each training sample group is labeled according to the comparison result of the interaction depth information of at least two training samples contained in each training sample group to obtain a second training sample set.
[0035] Specifically, the interaction depth information of each interactive book in the first training sample set is obtained respectively, and the interactive books in the first training sample set are combined into multiple training sample groups according to the interaction depth information. Among them, a training sample group contains at least two training samples, and the comparison result between the interaction depth information of at least two training samples contained in a training sample group is calculated, and each training sample group is labeled according to the calculation result. It can be seen that the labeling result of each training sample group is used to express the comparison of the interaction depth information between at least two training samples contained in the training sample group. Accordingly, unlike the first training sample set based on a single sample, the second training sample set is based on sample groups. Therefore, the differences between the interaction depth information between different training samples can be reflected through the sample group.
[0036] Step S140: fine-tune the pre-trained model using the second training sample set and the sample vectors and sample weights corresponding to the pre-trained model, and use the fine-tuned pre-trained model as a book sorting and pushing model.
[0037] Specifically, the pre-trained model is fine-tuned through the second training sample set. During the fine-tuning process, the second training sample set is trained using the sample vectors and sample weights corresponding to the pre-trained model obtained in step S120, so that the pre-trained model acts on the second training sample set, thereby using the fine-tuned pre-trained model as a book sorting push model. Since the second training sample set is implemented based on a sample group, it can reflect the differences between the interaction depth information corresponding to multiple training samples. Therefore, the book sorting push model obtained after retraining with the second training sample set can realize diversified and accurate push in combination with the different interaction depths of users for different books.
[0038] It can be seen that in the training method of the book sorting and push model provided by the present invention, according to the interaction depth information of each interactive book in the first training sample set, the interactive books in the first training sample set are combined into multiple training sample groups, and each training sample group is labeled according to the comparison result of the interaction depth information of at least two training samples contained in each training sample group to obtain the second training sample set, and then the obtained pre-trained model is fine-tuned according to the second training sample set, so that the final book sorting and push model is adapted to the business scenario of book push, and can fully consider the differences in interaction depth between different books, thereby making the push results more accurate.
[0039] Embodiment 2
[0040] Figure 2 FIG. 2 is a flow chart showing a method for training a book sorting and pushing model provided by another embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:
[0041] Step S210: Obtaining a list of interactive books corresponding to the interactive period of the reading user.
[0042] Among them, the reading user is uniquely identified by a user identification (such as a user ID), and the interaction period is determined by a starting time point and an ending time point. According to the reading behavior information of the reading user during the interaction period, the interactive book list of the reading user corresponding to the interaction period can be determined. Among them, the interactive book list is used to store at least one e-book that the reading user has interacted with during the interaction period. Among them, the so-called interaction includes: the user has triggered various preset types of interactive operations such as click operations, search operations, and browsing operations on the e-book. The types and number of interactive operations can be flexibly set by technical personnel in this field according to business scenarios. For example, in this embodiment, in order to ensure the comprehensiveness of the sample, the interactive operations can cover various types of user operations, including various behaviors such as clicks and downloads.
[0043] Step S220: performing positive and negative labeling on each interactive book in the interactive book list to obtain a first training sample set.
[0044] Since the interactive book list contains multiple e-books, and the user's interaction with different e-books is different, each interactive book in the interactive book list is positively and negatively labeled according to the user's interaction with each interactive book in the interactive book list, so as to obtain the first training sample set. Specifically, for each interactive book in the interactive book list, the interaction of the interactive book within a preset time is monitored, and the book is marked according to the monitoring result. Among them, the preset time can be three days or seven days. In the process of implementing the present invention, the inventor found that since books are business objects of long interaction, users need to interact with a book continuously for many times, and the user's interest preference for the book cannot be determined only by the interaction within a short period of time (such as one day). Therefore, considering the long interaction characteristics of books, for an interactive book, the interaction time and interaction type of the interactive operation triggered by the user for the interactive book within the preset time are continuously monitored, and the interactive book is marked as a positive sample or a negative sample according to the monitoring result. For example, an interactive book that the user has not read after downloading is marked as a negative sample, and an interactive book that the user has read for more than the preset time after downloading is marked as a positive sample. The first training sample set is obtained according to the interactive books after positive and negative labeling.
[0045] Step S230: Generate a pre-training model and a sample vector and sample weight corresponding to the pre-training model according to the first training sample set.
[0046] Specifically, a model training operation is performed through the first training sample set to obtain a pre-trained model. Moreover, during the pre-training process, model parameter information such as sample vectors and sample weights corresponding to the pre-trained model can be learned. Among them, the pre-trained model can be implemented based on various neural network models, for example, it can be implemented based on a deep interest network. The sample vector can be an embedding vector of the sample, and the sample weight can be an attention weight determined based on an attention mechanism. In specific implementation, through the learning process of the model network layer, various model parameter information such as sample vectors and sample weights can be learned.
[0047] In this embodiment, when a pre-trained model and a sample vector and a sample weight corresponding to the pre-trained model are generated according to the first training sample set, the pre-trained model is trained by a first type of sorting algorithm. The first type of sorting algorithm is a sorting algorithm based on a single sample, for example, it can be a Pointwise algorithm. Accordingly, the first training sample set is determined based on a single sample. In addition, the pre-trained model includes: a network layer and a fully connected layer; wherein the network layer is used to determine the sample vector and sample weight corresponding to the pre-trained model, and accordingly, the fully connected layer is implemented based on the first type of sorting algorithm.
[0048] Step S240: According to the interaction depth information of each interactive book in the first training sample set, the interactive books in the first training sample set are combined into multiple training sample groups, and each training sample group is labeled according to the comparison result of the interaction depth information of at least two training samples contained in each training sample group to obtain a second training sample set.
[0049] First, the interaction depth information of each interactive book in the first training sample set is obtained respectively. The interaction depth information of each interactive book is determined according to the interaction time and / or interaction type corresponding to each interactive book. The interaction time includes: reading interaction time. The interaction type includes: browsing type, download type, payment type and other types, which are not limited in the present invention.
[0050] Next, the interactive books in the first training sample set are combined into multiple training sample groups according to the interactive depth information. Among them, a training sample group contains at least two training samples, and the comparison result between the interactive depth information of at least two training samples contained in a training sample group is calculated, and each training sample group is labeled according to the calculation result. For example, when the training sample group is a training sample pair, if the interactive depth value of the previous training sample is greater than the interactive depth value of the subsequent training sample, the labeling result of the training sample pair is positive; if the interactive depth value of the subsequent training sample is greater than the interactive depth value of the previous training sample, the labeling result of the training sample pair is negative. It can be seen that the labeling results of each training sample group are used to express the comparison of the interactive depth information between at least two training samples contained in the training sample group. Accordingly, unlike the first training sample set based on a single sample, the second training sample set is based on a sample group. Therefore, the differences between the interactive depth information between different training samples can be reflected through the sample group. In specific implementation, the second training sample set can be determined based on a sample pair or a sample list.
[0051] Step S250: fine-tune the pre-trained model using the second training sample set and the sample vectors and sample weights corresponding to the pre-trained model, and use the fine-tuned pre-trained model as a book sorting and pushing model.
[0052] Specifically, the pre-trained model is fine-tuned through the second training sample set. During the fine-tuning process, the second training sample set is trained using the sample vectors and sample weights corresponding to the pre-trained model, so that the pre-trained model acts on the second training sample set, thereby using the fine-tuned pre-trained model as a book sorting and push model. Since the second training sample set is implemented based on a sample group, it can reflect the differences between the interaction depth information corresponding to multiple training samples. Therefore, the book sorting and push model obtained after retraining with the second training sample set can realize diversified and accurate push in combination with the different interaction depths of users for different books.
[0053] In this embodiment, the pre-trained model is fine-tuned by the second sorting algorithm. Specifically, the sample vectors and sample weights corresponding to the pre-trained model are shared at the network layer, and the second training sample set is trained by the second sorting algorithm at the fully connected layer. The second sorting algorithm is a sorting algorithm based on sample pairs or sample lists. For example, the second sorting algorithm includes: Pairwise algorithm, and / or Listwise algorithm.
[0054] In summary, through the training method in this embodiment, the obtained pre-trained model can be fine-tuned according to the second training sample set, so that the final book sorting and push model can adapt to the business scenario of book push, and can fully consider the different interaction depths between different books, thereby making the push results more accurate. Among them, the various parameters of the model are first trained through the first training sample set based on a single sample and the first type of sorting algorithm, and then the pre-trained model is fine-tuned based on the second training sample set and the second type of sorting algorithm implemented by the sample group. This method can prevent the overfitting problem caused by sample sparsity when directly using the second training sample set for training, thereby achieving a better sorting prediction effect.
[0055] For ease of understanding, the specific implementation details of this embodiment are described in detail below using a specific example:
[0056] First, for each reading user, obtain the interactive book list of the reading user in the interactive period. In order to ensure the comprehensiveness of the sample, it is necessary to obtain the interactive book list for multiple users in multiple interactive periods. Therefore, in order to distinguish different users and different interactive periods, the list identifier of the interactive book list needs to include the user identifier and the period information, wherein the user identifier can be the user ID of the reading user, and the period information is jointly identified by the starting time point and the ending time point. Therefore, each reading user as a sample contains at least one interactive book in the interactive book list in an interactive period. Then, for each interactive book included in the interactive book list, monitor the interaction time and / or interaction type generated by the user for the interactive book within the preset time. Among them, the preset time can be three days or seven days. Since it takes a long time to read a book, it is necessary to set the preset time slightly longer. By continuously monitoring the interaction time and interaction type of each interactive behavior triggered by the user for the interactive book within the preset time, the user's interaction depth information corresponding to the interactive book is determined. For example, the longer the interaction time, the greater the interaction depth value; for another example, different weights can be set in advance for each type of interaction behavior, so as to perform weighted operations on each interaction behavior according to the interaction type, and determine the interaction depth value based on the weighted results. For example, the weights of the following interaction types decrease in sequence: paid interaction type, download type, add to bookshelf type, browse free chapter type, etc.
[0057] Positive and negative labels are made for each interactive book in the interactive book list to obtain a first training sample set. When specifically labeling, the training samples corresponding to the interactive books with an interaction depth value greater than a preset value can be labeled as positive samples, and the training samples corresponding to the interactive books with an interaction depth value less than a preset value can be labeled as negative samples, thereby constructing the first training sample set. Among them, the sample feature information of each training sample in the first training sample set includes: user attribute features of the reading user (such as age, gender, reading preferences, etc.), and book features of the interactive book (such as book classification, book name, etc.). Since the labeling result of each training sample in the first training sample set is either positive or negative, each training sample in the first training sample set is independent of each other, that is, the first training sample set is implemented based on a single sample.
[0058] The first training sample set after annotation is input into the deep interest model to learn the various network parameters of the model. The deep interest model includes: an input layer, a network layer, and a fully connected layer. The input layer is used to input the first training sample set mentioned above. The network layer further includes a vector module and an attention module. The vector module is also called an embedding layer, which is used to learn the embedding vectors of each training sample and convert the original high-dimensional, sparse data into a low-dimensional real-valued representation (dense vector). The attention module is also called an attention layer, which is used to learn the attention weights of the embedding vectors of each training sample based on the attention mechanism. Specifically, for the current candidate book, the relevant historical interactive books are locally activated, so that the interactive books with higher relevance to the current candidate book have higher attention weights, so that the interactive books with high relevance can dominate this prediction process. The fully connected layer is used to learn the nonlinear relationship between features, specifically learning the relationship between each embedding vector according to the Pointwise algorithm, so as to finally obtain the prediction result. The Pointwise algorithm is an algorithm based on 0 and 1. The deep interest model implemented by the Pointwise algorithm can fit various parameters well, so that the embedding vectors and attention weights obtained by the network layer are more in line with business needs. The deep interest model obtained after training with the Pointwise algorithm is the pre-trained model.
[0059] The inventors discovered in the process of implementing the present invention that since the Pointwise algorithm is only based on the labeling results of 0 or 1, the samples are either positive or negative, and cannot reflect the differences in interaction depth between multiple positive samples. However, among the positive samples, most are books with very short interaction time. The Pointwise algorithm has a higher fit for books with short interaction time, but the fit for interactive books with longer interaction time is not ideal. Therefore, in order to enable the model to make accurate predictions based on the differences in interaction depth to fit samples with longer interaction time, in this example, a second training sample set is further constructed based on the pre-trained model, and the pre-trained model is fine-tuned based on the Pairwise algorithm.
[0060] Specifically, the positive samples included in the first training sample set are selected, and each training sample belonging to the positive sample is combined in pairs to form a plurality of training sample pairs. Wherein, when constructing the training sample pairs, the plurality of positive samples can be sorted according to the interaction depth value, and then, each positive sample obtained after sorting is combined in pairs to obtain a plurality of training sample pairs. Specifically, considering the characteristic that the Pointwise algorithm has poor fitting performance for samples with a long interaction time, several positive samples with an interaction depth value greater than a preset depth threshold can be screened, and training sample pairs can be constructed based on the screened positive samples, so as to focus on learning the characteristics of samples with a long interaction time. In addition, when constructing training sample pairs based on the screened positive samples, in order to ensure that the difference between the two training samples in each training sample pair meets the preset range, the positive samples screened out for the first time can be further screened out for the second time, so that the two training samples whose difference between the screened interaction depth values belongs to the preset interval constitute a group of training sample pairs. For example, if the difference between the interaction depth values of the two training samples happens to belong to the preset interval, the two training samples are used as a group of training sample pairs. Wherein, the lower limit and the upper limit of the preset interval can be flexibly set by those skilled in the art. In this way, it is possible to avoid treating two training samples with very small differences as a group of sample pairs, or treating two training samples with very different differences as a group of sample pairs, so as to better learn the regularity between samples. For example, assuming that training sample one and training sample two constitute a sample pair, the positive and negative of the sample pair are marked according to the comparison result between the interaction depth values of training sample one and training sample two. It can be seen that the difference in interaction depth between samples can be expressed in the form of training sample pairs. Accordingly, based on the second training sample set, the Pairwise algorithm is used to fine-tune the pre-trained model to obtain the final book sorting and push model. Specifically, in the fine-tuning process, the sample vectors and sample weights trained by the Pointwise algorithm are directly used, that is, the network layer of the model directly uses the network parameters obtained by the Pointwise algorithm, and the second training sample set input is trained by the Pairwise algorithm in the fully connected layer of the model to obtain the final prediction result.
[0061] Among them, the inventors found in the process of implementing the present invention that since the number of sample pairs used by the Pairwise algorithm is small, the training process is prone to overfitting. In order to solve the above problem, in this example, the Pairwise algorithm is able to share the weight information obtained by the Pointwise algorithm, and the network layer parameters are made more reasonable by weight sharing, thereby preventing the Pairwise algorithm from overfitting. It can be seen that by performing pre-training through the Pointwise algorithm and fine-tuning the Pairwise algorithm, the sorting relationship between samples can be learned, and the optimal solution of the model can be converted from a binary classification problem to a sorting problem, so that accurate recommendations can be made based on the different depths of user interaction with different books, so that the traditional deep interest model can match the book push business scenario.
[0062] In addition, in the above example, when constructing training samples, it is necessary to determine the book sample feature information corresponding to each interactive book in the interactive book list. Among them, the book sample feature information is used to describe the features of the book sample composed of each interactive book, specifically including features of multiple dimensions. In the specific implementation, the book sample feature information corresponding to each interactive book in the interactive book list is determined in the following manner: first, the first input data of the model is determined according to each interactive book in the interactive book list; then, the multi-dimensional label information corresponding to each interactive book is obtained respectively, and the multi-dimensional label information is determined as the second input data of the model; finally, the first input data and the second input data are pooled to obtain the book sample feature information corresponding to each interactive book. It can be seen that the model has two input dimensions, or the model has two input layers, which are the first input layer for inputting the first input data and the second input layer for inputting the second input data. Among them, for a reading user, since the interests of the reading user are diverse, the number of interactive books contained in the interactive book list corresponding to the reading user is multiple, and accordingly, the first input data constructed for the reading user contains multiple dimensions, each of which corresponds to an interactive book. It can be seen that the first input data includes at least one of the following information: user identification information for identifying the reading user, time period information for identifying a preset time period (for example, determined by the time period start time and the time period end time), and book feature information for identifying the corresponding interactive book. Among them, the book feature information includes: book name, book type, etc. For each interactive book, since books have multi-classified business characteristics, for example, a book may belong to multiple classification types such as science fiction type, long type, male frequency type, etc., therefore, in order to accurately describe the book feature information of an interactive book, multi-dimensional label information corresponding to each interactive book is obtained respectively, and the multi-dimensional label information is determined as the second input data of the model. It can be seen that for the book feature of an interactive book, there is multi-dimensional label information, and the multi-dimensional label information can be multi-dimensional classification label information. It can be seen that not only the first input data is multi-dimensional, but also the second input data is multi-dimensional. Through two-level multi-dimensional input data, it is possible to accurately describe multiple interactive books corresponding to a user and the multi-classification features of each interactive book. Since this embodiment adds an input layer on the basis of the traditional neural network model, in order to fuse the information of the two input layers, it is necessary to perform pooling processing on the first input data and the second input data. Specifically, average pooling processing can be performed on the first input data and the second input data, that is, performing an average pooling operation. Through the pooling operation, the two types of input data can be fused to obtain the book sample feature information corresponding to each interactive book.This example takes full account of the multi-classification characteristics of books when constructing book sample feature information, making the sample features more accurate and comprehensive.
[0063] In addition, when calculating the sample weight corresponding to the sample vector (i.e., the attention weight of the sample vector), this example determines the attention weight corresponding to each book sample vector according to the interaction depth information of the interactive books corresponding to each book sample vector. Among them, determining the attention weight corresponding to each book sample vector according to the interaction depth information means: when determining the attention weight corresponding to each book sample vector through the attention mechanism, the differences in the interaction depth information of different interactive books are considered, so as to set different attention weights for each interactive book according to the different interaction depth information of the interactive books. Specifically, in the deep interest network, it is necessary to learn the weight information of each book sample vector through the attention mechanism (i.e., the attention mechanism), and the weight information is used to reflect the correlation between the book sample vector and the candidate book to be predicted. The higher the correlation, the greater the weight of the book sample vector. In this example, the attention weight corresponding to each book sample vector is determined by at least one of the following implementation methods:
[0064] In an optional implementation, the interactive depth information of the interactive books corresponding to each book sample vector is converted into an interactive depth weight, and the attention weight corresponding to each book sample vector is corrected by the interactive depth weight to obtain the final attention weight. The correction process may include a variety of processing methods such as weighted correction and fine-tuning correction. For example, first, the interactive depth information of the interactive books corresponding to each book sample vector is obtained, and the interactive depth information is normalized to obtain the interactive depth weight corresponding to the interactive depth information; then, the original attention weight corresponding to each book sample vector determined by the attention module is obtained, and the attention weight corresponding to each book sample vector is jointly determined according to the original attention weight corresponding to each book sample vector and the interactive depth weight corresponding to each book sample vector. Among them, the normalization processing method includes: normalizing the interactive depth information according to the beta distribution function (i.e., beta function), and the uniform distribution of the interactive depth information can be achieved through the beta distribution function. In addition, when the attention weights corresponding to the book sample vectors are determined together according to the original attention weights corresponding to the book sample vectors and the interaction depth weights corresponding to the book sample vectors, the attention weights corresponding to the book sample vectors are determined according to the product of the original attention weights corresponding to the book sample vectors and the interaction depth weights corresponding to the book sample vectors. The deep interest network includes a network layer, and the network layer further includes an embedding layer and an attention layer, wherein the embedding layer is used to learn the book sample vectors corresponding to the feature information of each book sample, and the attention layer is used to learn the attention weights of each book sample vector. The so-called original attention weight refers to the weight calculation result obtained by the attention layer according to the input content. The input content of the attention layer mainly includes: the vector corresponding to the book to be predicted and the book sample vectors of the interactive books. It can be seen that by multiplying the interaction depth weight on the basis of the original attention weight, the weight calculation results of the book sample vectors of each interactive book can be different with different interaction depths, thereby giving higher weights to book samples with higher interaction depth values, thereby making the recommendation results more accurate.
[0065] In another optional implementation, the interactive depth information of the interactive books corresponding to each book sample vector is used as the input content of the above-mentioned attention layer, so that the attention weight is determined by integrating the interactive depth information. For example, the interactive depth information of the interactive books corresponding to each book sample vector is used as additional input information of the attention module, so that the attention module can determine the attention weight corresponding to each book sample vector in combination with the additional input information. Specifically, in this method, the input content of the attention layer includes not only the vector corresponding to the book to be predicted and the book sample vector of the interactive book, but also the interactive depth information of the interactive book. Among them, the interactive depth information can be a normalized value in the manner mentioned above, or it can be other forms of representation, which is not limited by the present invention. In short, this method adds the interactive depth information to the input content of the attention module, so that the attention weight obtained by the attention module integrates the influence of the interactive depth information. This method can also make the weight calculation results of the book sample vectors of each interactive book different with the different interactive depths, thereby giving higher weights to book samples with higher interactive depth values, thereby making the recommendation results more accurate.
[0066] The above two methods can be used alone or in combination. When the two are used in combination, on the one hand, the interaction depth information is used as the input of the attention module to calculate the original attention weight; on the other hand, based on the calculated original attention weight, it is further modified according to the interaction depth information, so that the interaction depth information can be deeply integrated with the module, thereby enhancing the influence of the interaction depth information. In specific implementation, the implementation method can be flexibly selected according to the specific business scenario.
[0067] In addition, another embodiment of the present invention also provides a book sorting and pushing method, which is implemented based on the above-mentioned book sorting and pushing model. Specifically, a list of interactive books corresponding to the interactive period of the predicted user is obtained, and the user's historical interest information is determined based on the interactive book list. Then, a list of candidate books to be pushed is obtained, and the feature data corresponding to the candidate book list and the interactive book list are input into the trained book sorting and pushing model, and each candidate book in the candidate book list is sorted according to the output result of the book sorting and pushing model, so as to realize book pushing according to the sorting result. Since the book sorting and pushing model is established based on the user's interaction depth for each book, it can fully consider the difference in interaction depth between different books, thereby making the push result more accurate.
[0068] Embodiment 3
[0069] An embodiment of the present application provides a non-volatile computer storage medium, which stores at least one executable instruction. The computer executable instruction can execute the training of the book sorting and pushing model and the book sorting and pushing method in any of the above method embodiments.
[0070] The executable instructions may be used to cause the processor to perform the following operations:
[0071] Obtaining a list of interactive books corresponding to the interactive period of the reading user, and performing positive and negative marking on each interactive book in the list of interactive books to obtain a first training sample set;
[0072] Generate a pre-training model and a sample vector and a sample weight corresponding to the pre-training model according to the first training sample set;
[0073] According to the interaction depth information of each interactive book in the first training sample set, the interactive books in the first training sample set are combined into a plurality of training sample groups, and each training sample group is labeled according to a comparison result of the interaction depth information of at least two training samples included in each training sample group, so as to obtain a second training sample set;
[0074] The pre-trained model is fine-tuned by using the second training sample set and the sample vectors and sample weights corresponding to the pre-trained model, and the fine-tuned pre-trained model is used as the book sorting and pushing model.
[0075] In an optional implementation, the executable instruction causes the processor to perform the following operations:
[0076] Training the pre-trained model by a first type of sorting algorithm;
[0077] The pre-trained model is fine-tuned by a second type of sorting algorithm.
[0078] In an optional implementation, the first type of sorting algorithm is a sorting algorithm based on a single sample, and the second type of sorting algorithm is a sorting algorithm based on sample pairs or sample lists;
[0079] In an optional implementation, the first type of sorting algorithms includes: Pointwise algorithm; and the second type of sorting algorithms includes: Pairwise algorithm and / or Listwise algorithm.
[0080] In an optional implementation, the pre-trained model includes: a network layer and a fully connected layer; wherein the network layer is used to determine the sample vector and sample weight corresponding to the pre-trained model, and the fully connected layer is implemented based on the first type of sorting algorithm;
[0081] The executable instructions cause the processor to perform the following operations:
[0082] The sample vectors and sample weights corresponding to the pre-trained model are shared at the network layer, and the second training sample set is trained by the second type of sorting algorithm at the fully connected layer.
[0083] In an optional implementation, the interaction period is determined by a start time point and an end time point; and the interaction depth information of each interactive book is determined according to the interaction duration and / or interaction type corresponding to each interactive book.
[0084] In an optional implementation, the first training sample set is determined based on a single sample; and the second training sample set is determined based on a sample pair or a sample list.
[0085] In yet another optional implementation, the executable instructions may be specifically used to enable the processor to perform the following operations: implement a book sorting and pushing method based on the above-mentioned book sorting and pushing model.
[0086] Embodiment 4
[0087] Figure 3 A schematic structural diagram of an electronic device according to another embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.
[0088] like Figure 3 As shown, the electronic device may include: a processor (processor) 302 , a communication interface (Communications Interface) 304 , a memory (memory) 306 , and a communication bus 308 .
[0089] The processor 302, the communication interface 304, and the memory 306 communicate with each other via the communication bus 308. The communication interface 304 is used to communicate with other devices such as a client or other server network elements. The processor 302 is used to execute the program 310, which can specifically execute the training of the book sorting and pushing model and the related steps in the embodiment of the book sorting and pushing method.
[0090] Specifically, the program 310 may include program codes, which include computer operation instructions.
[0091] The processor 302 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0092] The memory 306 is used to store the program 310. The memory 306 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0093] The program 310 may be specifically configured to enable the processor 302 to perform the following operations:
[0094] Obtaining a list of interactive books corresponding to the interactive period of the reading user, and performing positive and negative marking on each interactive book in the list of interactive books to obtain a first training sample set;
[0095] Generate a pre-training model and a sample vector and a sample weight corresponding to the pre-training model according to the first training sample set;
[0096] According to the interaction depth information of each interactive book in the first training sample set, the interactive books in the first training sample set are combined into a plurality of training sample groups, and each training sample group is labeled according to a comparison result of the interaction depth information of at least two training samples included in each training sample group, so as to obtain a second training sample set;
[0097] The pre-trained model is fine-tuned by using the second training sample set and the sample vectors and sample weights corresponding to the pre-trained model, and the fine-tuned pre-trained model is used as the book sorting and pushing model.
[0098] In an optional implementation, the executable instruction causes the processor to perform the following operations:
[0099] Training the pre-trained model by a first type of sorting algorithm;
[0100] The pre-trained model is fine-tuned by a second type of sorting algorithm.
[0101] In an optional implementation, the first type of sorting algorithm is a sorting algorithm based on a single sample, and the second type of sorting algorithm is a sorting algorithm based on sample pairs or sample lists;
[0102] In an optional implementation, the first type of sorting algorithms includes: Pointwise algorithm; and the second type of sorting algorithms includes: Pairwise algorithm and / or Listwise algorithm.
[0103] In an optional implementation, the pre-trained model includes: a network layer and a fully connected layer; wherein the network layer is used to determine the sample vector and sample weight corresponding to the pre-trained model, and the fully connected layer is implemented based on the first type of sorting algorithm;
[0104] The executable instructions cause the processor to perform the following operations:
[0105] The sample vectors and sample weights corresponding to the pre-trained model are shared at the network layer, and the second training sample set is trained by the second type of sorting algorithm at the fully connected layer.
[0106] In an optional implementation, the interaction period is determined by a start time point and an end time point; and the interaction depth information of each interactive book is determined according to the interaction duration and / or interaction type corresponding to each interactive book.
[0107] In an optional implementation, the first training sample set is determined based on a single sample; and the second training sample set is determined based on a sample pair or a sample list.
[0108] In addition, an embodiment of the present invention further provides an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the following operations: implement a book sorting and pushing method based on the above-mentioned book sorting and pushing model.
[0109] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific languages is for disclosing the best mode of the present invention.
[0110] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0111] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0112] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0113] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0114] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
Claims
1. A training method for a book sorting and pushing model, include: Obtaining a list of interactive books corresponding to the interactive period of the reading user, and performing positive and negative marking on each interactive book in the list of interactive books to obtain a first training sample set; The first training sample set is determined based on a single sample; Generate a pre-trained model and a sample vector and a sample weight corresponding to the pre-trained model according to the first training sample set; the pre-trained model includes a network layer and a fully connected layer; wherein the network layer is used to determine the sample vector and the sample weight corresponding to the pre-trained model, and the fully connected layer is implemented based on a first type of sorting algorithm; the first type of sorting algorithm is a sorting algorithm based on a single sample; According to the interaction depth information of each interactive book in the first training sample set, each interactive book in the first training sample set is combined into a plurality of training sample groups, and each training sample group is labeled according to the comparison result of the interaction depth information of at least two training samples contained in each training sample group, so as to obtain a second training sample set; wherein the second training sample set is determined according to a sample pair or a sample list, and one training sample group contains at least two training samples; when the training sample group is a training sample pair, if the interaction depth value of the preceding training sample is greater than the interaction depth value of the succeeding training sample, the labeling result of the training sample pair is positive; if the interaction depth value of the succeeding training sample is greater than the interaction depth value of the preceding training sample, the labeling result of the training sample pair is negative; By using the second training sample set and sharing the sample vectors and sample weights corresponding to the pre-trained model at the network layer, the pre-trained model is fine-tuned at the fully connected layer using a second type of sorting algorithm, and the fine-tuned pre-trained model is used as the book sorting push model; wherein the second type of sorting algorithm is a sorting algorithm based on sample pairs or sample lists.
2. The method according to claim 1, in, The first type of sorting algorithms includes: Pointwise algorithm; and the second type of sorting algorithms includes: Pairwise algorithm and / or Listwise algorithm.
3. The method according to any one of claims 1-2, in, The interaction period is determined by a start time point and an end time point; and the interaction depth information of each interactive book is determined according to the interaction duration and / or interaction type corresponding to each interactive book.
4. A method for sorting and pushing books, in, The method is implemented based on the book sorting and pushing model described in any one of claims 1-3.
5. An electronic device, include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the following operations: Obtaining a list of interactive books corresponding to the interactive period of the reading user, and performing positive and negative marking on each interactive book in the list of interactive books to obtain a first training sample set; The first training sample set is determined based on a single sample; Generate a pre-trained model and a sample vector and a sample weight corresponding to the pre-trained model according to the first training sample set; the pre-trained model includes a network layer and a fully connected layer; wherein the network layer is used to determine the sample vector and the sample weight corresponding to the pre-trained model, and the fully connected layer is implemented based on a first type of sorting algorithm; the first type of sorting algorithm is a sorting algorithm based on a single sample; According to the interaction depth information of each interactive book in the first training sample set, each interactive book in the first training sample set is combined into a plurality of training sample groups, and each training sample group is labeled according to the comparison result of the interaction depth information of at least two training samples contained in each training sample group, so as to obtain a second training sample set; wherein the second training sample set is determined according to a sample pair or a sample list, and one training sample group contains at least two training samples; when the training sample group is a training sample pair, if the interaction depth value of the preceding training sample is greater than the interaction depth value of the succeeding training sample, the labeling result of the training sample pair is positive; if the interaction depth value of the succeeding training sample is greater than the interaction depth value of the preceding training sample, the labeling result of the training sample pair is negative; By using the second training sample set and sharing the sample vectors and sample weights corresponding to the pre-trained model at the network layer, the pre-trained model is fine-tuned at the fully connected layer using a second type of sorting algorithm, and the fine-tuned pre-trained model is used as the book sorting push model; wherein the second type of sorting algorithm is a sorting algorithm based on sample pairs or sample lists.
6. The electronic device according to claim 5, in, The first type of sorting algorithms includes: Pointwise algorithm; and the second type of sorting algorithms includes: Pairwise algorithm and / or Listwise algorithm.
7. The electronic device according to any one of claims 5 to 6, in, The interaction period is determined by a start time point and an end time point; and the interaction depth information of each interactive book is determined according to the interaction duration and / or interaction type corresponding to each interactive book.
8. An electronic device, include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the following operations: implement a book sorting and pushing method based on the book sorting and pushing model described in any one of claims 1-3.
9. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Intelligent book list recommendation method, server and storage medium
CN110135889A
Book recommendation method and apparatus
CN110413888A
Book recommendation sorting model training method, computing equipment and storage medium
CN111125543A
Learning with transformed data
US20170337487A1
