Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiment of the present invention, a method for pushing a resource is provided. Alternatively, the resource pushing method can be applied, but not limited to, in the application environment shown in fig. 1. As shown in fig. 1, a target application is running on a terminal 102, and a user can browse resources by using the target application. The terminal 102 collects the historical resources browsed by the user in the first time period (the historical resources browsed by the target application), and transmits the collected historical resources to the server 106 through the network 104.
The server 106 receives the history resource sent by the terminal 102; acquiring a historical resource vector corresponding to historical resources, wherein the historical resource vector is obtained by inputting the historical resources into a target vector model, the target vector model is obtained by training an initial vector model by using a plurality of training samples, each training sample in the plurality of training samples comprises a plurality of sample resources of different types browsed by a training object in a second time period, and the similarity between the plurality of sample resource vectors output by the target vector model and corresponding to the plurality of sample resources in the same training sample is higher than a first threshold; acquiring resources to be pushed from a target resource set, wherein each target resource in the target resource set belongs to a plurality of training samples, and the similarity between a resource vector to be pushed, which is output by a target vector model and corresponds to the resources to be pushed, and a historical resource vector is higher than a second threshold; and pushing the resource to be pushed to the terminal 102.
After the terminal 102 receives the resource (resource to be pushed) pushed by the server 106, the received pushed resource is displayed through the target application.
Optionally, there may be a plurality of resources to be pushed, which may be sorted according to the similarity with the historical resources, and displayed according to the sorting result.
Optionally, in this embodiment, the terminal may include, but is not limited to, at least one of the following: mobile phones, computers (tablet computers, notebook computers, desktop computers), and the like. Such networks may include, but are not limited to: a wired network, a wireless network, wherein the wired network comprises: a local area network, a metropolitan area network, and a wide area network, the wireless network comprising: bluetooth, WIFI, and other networks that enable wireless communication. The weather server may include, but is not limited to, at least one of: PCs and other devices used for computing services. The above is only an example, and the present embodiment is not limited to this.
Optionally, in this embodiment, as an optional implementation manner, as shown in fig. 2, the resource pushing method may include:
s202, acquiring historical resources of the target object, wherein the historical resources are resources browsed by the target object in a first time period;
s204, obtaining a historical resource vector corresponding to the historical resource, wherein the historical resource vector is obtained by inputting the historical resource into a target vector model, the target vector model is obtained by training an initial vector model by using a plurality of training samples, each training sample in the plurality of training samples comprises a plurality of sample resources of different types browsed by a training object in a second time period, and the similarity between the sample resource vectors output by the target vector model and corresponding to the sample resources in the same training sample is higher than a first threshold value;
s206, acquiring resources to be pushed from a target resource set, wherein each target resource in the target resource set belongs to a plurality of training samples, and the similarity between a resource vector to be pushed, which is output by a target vector model and corresponds to the resources to be pushed, and a historical resource vector is higher than a second threshold;
and S208, pushing the resource to be pushed to the target object.
Alternatively, the resource pushing method may be, but is not limited to, a process of recommending news resources, article resources, short video resources, and the like to the user through a client of the application. For example, in news applications, or in short video applications. The pushing method of the resource may be performed by a server, and the server may include one or more servers.
For example, taking a news application as an example, the news application collects the first news (which may include one or more news) recently browsed by the user in the news application on the terminal, and sends the collected first news to the background server. The background server obtains a first resource vector (historical resource vector) corresponding to the first news, and obtains news to be pushed from the target resource set, wherein the similarity between a second resource vector (resource vector to be pushed) corresponding to the news to be pushed and the first resource vector is higher than a second threshold, the news to be pushed is pushed to a news application, and the news to be pushed is recommended to a user by the news application (for example, as shown in fig. 3).
The method for pushing the resources is described below with reference to fig. 2.
In step S202, a history resource of the target object is acquired, wherein the history resource is a resource browsed by the target object in a first time period.
The target object user may be a target user of the target application and may be identified by identification information for uniquely identifying the target object. The identification information may be a login account, an account of the associated application, a login name (unique name), a terminal number, and the like of the target application.
In the process that a user browses resources by using a client of a target application running on a terminal device, the terminal device may collect target resource information (which may be used to represent historical resources) of resources (historical resources) browsed by the user in a first time period by using the client, and transmit the collected target resource information to a server, where the target information may include target identification information (e.g., a resource number) used to uniquely identify the historical resources, may also include a full text of the resources, and the like. And collecting the target information.
The first time period may be a predefined time period (for example, one minute, two minutes, five minutes, and the like before the current time), or may be a time period determined according to a predetermined rule (for example, if the historical resource is one resource recently browsed by the target object, the first time period is a time period including a time point of browsing the latest resource, and if the historical resource is N resources recently browsed by the target object, the first time period is a time period including a time point of browsing the earliest resource among the latest N resources).
For example, a terminal running a news application may collect one or more news that a target user has recently browsed using the news application, and send a resource identification (for uniquely identifying the resource, e.g., a news number) associated with the collected one or more news to a background server of the news application.
After receiving the history resource sent by the terminal device, the server may acquire the history resource. The server may be one server, a server cluster formed by a plurality of servers, or a cloud server, and a specific form of the server may be set according to needs, which is not specifically limited in this embodiment.
In step S204, a historical resource vector corresponding to the historical resource is obtained, where the historical resource vector is obtained by inputting the historical resource into a target vector model, the target vector model is obtained by training an initial vector model using a plurality of training samples to obtain a vector model, each training sample in the plurality of training samples includes a plurality of sample resources of different types that a training object browses in a second time period, and a similarity between a plurality of sample resource vectors output by the target vector model and corresponding to a plurality of sample resources in the same training sample is higher than a first threshold.
After obtaining the historical resource of the target object, the server may obtain a historical resource vector corresponding to the historical resource, where the historical resource vector is obtained by inputting the historical resource into the target vector model.
Optionally, in this embodiment, before obtaining the historical resources of the target object, a plurality of training samples may be obtained; and adjusting the model parameters of the initial vector model by using a plurality of training samples to obtain a target vector model.
The target vector model is obtained by training the initial vector model by using a plurality of training samples. The target vector model may be pre-trained and updated periodically. The update period of the target vector model may be determined according to the update frequency of the resource and the computing power of the server. For example, for a resource whose update frequency is high (e.g., news, short videos, etc.), the update period may be set to one day, 12 hours, 6 hours, 2 hours, or the like. In the case of a server with sufficient computing power, the update period can also be set to half an hour, and even quasi-real-time updates can be made (e.g., triggering an update if there is a new resource uploaded). For another example, for a resource (e.g., a paper) with low update frequency, the update period may be set to half a month, one month, multiple months, one year, or the like.
To obtain the target vector model, a plurality of training samples may be obtained first. Each of the plurality of training samples contains a plurality of sample resources of a different type that the training subject browses during the second time period.
Optionally, in this embodiment, acquiring a plurality of training samples may include: obtaining a plurality of sample resources browsed by each training object in a plurality of training objects in a second time period; dividing the plurality of sample resources browsed by each training object in the second time period into a plurality of sample resource sets according to the type of the plurality of sample resources browsed by each training object in the second time period, wherein the sample resources contained in each sample resource set in the plurality of sample resource sets belong to one type; and respectively extracting at least one sample resource from each sample resource set of the plurality of sample resource sets to combine to obtain one training sample in the plurality of training samples.
Each of the training objects may be an object for resource browsing using a target application client. E.g. all or part of the users of the client of the target application. For each training subject, the second time period belongs to a time period (target time period) between times at which the sample resource of the training subject is acquired. To reduce the complexity of the calculation, the target time period may be divided, for example, at predetermined time intervals (for example, every half hour), and each divided time period is used as a second time period.
Each training sample contains a plurality of sample resources of different types that are browsed by a training subject during a second time period. The plurality of sample resources in the same training sample correspond to the same training object, and different training samples may correspond to the same training object or different training objects. The plurality of sample objects in the same training sample may correspond to different types, the types corresponding to each sample object in the same training sample may be different, or at least two sample objects in the same training sample may correspond to different types.
For each training subject, a plurality of sample resources viewed by the training subject over a second time period may be obtained. For the case that there are multiple second time periods, multiple sample resources browsed by the training subject in the second time period may be obtained respectively.
After obtaining the plurality of sample resources browsed by each training object in a second time period, the plurality of sample resources may be divided into a plurality of sample resource sets according to types to which the plurality of sample resources belong, where the sample resources included in each of the plurality of sample resource sets all belong to one type.
The type to which the sample resource belongs may be determined according to the resource label or the resource granularity. The type set may be a primary classification to which the resource belongs, or a secondary classification, or may be other types in which the resource type may be specified and each type may include a plurality of resources.
It should be noted that, if a plurality of sample resources that are only browsed by a training subject in a second time period belong to the same type, the plurality of sample resources that are browsed by the training subject in the second time period may be removed, without considering browsing data of the training subject in the second time period.
After obtaining a plurality of sample resource sets, at least one sample resource may be respectively extracted from each sample resource set for combination, and the obtained set may be used as a training sample.
When the sample resource is extracted, one sample resource may be extracted from each sample resource set, or the number of sample resources extracted from each sample resource set may be determined according to the number of sample resources included (for example, the more sample resources included in a sample resource set, the more sample resources are sequentially extracted), or the number of sample resources extracted from each sample resource set may be determined according to the number of sample resource sets (the fewer sample resource sets, the more sample resources are extracted from each sample resource set).
It should be noted that, for a second time period of a training subject, the number of training samples obtained may be a product of combinations of at least two sample resources that can be extracted from each training sample set.
For example, after dividing a plurality of sample resources browsed by the training subject a in the second time period, 3 sample resource sets are obtained: resource set 1, containing 5 sample resources; resource set 2, containing 6 sample resources; resource set 3, containing 3 sample resources. If one sample resource is extracted from each sample resource set, the number of the obtained training samples is as follows: 5 × 6 × 3 ═ 90. If one sample resource is extracted from each sample resource set, the number of the obtained training samples is:
if one sample resource is extracted from the resource set 1 and the resource set 3, and 2 sample resources are extracted from the resource set 2, the number of the obtained training samples is:
the manner in which the training samples are obtained is described below with reference to specific examples. The clicked articles in a section (time period) of each user can be divided into several different subsets according to different granularities, such as the first-level classification or the second-level classification of the articles, and then one article is extracted from each subset and recombined to form a new sample. As shown in fig. 4, the process of performing the sample reassembly may include the following steps:
step 1, collecting click behavior data of a user, taking a click sequence of the same user in the same section as a sample, and preparing for generating a new sample.
And 2, decomposing each sample generated in the step 1 into a plurality of subsets (combination of a plurality of sample resources) according to different granularities, such as the first-level classification of the article.
And 3, respectively extracting one article from the plurality of subsets generated in the step 2, recombining the articles into new samples, and ensuring that each new sample only covers one article under the same granularity, such as under the primary classification of the same article, so that a plurality of new samples (training samples) are generated after recombination.
After obtaining the plurality of training samples, the model parameters of the initial vector model may be adjusted using the plurality of training samples to obtain the target vector model.
Optionally, in this embodiment, adjusting the model parameters of the initial vector model using a plurality of training samples to obtain the target vector model may include: sequentially inputting a plurality of sample resources in each training sample in a plurality of training samples into an initial vector model to obtain a resource vector output by the initial vector model; and adjusting the model parameters of the initial vector model according to the vector similarity between the resource vectors of at least two adjacent sample resources output by the initial vector model to obtain the target vector model.
The initial vector model may assign, to the sample resource, a vector for representing a target dimension of the sample resource according to a sequence of sample resource input in the training sample, and a target function of the initial vector model may be: the similarity between a plurality of sample resource vectors corresponding to a plurality of sample resources in the same training sample is higher than a first threshold. The initial vector model may be: word2vec or other models.
It should be noted that, the initial vector model (target vector model) considers the input sample resources as a whole, and does not need to analyze information (e.g., meaning of words in text resources and content of images in video resources) included in each sample resource, and assigns resource vectors to the sample resources only according to the sequence of input of the sample resources.
When the initial vector model is trained by using a plurality of training samples, for each training sample, a plurality of sample resources in the training sample may be sequentially input to the initial vector model, so as to obtain a resource vector output by the initial vector model.
Because the initial vector model can acquire less relevance information among the sample resources, the output resource vector has a weak capability of representing the sample resources. Therefore, the model parameters of the initial vector model can be adjusted according to the vector similarity between the resource vectors of at least two adjacent sample resources output by the initial vector model, so as to obtain the target vector model.
Adjacent sample resources belong to the same training sample. For a first sample resource in a first training sample, the initial vector model may randomly output a vector of a target dimension (a first vector, e.g., a 200-dimensional vector) for the sample resource. For a second sample resource in the first training sample, the initial vector model may output a vector of a target dimension (a second vector) for the sample resource according to the first vector, so that a similarity between the first vector and the second vector is higher than a first threshold (a preset similarity threshold, which may be defined as needed).
Similarly, by adjusting the model parameters of the initial vector model: and adjusting the initial vector model to be the resource vector allocated to the sample resource allocated with the resource vector, and determining the resource vector allocated to the sample resource not allocated with the resource vector by the initial vector model, so that the similarity between a plurality of sample resource vectors output by the adjusted initial vector model and corresponding to a plurality of sample resources in the same training sample is higher than a first threshold.
For example, the initial vector model is an initial word2vec model (word to vector model), each sample resource in a training sample is used as a word, one training sample is used as a sentence, the training samples are input into the initial word2vec model, and the initial word2vec model is trained to obtain a target word2vec model.
After the target vector model is obtained, a history resource vector of the history resource can be obtained by using the target vector model. There are various ways to obtain the historical resource vector using the target resource vector.
As an optional implementation manner, after the history resources are obtained, the history resources may be directly input to the target vector model, and a vector output by the target vector model is a history resource vector.
As another optional implementation manner, the historical resource vector may be obtained from a stored target resource vector set according to a matching relationship between a resource and a resource vector, where the target resource vector set includes target resource vectors obtained after target resources in the target resource set are input to the target vector model.
The matching relationship between the resource and the resource vector may be preserved in advance. For example, after the model parameters of the initial vector model are adjusted by using a plurality of training samples to obtain a target vector model, each target resource in the target resource set may be input to the target vector model, so as to obtain a target resource vector set corresponding to the target resource set, where the target resources in the target resource set correspond to the target resource vectors in the target resource vector set one to one.
The same sample resource may be included in at least one training sample. All sample resources or part of sample resources contained in a plurality of training samples can be used as a target resource set, and each target resource in the target sample set is input into a target vector model to obtain a target resource vector corresponding to each target resource, so that a target resource vector set is obtained.
After the target vector model is obtained, the resource vector corresponding to each sample resource is fixed or may be unique. All sample resources contained in a plurality of training samples can be respectively input into the target vector model, and a unique resource vector corresponding to each sample resource is obtained.
For example, the number of all sample resources is 500, and 500 sample resources are numbered as follows: 1-500, obtaining 1 ten thousand training samples according to browsing operation of a training object, wherein sample resources numbered 50 belong to 30 training samples, after an initial word2vec model is trained by using the training samples to obtain a target word2vec model, 500 sample resources (a target resource set comprises all 500 sample resources) can be respectively input into the target word2vec model to obtain 500 resource vectors (a target resource vector set), wherein the sample resources numbered 50 correspond to one resource vector.
The obtained target resource vector set can be used as a vector pool for obtaining subsequent historical resource vectors and resources to be pushed.
Optionally, in this embodiment, acquiring a history resource vector corresponding to a history resource may include: and acquiring historical resource vectors from a stored target resource vector set according to the matching relation between the resources and the resource vectors, wherein the target resource vector set comprises target resource vectors obtained after the target resources in the target resource set are input into a target vector model.
For the historical resources browsed by the target object, the server can acquire the historical resource vector corresponding to the historical resources from the target resource vector set according to the matching relationship between the pre-stored resources and the resource vectors.
The historical resource may have one resource or may have a plurality of resources. When there are a plurality of history resources, a history resource vector corresponding to each history resource may be acquired.
In step S206, resources to be pushed are obtained from a target resource set, where each target resource in the target resource set belongs to a plurality of training samples, and a similarity between a resource vector to be pushed, which is output by the target vector model and corresponds to the resources to be pushed, and a history resource vector is higher than a second threshold.
After the history resource vector is obtained, the vector similarity between the history resource vector and the resource vector (target resource vector) corresponding to each target resource in the target resource set can be respectively calculated, and one or more target resources with the vector similarity higher than a second threshold (similarity threshold) with the history resource are obtained as the resources to be pushed.
When determining the resources to be pushed, all target resources whose vector similarity with the historical resources is higher than the second threshold may be obtained as the resources to be pushed, or some target resources whose vector similarity with the historical resources is higher than the second threshold may be obtained as the resources to be pushed. In the case that the resource to be pushed is the part of the target resource, other conditions for determining the resource to be pushed may be set, and may include but are not limited to at least one of the following: a quantity threshold (e.g., up to 10), a type threshold (e.g., comprising at least N resources of a different type than the historical resources).
After the resources to be pushed meeting the similarity condition (higher than the second threshold) and the quantity condition (quantity threshold) are obtained, vector similarity with other target resources is not calculated, and the obtained resources to be pushed are directly pushed to the target object.
The number of the historical resources can be one or more, and when one historical resource is used, the resource to be pushed corresponding to the historical resource can be pushed to the target object.
Optionally, in this embodiment, acquiring the resource to be pushed from the target resource set may include: and under the condition that the number of the historical resources is multiple, respectively acquiring the resources to be pushed corresponding to each historical resource in the multiple historical resources from the target resource set.
When there are a plurality of historical resources, the resources to be pushed can be obtained in the same manner. The server can push all the acquired resources to be pushed, or select a part of the resources to be pushed from all the resources to be pushed to push.
For example, a predetermined number of resources to be pushed may be selected from the resources to be pushed corresponding to the respective historical resources, and the selected resources to be pushed may be pushed. Or, for the resources to be pushed (resources to be selected) corresponding to the historical resources, calculating the sum of the vector similarity of the resources to be selected and the historical resources, sorting the resources to be selected, and selecting a predetermined number of the resources to be selected from the sorted resources to be selected as the resources to be pushed.
When the number of the resources to be pushed is multiple, the resources to be pushed can be sequenced according to the vector similarity between the resources to be pushed and the historical resources, and the sequenced resources to be pushed are pushed to the target object.
In step S208, the resource to be pushed is pushed to the target object.
And the server can push the resource to be pushed to the user through the client corresponding to the target object. The server can send the resources to be pushed to the client corresponding to the target object, and the client displays the link information of the resources to be pushed on a display interface of the client, so that the resources to be pushed are pushed.
It should be noted that, when the target vector model is a word2vec model or a similar model, the historical resource needs to belong to at least one of the training samples to obtain the historical resource vector corresponding to the historical resource (the historical resource that does not belong to the training samples may be regarded as an unregistered word). In this case, the resource to be pushed may be determined in other manners, for example, a search is performed according to information included in the resource to obtain the resource to be pushed.
According to the embodiment, each training sample used for training the initial vector model comprises a plurality of sample resources of different types browsed by a training object in the second time period, and the similarity between the plurality of sample resource vectors corresponding to the plurality of sample resources in the same training sample is higher than the first threshold, so that the acquired resources to be pushed not only can accord with the preference of a user, but also can be of multiple types, the problem that the resources pushed to the user by a resource pushing method in the related technology are too single is solved, the types of the resources pushed to the user are enriched, and the satisfaction degree of the user on the pushed resources is improved.
As an optional implementation, before obtaining the historical resources of the target object, the method further includes:
s1, obtaining a plurality of training samples;
and S2, adjusting the model parameters of the initial vector model by using a plurality of training samples to obtain a target vector model.
According to the embodiment, the target vector model can be obtained by obtaining the plurality of training samples and using the plurality of training samples to train the initial vector model, so that the historical resources are conveniently processed.
As an alternative embodiment, obtaining a plurality of training samples comprises:
s11, obtaining a plurality of sample resources browsed by each training object in a plurality of training objects in a second time period;
s12, dividing the plurality of sample resources browsed by each training object in the second time period into a plurality of sample resource sets according to the type of the plurality of sample resources browsed by each training object in the second time period, wherein the sample resources contained in each sample resource set in the plurality of sample resource sets belong to one type;
and S13, respectively extracting at least one sample resource from each sample resource set of the multiple sample resource sets to combine, and obtaining one training sample of the multiple training samples.
By the embodiment, the training sample is obtained by respectively extracting at least one sample resource from each sample resource set of the multiple sample resource sets and combining the at least one sample resource, so that the relevance among the training resources and the diversity of the training resources can be ensured.
As an alternative embodiment, the adjusting the model parameters of the initial vector model using a plurality of training samples to obtain the target vector model includes:
s21, sequentially inputting a plurality of sample resources in each training sample in a plurality of training samples into the initial vector model, and obtaining a resource vector output by the initial vector model;
and S22, adjusting the model parameters of the initial vector model according to the vector similarity between the resource vectors of at least two adjacent sample resources output by the initial vector model to obtain the target vector model.
By the embodiment, the model parameters of the initial vector model are adjusted according to the vector similarity between the resource vectors of at least two adjacent sample resources in the same training sample, so that the capability of representing the sample resources by the vector resource vectors can be provided, and the satisfaction degree of a user on the pushed resources is further improved.
As an alternative embodiment, after the model parameter adjustment of the initial vector model using a plurality of training samples to obtain the target vector model, the method further includes:
and S3, respectively inputting each target resource in the target resource set into the target vector model to obtain a target resource vector set corresponding to the target resource set, wherein the target resources in the target resource set correspond to the target resource vectors in the target resource vector set one by one.
By the embodiment, the target resource vectors corresponding to the target resources are obtained in advance by using the target vector model, so that the efficiency of obtaining the resources to be pushed can be improved.
As an optional implementation, obtaining the history resource vector corresponding to the history resource comprises:
s1, acquiring historical resource vectors from the stored target resource vector set according to the matching relation between the resources and the resource vectors, wherein the target resource vector set comprises target resource vectors obtained after the target resources in the target resource set are input into the target vector model.
According to the embodiment, the history resource vector corresponding to the history resource is obtained through the matching relationship between the resource and the resource vector, so that the speed of obtaining the history resource vector can be improved, and the efficiency of obtaining the resource to be pushed is improved.
As an optional implementation, the obtaining the resource to be pushed from the target resource set includes:
and S1, when the number of the historical resources is multiple, respectively acquiring the resources to be pushed corresponding to each historical resource in the multiple historical resources from the target resource set.
Through the embodiment, the resources to be pushed corresponding to the historical resources are respectively obtained, so that the obtaining process of the resources to be pushed can be simplified, and the efficiency of obtaining the resources to be pushed is improved.
The following describes a pushing method of the above resources with reference to an alternative example. The word2vec model used in this example is a user interest transfer prediction model based on a user click sequence. The method comprises the steps of dividing the clicked articles in a section of a user into a plurality of different subsets according to different granularities, such as the first-level classification or the second-level classification of the articles, and then extracting one article from each subset to recombine to form a new sample. Inputting the recombined sample into a word2vec or other models for training.
When recommending the article vector (historical resource vector) recently consumed by the user, the predicted next article is an interest development trend and is not an article similar to the history, so that the recommended content range is widened, and predictability is brought.
As shown in fig. 5 and fig. 6, the resource pushing method in this example may include the following procedures:
s602, collecting click behavior data of a user;
s604, disassembling and recombining the click sequence sample of the user;
s606, inputting the recombined new generation sample into a model for training to obtain article vector representation;
and S608, associating the user click history with the article vector pool, and making online recommendation.
Compared with the traditional click sequence mining mode, the resource pushing method in the example can obviously improve the satisfaction degree of the user on recommendation and enrich the ecology of the recommendation system (as shown in fig. 7).
In addition, the result vector of the model training in this example can be used to perform article List recommendation (List recommendation), and the next, next … is continuously searched by jumping between articles, so as to predict the next possible interest development article List.
The target vector model used in this example is a word2vec model, and may also be trained by using other models such as FPGrowth, and the training modes of the two models are the same, which is not described herein again. In the process of re-disassembling the user click sequence, disassembling is performed according to different article granularities, which may be article primary classification, article secondary classification, or topic granularity, and other granularities. In this example, a news recommendation scenario is taken as an example, and other recommendation scenarios may also use the resource push method.
By the method, the predictability of the user interest transfer is achieved by mining the user click sequence, the satisfaction degree of the user on recommendation can be improved, and the ecology of a recommendation system is enriched.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
According to another aspect of the embodiments of the present invention, there is also provided a resource pushing device, where the device is used to implement the foregoing embodiments and preferred embodiments, and details are not repeated for what has been described. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
The resource pushing device in this embodiment may be applied to a server as shown in fig. 8, or may be located in a server as shown in fig. 8. As shown in fig. 9, the apparatus includes:
(1) a first obtaining module 902, configured to obtain a historical resource of a target object, where the historical resource is a resource browsed by the target object in a first time period;
(2) a second obtaining module 904, configured to obtain a historical resource vector corresponding to a historical resource, where the historical resource vector is a vector obtained by inputting the historical resource into a target vector model, the target vector model is a vector model obtained by training an initial vector model using a plurality of training samples, each training sample in the plurality of training samples includes a plurality of sample resources of different types that are browsed by a training object in a second time period, and a similarity between a plurality of sample resource vectors output by the target vector model and corresponding to a plurality of sample resources in the same training sample is higher than a first threshold;
(3) a third obtaining module 906, configured to obtain resources to be pushed from a target resource set, where each target resource in the target resource set belongs to multiple training samples, and a similarity between a resource vector to be pushed, which is output by a target vector model and corresponds to the resource to be pushed, and a historical resource vector is higher than a second threshold;
(4) a pushing module 908, configured to push the resource to be pushed to the target object.
Alternatively, the pushing device of the resource may be, but is not limited to, a process of recommending news resources, article resources, short video resources, and the like to the user through a client of the application. For example, in news applications, or in short video applications. The pushing means of the resources may be performed by a server, which may comprise one or more servers.
Alternatively, the first obtaining module 902 may be configured to perform the aforementioned step S202, the second obtaining module 904 may be configured to perform the aforementioned step S204, the third obtaining module 906 may be configured to perform the aforementioned step S206, and the pushing module 908 may be configured to perform the aforementioned step S208.
According to the embodiment, each training sample used for training the initial vector model comprises a plurality of sample resources of different types browsed by a training object in the second time period, and the similarity between the plurality of sample resource vectors corresponding to the plurality of sample resources in the same training sample is higher than the first threshold, so that the acquired resources to be pushed not only can accord with the preference of a user, but also can be of multiple types, the problem that the resources pushed to the user by a resource pushing method in the related technology are too single is solved, the types of the resources pushed to the user are enriched, and the satisfaction degree of the user on the pushed resources is improved.
As an alternative embodiment, the above apparatus further comprises:
(1) the fourth acquisition module is used for acquiring a plurality of training samples before acquiring the historical resources of the target object;
(2) and the adjusting module is used for adjusting the model parameters of the initial vector model by using a plurality of training samples to obtain a target vector model.
According to the embodiment, the target vector model can be obtained by obtaining the plurality of training samples and using the plurality of training samples to train the initial vector model, so that the historical resources are conveniently processed.
As an alternative embodiment, the fourth obtaining module includes:
(1) the first acquisition unit is used for acquiring a plurality of sample resources browsed by each training object in a plurality of training objects in a second time period;
(2) the dividing unit is used for dividing the plurality of sample resources browsed by each training object in the second time period into a plurality of sample resource sets according to the type of the plurality of sample resources browsed by each training object in the second time period, wherein the sample resources contained in each sample resource set in the plurality of sample resource sets belong to one type;
(3) and the extraction unit is used for respectively extracting at least one sample resource from each sample resource set of the multiple sample resource sets to combine to obtain one training sample in the multiple training samples.
By the embodiment, the training sample is obtained by respectively extracting at least one sample resource from each sample resource set of the multiple sample resource sets and combining the at least one sample resource, so that the relevance among the training resources and the diversity of the training resources can be ensured.
As an alternative embodiment, the adjustment module comprises:
(1) the second obtaining unit is used for sequentially inputting a plurality of sample resources in each training sample in the plurality of training samples into the initial vector model and obtaining a resource vector output by the initial vector model;
(2) and the adjusting unit is used for adjusting the model parameters of the initial vector model according to the vector similarity between the resource vectors of at least two adjacent sample resources output by the initial vector model to obtain the target vector model.
By the embodiment, the model parameters of the initial vector model are adjusted according to the vector similarity between the resource vectors of at least two adjacent sample resources in the same training sample, so that the capability of representing the sample resources by the vector resource vectors can be provided, and the satisfaction degree of a user on the pushed resources is further improved.
As an alternative embodiment, the above apparatus further comprises:
(1) and the input module is used for respectively inputting each target resource in the target resource set into the target vector model after the model parameters of the initial vector model are adjusted by using a plurality of training samples to obtain the target vector model, so as to obtain a target resource vector set corresponding to the target resource set, wherein the target resources in the target resource set correspond to the target resource vectors in the target resource vector set one by one.
By the embodiment, the target resource vectors corresponding to the target resources are obtained in advance by using the target vector model, so that the efficiency of obtaining the resources to be pushed can be improved.
As an alternative embodiment, the first obtaining module includes:
(1) and the third acquisition unit is used for acquiring historical resource vectors from the stored target resource vector set according to the matching relation between the resources and the resource vectors, wherein the target resource vector set comprises target resource vectors obtained after the target resources in the target resource set are input into the target vector model.
According to the embodiment, the history resource vector corresponding to the history resource is obtained through the matching relationship between the resource and the resource vector, so that the speed of obtaining the history resource vector can be improved, and the efficiency of obtaining the resource to be pushed is improved.
As an alternative embodiment, the third obtaining module includes:
(1) and the fourth acquiring unit is used for acquiring the resource to be pushed corresponding to each history resource in the plurality of history resources from the target resource set respectively under the condition that the number of history resources is multiple.
Through the embodiment, the resources to be pushed corresponding to the historical resources are respectively obtained, so that the obtaining process of the resources to be pushed can be simplified, and the efficiency of obtaining the resources to be pushed is improved.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
According to a further aspect of embodiments of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, acquiring historical resources of the target object, wherein the historical resources are resources browsed by the target object in a first time period;
s2, obtaining a historical resource vector corresponding to the historical resource, wherein the historical resource vector is obtained by inputting the historical resource into a target vector model, the target vector model is obtained by training an initial vector model by using a plurality of training samples, each training sample in the plurality of training samples comprises a plurality of sample resources of different types browsed by a training object in a second time period, and the similarity between the sample resource vectors output by the target vector model and corresponding to the sample resources in the same training sample is higher than a first threshold value;
s3, acquiring resources to be pushed from a target resource set, wherein each target resource in the target resource set belongs to a plurality of training samples, and the similarity between a resource vector to be pushed, which is output by a target vector model and corresponds to the resources to be pushed, and a historical resource vector is higher than a second threshold;
and S4, pushing the resource to be pushed to the target object.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device for implementing the pushing method of the resource, as shown in fig. 10, the electronic device includes: processor 1002, memory 1004, transmission 1006, etc. The memory has stored therein a computer program, and the processor is arranged to execute the steps of any of the above method embodiments by means of the computer program.
Optionally, in this embodiment, the electronic apparatus may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, acquiring historical resources of the target object, wherein the historical resources are resources browsed by the target object in a first time period;
s2, obtaining a historical resource vector corresponding to the historical resource, wherein the historical resource vector is obtained by inputting the historical resource into a target vector model, the target vector model is obtained by training an initial vector model by using a plurality of training samples, each training sample in the plurality of training samples comprises a plurality of sample resources of different types browsed by a training object in a second time period, and the similarity between the sample resource vectors output by the target vector model and corresponding to the sample resources in the same training sample is higher than a first threshold value;
s3, acquiring resources to be pushed from a target resource set, wherein each target resource in the target resource set belongs to a plurality of training samples, and the similarity between a resource vector to be pushed, which is output by a target vector model and corresponds to the resources to be pushed, and a historical resource vector is higher than a second threshold;
and S4, pushing the resource to be pushed to the target object.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 10 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 10 is a diagram illustrating a structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 10, or have a different configuration than shown in FIG. 10.
The memory 1004 may be used to store software programs and modules, such as program instructions/modules corresponding to the resource pushing method and apparatus in the embodiments of the present invention, and the processor 1002 executes various functional applications and data processing by running the software programs and modules stored in the memory 1004, that is, implements the resource pushing method. The memory 1004 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 1004 may further include memory located remotely from the processor 1002, which may be connected to the terminal through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 1006 is used for receiving or transmitting data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 1006 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices so as to communicate with the internet or a local area Network. In one example, the transmission device 1006 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.