CN113742578A - Data recommendation method and device, electronic equipment and storage medium - Google Patents

Data recommendation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113742578A
CN113742578A CN202110929331.3A CN202110929331A CN113742578A CN 113742578 A CN113742578 A CN 113742578A CN 202110929331 A CN202110929331 A CN 202110929331A CN 113742578 A CN113742578 A CN 113742578A
Authority
CN
China
Prior art keywords
recommended
recommendation
user
target
vector
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110929331.3A
Other languages
Chinese (zh)
Inventor
周庭庭
李宇洁
陈鸿翔
罗川江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Netease Cloud Music Technology Co Ltd
Original Assignee
Hangzhou Netease Cloud Music Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Netease Cloud Music Technology Co Ltd filed Critical Hangzhou Netease Cloud Music Technology Co Ltd
Priority to CN202110929331.3A priority Critical patent/CN113742578A/en
Publication of CN113742578A publication Critical patent/CN113742578A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9538Presentation of query results

Abstract

The present disclosure relates to the field of data processing technologies, and in particular, to a data recommendation method, apparatus, electronic device, and storage medium, where user characteristics and recommended object characteristics are obtained, and a first recommendation score between a user and each recommended object is obtained according to the user characteristics and the recommended object characteristics, where the first recommendation score represents a prediction score of a preference of the user for the recommended object; sorting the recommended objects according to the first recommended scores; labeling the sorted recommended objects respectively, and determining target recommended objects in a result set in the labeled recommended objects; and recommending each target recommendation object. In this way, diversity of recommendation results can be ensured.

Description

Data recommendation method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a data recommendation method and apparatus, an electronic device, and a storage medium.
Background
With the development of network technology, data recommendation can be applied to various scenes. For example, a preferred live video may be recommended for the user. Therefore, how to recommend data becomes a problem to be solved urgently.
In the related art, when data recommendation is performed, similarity between data clicked by a user and data clicked historically is generally determined, and data with the highest similarity to the clicked data is determined according to the similarity and is used as recommendation data.
However, only data with high similarity to clicked data can be recommended by the data recommendation method in the related art, which results in that the recommended data are all similar data and the diversity of data recommendation cannot be satisfied.
Disclosure of Invention
The embodiment of the disclosure provides a data recommendation method and device, electronic equipment and a storage medium, so as to meet the diversity of data recommendation.
The specific technical scheme provided by the embodiment of the disclosure is as follows:
a method of data recommendation, comprising:
acquiring user characteristics and various recommended object characteristics, and acquiring first recommended scores between a user and various recommended objects according to the user characteristics and the various recommended object characteristics, wherein the first recommended scores represent predicted scores of the preference degrees of the user for the recommended objects;
sorting the recommended objects according to the first recommended scores;
labeling the sorted recommended objects respectively, and determining target recommended objects in a result set in the labeled recommended objects;
and recommending each target recommendation object.
Optionally, the labeling processing is performed on the sorted recommendation objects respectively, and a target recommendation object in the result set in the recommendation objects after the labeling processing is determined, specifically including:
respectively aiming at each recommendation object, executing the following operations:
determining each attribute label pre-labeled by any one recommendation object and the priority of each attribute label;
determining a target attribute label meeting a preset priority condition from the attribute labels according to the priority of the attribute labels;
and when the target attribute tags are contained in a pre-configured tag library, determining that the recommended object is used as a target recommended object, and adding the target recommended object to a result set, wherein the tag library contains the attribute tags.
Optionally, the determining a target recommended object located in a result set in the recommended objects after the tagging processing further includes:
when the target attribute label is not contained in the label library, adding the recommendation object to a candidate queue;
determining to add each recommended object to the result set and/or the candidate queue, and when the number of target recommended objects in the result set does not reach a first preset value, selecting a certain number of recommended objects from the candidate queue to add to the result set;
and taking the recommended objects in the result set as target recommended objects.
Optionally, before determining each attribute tag pre-labeled to any one object to be recommended and the priority of each attribute tag, the method further includes:
determining whether the recommended object has an attribute tag;
when the recommendation object is determined to have no attribute label, the recommendation object is added to the candidate queue.
Optionally, adding the target recommendation object to a result set, further includes:
respectively determining whether the number of target recommended objects corresponding to each target attribute label reaches a second preset value;
and deleting the target attribute tag from the tag library when the number of the target recommended objects corresponding to any one target attribute tag is determined to reach a second preset value.
Optionally, obtaining a first recommendation score between the user and each recommended object according to the user characteristic and the characteristics of each recommended object specifically includes:
and predicting and obtaining a first recommendation score between the user and the recommendation object by taking the user characteristics and any one recommendation object characteristic as input parameters based on the trained first scoring model.
Optionally, the predicting to obtain the first recommendation score between the user and the recommended object specifically includes:
generating a significant feature of the recommended object according to the continuous feature and the discrete feature of the recommended object in the recommended object features, and converting the significant feature into a significant vector;
converting the recommended object features into recommended object vectors, and converting the user features into user vectors;
calculating a cross vector between the recommended object vector and the user vector;
and determining a first recommendation score between the user and the recommended object according to the significant vector, the user vector, the recommended object vector, the cross vector and a preset weight vector.
Optionally, when training the first scoring model, the method further includes:
acquiring a training sample set and corresponding recommended score labels, wherein the training sample set comprises user sample characteristics and recommended object sample characteristics;
inputting any user sample characteristic and any recommended object sample characteristic into an initial first scoring model, determining a first training score between the user sample and the recommended object sample, adjusting each model parameter of the initial first scoring model according to the first training score and a corresponding recommended score label until a cross entropy loss function of the first scoring model converges, and obtaining the trained first scoring model, wherein the cross entropy loss function is determined according to each user sample characteristic, each recommended object sample characteristic and the corresponding recommended score label.
Optionally, determining a first training score between the user sample and the recommended object sample specifically includes:
inputting the user sample characteristics into a first conversion network to obtain a user sample vector, and inputting the recommended object sample characteristics into a second conversion network to obtain a recommended object sample vector;
inputting continuous features and discrete features of recommended object samples in the recommended object sample features into a third conversion network, generating sample significant features corresponding to the recommended object samples, and converting the sample significant features into sample significant vectors;
performing cross calculation on the user sample vector and the recommended object sample vector to obtain a sample cross vector;
splicing the sample significant vector, the user sample vector, the recommended object sample vector and the sample cross vector to obtain a spliced vector;
and performing inner product processing on the splicing vector and a preset weight vector, and obtaining a first training score after activation function processing.
Optionally, recommending each target recommendation object, specifically including:
respectively aiming at each target recommendation object in the result set, based on a trained second scoring model, and taking recommendation object characteristics corresponding to any target recommendation object and the user characteristics as input parameters, determining a second recommendation score between the user and the target recommendation object;
and selecting a plurality of preset target recommendation objects for recommendation according to the second recommendation scores.
Optionally, the second scoring model includes a user sub-network, a recommendation object sub-network, and a second score conversion function, and determines a second recommendation score between the user and the target recommendation object, which specifically includes:
inputting the user characteristics of the user and the recommendation object characteristics of the target recommendation object into the user sub-network, and determining a first inner product;
inputting the recommended object feature corresponding to any one of the target recommended objects into the recommended object sub-network, and determining a second inner product between the recommended object feature of the target recommended object and the recommended object features of other target recommended objects;
and inputting the first inner product and the second inner product into the second score conversion function, and determining a second recommendation score between the user and the target recommendation object.
Optionally, when training the second scoring model, the method further includes:
and performing iterative training on an initial second scoring model respectively aiming at the user sample characteristics, the recommended object sample characteristics and the corresponding recommended score labels, adjusting model parameters of the initial second scoring model until the cross entropy loss of the second scoring model converges, and obtaining the trained second scoring model, wherein the cross entropy loss function is determined according to the user characteristics, the recommended object sample characteristics and the corresponding recommended score labels.
A data recommendation device comprising:
the first scoring module is used for acquiring user characteristics and various recommended object characteristics and acquiring first recommended scores between a user and various recommended objects according to the user characteristics and the various recommended object characteristics, wherein the first recommended scores represent predicted scores of the preference degrees of the user for the recommended objects;
the sorting module is used for sorting the recommended objects according to the first recommended scores;
the processing module is used for respectively performing tagging processing on the sorted recommended objects and determining a target recommended object in a result set in the tagged recommended objects;
and the recommending module is used for recommending each target recommending object.
Optionally, the processing module is specifically configured to:
respectively aiming at each recommendation object, executing the following operations:
determining each attribute label pre-labeled by any one recommendation object and the priority of each attribute label;
determining a target attribute label meeting a preset priority condition from the attribute labels according to the priority of the attribute labels;
and when the target attribute tags are contained in a pre-configured tag library, determining that the recommended object is used as a target recommended object, and adding the target recommended object to a result set, wherein the tag library contains the attribute tags.
Optionally, when determining a target recommended object in the result set among the recommended objects subjected to tagging, the processing module is further configured to:
when the target attribute label is not contained in the label library, adding the recommendation object to a candidate queue;
determining to add each recommended object to the result set and/or the candidate queue, and when the number of target recommended objects in the result set does not reach a first preset value, selecting a certain number of recommended objects from the candidate queue to add to the result set;
and taking the recommended objects in the result set as target recommended objects.
Optionally, before determining each attribute tag pre-labeled to any one object to be recommended and the priority of each attribute tag, the processing module is further configured to:
determining whether the recommended object has an attribute tag;
when the recommendation object is determined to have no attribute label, the recommendation object is added to the candidate queue.
Optionally, when the target recommendation object is added to the result set, the processing module is further configured to:
respectively determining whether the number of target recommended objects corresponding to each target attribute label reaches a second preset value;
and deleting the target attribute tag from the tag library when the number of the target recommended objects corresponding to any one target attribute tag is determined to reach a second preset value.
Optionally, when obtaining a first recommendation score between the user and each recommended object according to the user characteristic and the characteristics of each recommended object, the first scoring module is specifically configured to:
and predicting and obtaining a first recommendation score between the user and the recommendation object by taking the user characteristics and any one recommendation object characteristic as input parameters based on the trained first scoring model.
Optionally, when the first recommendation score between the user and the recommended object is obtained in a prediction mode, the first scoring module is specifically configured to:
generating a significant feature of the recommended object according to the continuous feature and the discrete feature of the recommended object in the recommended object features, and converting the significant feature into a significant vector;
converting the recommended object features into recommended object vectors, and converting the user features into user vectors;
calculating a cross vector between the recommended object vector and the user vector;
and determining a first recommendation score between the user and the recommended object according to the significant vector, the user vector, the recommended object vector, the cross vector and a preset weight vector.
Optionally, when training the first scoring model, the method further includes:
the acquisition module is used for acquiring a training sample set and corresponding recommended score labels, wherein the training sample set comprises user sample characteristics and recommended object sample characteristics;
the first training module is used for inputting any user sample characteristic and any recommended object sample characteristic into an initial first scoring model, determining a first training score between the user sample and the recommended object sample, adjusting each model parameter of the initial first scoring model according to the first training score and a corresponding recommended score label until a cross entropy loss function of the first scoring model converges, and obtaining the trained first scoring model, wherein the cross entropy loss function is determined according to each user sample characteristic, each recommended object sample characteristic and a corresponding recommended score label.
Optionally, when determining the first training score between the user sample and the recommended object sample, the first training module is specifically configured to:
inputting the user sample characteristics into a first conversion network to obtain a user sample vector, and inputting the recommended object sample characteristics into a second conversion network to obtain a recommended object sample vector;
inputting continuous features and discrete features of recommended object samples in the recommended object sample features into a third conversion network, generating sample significant features corresponding to the recommended object samples, and converting the sample significant features into sample significant vectors;
performing cross calculation on the user sample vector and the recommended object sample vector to obtain a sample cross vector;
splicing the sample significant vector, the user sample vector, the recommended object sample vector and the sample cross vector to obtain a spliced vector;
and performing inner product processing on the splicing vector and a preset weight vector, and obtaining a first training score after activation function processing.
Optionally, each target recommendation object is recommended, and the recommendation module is specifically configured to:
respectively aiming at each target recommendation object in the result set, based on a trained second scoring model, and taking recommendation object characteristics corresponding to any target recommendation object and the user characteristics as input parameters, determining a second recommendation score between the user and the target recommendation object;
and selecting a plurality of preset target recommendation objects for recommendation according to the second recommendation scores.
Optionally, the second scoring model includes a user sub-network, a recommendation object sub-network, and a second score transformation function, and when a second recommendation score between the user and the target recommendation object is determined, the recommendation module is specifically configured to:
inputting the user characteristics of the user and the recommendation object characteristics of the target recommendation object into the user sub-network, and determining a first inner product;
inputting the recommended object feature corresponding to any one of the target recommended objects into the recommended object sub-network, and determining a second inner product between the recommended object feature of the target recommended object and the recommended object features of other target recommended objects;
and inputting the first inner product and the second inner product into the second score conversion function, and determining a second recommendation score between the user and the target recommendation object.
Optionally, when training the second scoring model, the method further includes:
and the second training module is used for performing iterative training on an initial second scoring model respectively aiming at each user sample characteristic, each recommended object sample characteristic and a corresponding recommended score label, adjusting each model parameter of the initial second scoring model until the cross entropy loss of the second scoring model is converged, and obtaining the trained second scoring model, wherein the cross entropy loss function is determined according to each user sample characteristic, each recommended object sample characteristic and the corresponding recommended score label.
An electronic device comprises a memory, a processor and a computer program stored on the memory and operable on the processor, wherein the processor implements the steps of the data recommendation method when executing the program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned data recommendation method.
In the embodiment of the disclosure, user characteristics and characteristics of each recommendation object are obtained, first recommendation scores between a user and each recommendation object are obtained according to the user characteristics and the characteristics of each recommendation object, each recommendation object is sorted according to each first recommendation score, tagging processing is performed on each sorted recommendation object, a target recommendation object located in a result set in each tagged recommendation object is determined, and each target recommendation object is recommended.
Drawings
FIG. 1 is a flow chart of a data recommendation method in an embodiment of the present disclosure;
FIG. 2 is a schematic flow chart illustrating training of a first scoring model according to an embodiment of the present disclosure;
FIG. 3 is an example flow diagram of training in an embodiment of the present disclosure;
FIG. 4 is a schematic flow chart illustrating selection of a target recommendation object in a result set for recommendation in the embodiment of the present disclosure;
FIG. 5 is a schematic flow chart illustrating offline model training in an embodiment of the present disclosure;
FIG. 6 is a schematic flow chart illustrating online application of a model in an embodiment of the present disclosure;
FIG. 7 is a flow chart of determining an attribute tag in an embodiment of the present disclosure;
FIG. 8 is a schematic structural diagram of a data recommendation device in an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of an electronic device in an embodiment of the disclosure.
Detailed Description
The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only some embodiments of the present disclosure, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
The terms "first," "second," and the like in the description and in the claims of the present disclosure 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.
Some terms in the embodiments of the present disclosure are explained below to facilitate understanding by those skilled in the art.
Recommending: the recommendation aims to screen out target recommendation objects preferred by different users from the recommendation objects, so that personalized recommendation is provided for each user.
Recommending an object: the recommendation object is an object to be recommended. For example, the recommended object is an item, a main cast, or the like, which is not limited thereto.
The first recommendation score: the first recommendation score is a predicted score of a user's preference for the recommendation object.
Labeling treatment: labeling processing represents given attribute labels and constraint conditions corresponding to the attribute labels, and processing is carried out on the recommended object according to the attribute labels and the constraint conditions corresponding to the attribute labels. For example, if the recommended object meets the constraint condition of the attribute label "singing", the recommended object is marked as 1 on the attribute label "singing".
Multithread tagging: a plurality of attribute tags and constraint conditions corresponding to the attribute tags are given, and meanwhile tagging processing is carried out on the attribute tags, so that the response speed of the system can be accelerated.
A double-tower model: the method comprises the steps of constructing two independent sub-networks of a user and a recommended object, respectively outputting a user vector and a recommended object vector, and finally calculating the inner product of the user vector and the recommended object vector to obtain a first recommendation score of the user for the recommended object.
A candidate queue: the candidate queue contains recommendation objects without attribute labels and recommendation objects with target attribute labels not contained in the label library.
And the inner product of the vector a and the vector b is a.b ═ a1 ═ b1+ a2 × b2+ … + an × (bn) under the assumption that the vector a and the vector b are respectively represented by a ═ a1, a2, …, an and b ═ b1, b2, …, bn.
Fully connected layers (FC) change linearly from one feature space to another, i.e., in the disclosed embodiment, from a feature to a vector.
Greedy algorithm: greedy algorithm characterization always makes the best choice currently seen when solving a problem. The key of algorithm design is selection of a greedy strategy, a greedy principle is determined, and the greedy principle is guaranteed to be optimal in each advance.
The Sigmod function: is expressed as
Figure BDA0003209884270000101
The output range is (0, 1).
Cross entropy: and the loss function is used for measuring the difference between the prediction result of the model and the real mark, and representing the fitting degree of the model to the training sample, wherein the smaller the value is, the better the fitting effect is.
With the development of network technology, data recommendation can be applied to various scenes, for example, live videos and anchor broadcasts preferred by users can be recommended to the users. Songs, etc. Therefore, how to implement data recommendation becomes a problem to be solved urgently.
In the related technology, firstly, a Swingi2i recall strategy is used, direct modeling is carried out on a user and a recommendation object based on a bipartite graph, and firstly, the similarity between the recommendation objects is calculated off line, so that the recommendation object corresponding to the topK similar to the clicked recommendation object is screened out according to the user history or the real-time clicked recommendation object and is used as recommendation data for recommendation.
However, in the data recommendation method in the related art, the truncation method of topK may cause the recommended object to be more seriously homogenized, for example: in a live broadcast recommendation scene, if the clicked data is the singing anchor, the recommended data is the singing anchor, and for example, in an item recommendation scene, items with low prices are high in click rate compared with items with high prices, so that the recommended items are all low-price items. Therefore, the diversity of data recommendations cannot be satisfied.
In order to solve the above problem, in the embodiment of the present disclosure, a data recommendation method is provided, where user characteristics and characteristics of each recommendation object are obtained, first recommendation scores between a user and each recommendation object are obtained according to the user characteristics and the characteristics of each recommendation object, each recommendation object is ranked according to each first recommendation score, each ranked recommendation object is subjected to tagging processing, target recommendation objects located in a result set in each tagged recommendation object are determined, and each target recommendation object is recommended. In this way, the first recommendation score of each recommendation object is determined, and the sorted recommendation objects are subjected to tagging, so that each attribute tag in a result set can be ensured to correspond to a plurality of target recommendation objects, and the accuracy of the recommendation result is ensured while the diversity is considered.
Based on the above embodiment, referring to fig. 1, a flowchart of a data recommendation method in an embodiment of the present disclosure is shown, which specifically includes:
step 10: and acquiring the user characteristics and the characteristics of each recommended object, and acquiring a first recommendation score between the user and each recommended object according to the user characteristics and the characteristics of each recommended object.
Wherein the first recommendation score characterizes a predicted score of the user's preference for the recommended object.
In the embodiment of the disclosure, when a target recommendation object needs to be recommended to a user, user information of the user is acquired, feature extraction is performed on the user information to acquire user features, recommendation object information of each recommendation object is acquired, feature extraction is performed on the recommendation object information to acquire recommendation object features corresponding to the recommendation object features, and after the user features and the recommendation object features are acquired, first recommendation scores between the user and each recommendation object are acquired according to the user features and the recommendation object features.
The user information is attribute information of the user, for example, a user gender, a user identifier, a user age, a user identity, an object clicked by the user, a staying time length, and the like.
The recommendation object information is attribute information of the recommendation object, such as click rate, effective viewing rate, recommendation object ID, and the like, which is not limited in the embodiment of the present disclosure.
It should be noted that, a first recommendation score is corresponding to each recommendation object between the user and each recommendation object, for example, assuming that there are 50 recommendation objects in total, 50 first recommendation scores can be calculated, which is not limited in the embodiment of the present disclosure.
In addition, it should be noted that, in the embodiment of the present disclosure, a possible implementation manner is provided for determining the first recommendation score, and a process of determining the user and the first recommendation score in the embodiment of the present disclosure is described in detail below by taking any one of the recommendation objects as an example, and specifically includes:
and predicting to obtain a first recommendation score between the user and the recommendation object by taking the user characteristics and any one recommendation object characteristic as input parameters based on the trained first scoring model.
In the embodiment of the disclosure, a trained first scoring model is obtained, user characteristics obtained by characteristic extraction and any one recommended object characteristic are input into the trained first scoring model, and a recommendation score between a user and the recommended object is predicted, so that the first recommendation score between the user and the recommended object is obtained.
A possible implementation manner is provided in the embodiment of the present disclosure for a process of predicting and obtaining a first recommendation score between a user and a recommended object, and the following describes in detail a process of predicting and obtaining a first recommendation score based on a trained first scoring model in the embodiment of the present disclosure, and specifically includes:
s101: and generating the salient features of the recommended object according to the continuous features and the discrete features of the recommended object in the recommended object features, and converting the salient features into salient vectors.
In the embodiment of the disclosure, the continuous features and the discrete features are used as the salient features of the recommendation object, so that the continuous features and the discrete features in the recommendation object features are spliced to obtain the salient features of the recommendation object, and the salient features are converted into salient vectors by a preset feature conversion mode.
The preset feature conversion manner may be, for example, converting the salient features into salient vectors through a fully-connected network, which is not limited in the embodiment of the present disclosure.
S102: converting the recommendation object features into a recommendation object vector and converting the user features into a user vector.
In the embodiment of the disclosure, the recommended object features are converted into the recommended object vectors in a preset feature conversion mode, and meanwhile, the user features are converted into the user vectors in a preset feature conversion mode.
It should be noted that, when the salient features are converted into the salient vectors, the recommendation object features are converted into the recommendation object vectors, and the user features are converted into the user vectors, the same feature conversion manner may be used, and of course, different feature conversion manners may also be used, which is not limited in this embodiment of the disclosure.
S103: and calculating a cross vector between the recommended object vector and the user vector.
In the embodiment of the disclosure, after the recommended object vector and the user vector are obtained, a cross vector between the recommended object vector and the user vector is calculated through a preset cross algorithm.
For example, assuming that the recommendation object vector is a 32-dimensional vector, the recommendation object vector may be represented as:
(item)=[i1,i2,...,i32]
the user vector is also a 32-dimensional vector, the user vector can be expressed as:
(user)=[u1,u2,...,u32]
thus, the cross vector can be expressed as:
cross(item,user)=[i1*u1,i2*u2,...,i32*u32]
the cross vector is a 32-dimensional vector, and the preset cross algorithm may be, for example, a second-order cross algorithm, so that the obtained cross vector is a second-order cross vector.
S104: and determining a first recommendation score between the user and the recommendation object according to the significant vector, the user vector, the recommendation object vector, the cross vector and a preset weight vector.
In the embodiment of the disclosure, after obtaining the significant vector, the user vector, the recommended object vector and the cross vector, an inner product between the significant vector and the corresponding weight vector is calculated, a first inner product result is obtained, an inner product between the user vector and the corresponding weight vector is calculated, a second inner product result is obtained, an inner product between the recommended object vector and the corresponding weight vector is calculated, a third inner product result is obtained, an inner product between the cross vector and the corresponding weight vector is calculated, a fourth inner product result is obtained, then, the first inner product result, the second inner product result, the third inner product result and the fourth inner product result are accumulated to obtain an accumulated result, and the accumulated result is converted into the first recommended score through a preset score conversion mode, so that the first recommended score between the user and the recommended object is obtained.
For example, the accumulation result can be expressed as:
Figure BDA0003209884270000141
wherein the content of the first and second substances,
Figure BDA0003209884270000142
in order to obtain the result of the first inner product,
Figure BDA0003209884270000143
in (1) [ i ]1,i2...,i32]To recommend an object vector, wiRecommending a weight vector corresponding to the object vector in the total weight vector;
Figure BDA0003209884270000144
in order to obtain the result of the second inner product,
Figure BDA0003209884270000145
u ini-32As a user vector, wiThe weight vector corresponding to the user vector in the total weight vector;
Figure BDA0003209884270000146
in order to obtain the result of the third inner product,
Figure BDA0003209884270000147
cross in (1)i-64Is a cross vector, wiThe weight vector corresponding to the cross vector in the total weight vector;
Figure BDA0003209884270000148
in the form of the result of the fourth inner product,
Figure BDA0003209884270000149
f in (1)iIs a significant vector, w96+iThe weight vector corresponding to the significant vector in the total weight vector.
The first recommendation score may be expressed, for example, as:
Figure BDA00032098842700001410
step 11: and sequencing the recommended objects according to the first recommended scores.
In the embodiment of the disclosure, the recommendation objects are ranked according to the first recommendation scores and a preset ranking mode, so that the ranked recommendation objects are obtained.
The preset sorting manner may be, for example, an ascending manner, or may also be, for example, a descending manner, which is not limited in the embodiment of the present disclosure.
Step 12: and respectively performing labeling processing on the sorted recommendation objects, and determining a target recommendation object in the result set in each recommendation object subjected to labeling processing.
In the embodiment of the disclosure, tagging is performed on each sorted recommendation object, each pre-labeled attribute tag corresponding to each recommendation object is determined, so as to obtain each tagged recommendation object, and a target recommendation object in a result set is determined from each tagged recommendation object.
The following describes in detail the step of determining a target recommendation object in a result set by taking any recommendation object as an example, and specifically includes:
s121: and determining each attribute label pre-labeled by any one recommended object and the priority of each attribute label.
In the embodiment of the disclosure, tagging is performed on any one recommended object, each attribute tag pre-labeled by the recommended object is determined, and after each attribute tag is obtained, the priority among the attribute tags is determined.
For example, assuming that the recommendation target is a anchor, the anchor is tagged, and the anchor is tagged depending on the definition of the tag library.
It should be noted that each element of the tag library is in the form of: tag name: t, label constraint condition: t _ c, tag priority: t _ p, preset anchor number: t _ n, for example, if the first broadcast time of the new anchor is within 30 days, it may be represented as 0, 30; the anchor is the anchor which the user pays attention to/has interacted with, and can be represented as 1, 20; when the song singing the hearts song and the anchor is singing the user's hearts song, the song can be expressed as 2, 40; if the anchor is a similar anchor for which the user focuses on the anchor, the anchor may be denoted as 4,10, which is not limited in the embodiment of the present disclosure. Referring to table 1, a labeled table in an embodiment of the present disclosure is shown.
Table 1.
Figure BDA0003209884270000151
Figure BDA0003209884270000161
The attribute tags are new anchor, real-time hot spot, singing, jumping, attention, and the like, and the type and the number of the attribute tags are not limited in the embodiment of the disclosure.
In the embodiment of the present disclosure, in the tagging process, before performing data recommendation, the tagging process may be performed on each recommendation object, and each attribute tag corresponding to each recommendation object is stored in the database, and further each attribute tag corresponding to the recommendation object may be directly determined.
In addition, each attribute tag corresponds to a priority, and therefore, after the priority corresponding to each attribute tag is determined, the attribute tags of the recommendation object are sorted according to the priority.
For example, assume that the attribute tag corresponding to the recommendation object i is a new anchor, singing, or attention, wherein the preset priority relationship is: the priority of the new anchor is higher than the priority of concern, and the priority of concern is higher than the priority of singing, so according to the priority, the obtained sequencing result after sequencing the attribute tags corresponding to the recommended objects is as follows: new anchor, focus, singing.
Further, in order to improve the system performance, a plurality of attribute labels are mutually independent and are calculated in parallel; when one recommended object meets a plurality of attribute tags, in order to attribute the recommended object to the unique attribute tag, the priority of the attribute tag needs to be defined in advance according to prior knowledge.
Further, in the embodiment of the present disclosure, before determining each attribute tag, it is further necessary to determine whether the recommendation object has an attribute tag, if the recommendation object has no attribute tag, the recommendation object is added to the candidate queue, and the following description describes a process of adding the recommendation object to the candidate queue when the recommendation object has no attribute tag, specifically including:
a1: it is determined whether the recommended object has an attribute tag.
In the embodiment of the present disclosure, since the attribute tags are preset, each recommendation object may correspond to one attribute tag, may correspond to a plurality of attribute tags, and certainly may not correspond to any attribute tag, before determining the priority of each attribute tag, it is determined whether the recommendation object has an attribute tag, if it is determined that the recommendation object has an attribute tag, the priority of each attribute tag is determined, and if it is determined that the recommendation object has no attribute tag, the recommendation object is added to the candidate queue.
A2: when the recommendation object is determined to have no attribute label, the recommendation object is added to the candidate queue.
In the embodiment of the present disclosure, when it is determined that the recommendation object has no attribute tag, the step of determining the priority of the attribute tag cannot be performed, and therefore, the recommendation object is added to the candidate queue.
S122: and determining a target attribute label meeting a preset priority condition from the attribute labels according to the priority of each attribute label.
In the embodiment of the disclosure, according to the priority of each attribute tag, an attribute tag meeting a preset priority condition is determined from each attribute tag, and the determined attribute tag is used as a target attribute tag of the recommendation object.
If the preset priority condition is the highest priority, for example, when the target attribute tag meeting the preset priority condition is determined, the attribute tag with the highest priority is determined from the attribute tags, and the attribute tag with the highest priority is used as the target attribute tag.
For example, assuming that the sorting result obtained by sorting the attribute tags according to the priority levels is a new anchor, attention, and singing, the attribute tag with the highest priority level is determined to be the new anchor, and the determined attribute tag new anchor is the target attribute tag.
S123: and when the target attribute tag is contained in a pre-configured tag library, determining that the recommendation object is used as a target recommendation object, and adding the target recommendation object to the result set.
Wherein, the label library comprises each attribute label.
In the embodiment of the present disclosure, determining whether the target attribute tag is included in the preconfigured tag library may be specifically divided into the following two cases:
in the first case: the target attribute tags are contained in a preconfigured tag library.
The method specifically comprises the following steps: and if the target attribute tag is determined to be contained in the pre-configured tag library, determining that the recommendation object is used as the target recommendation object, and adding the target recommendation object to the result set.
For example, assuming that the target attribute tag of the recommendation object is a new anchor, and the attribute tags included in the preconfigured tag library are a new anchor, attention, and singing, respectively, it is determined that the target attribute tag is included in the tag library, and therefore, the recommendation object is added to the result set as the target recommendation object.
In the second case: the target attribute tag is not contained in a preconfigured tag library.
The method specifically comprises the following steps: and if the target attribute tag is determined not to be contained in the pre-configured tag library, adding the recommendation object to the candidate queue.
For example, assuming that the target attribute tag of the recommendation object is attention and the attribute tags included in the tag library are a new anchor, a singing, and a jumping, respectively, it is determined that the target attribute tag is not included in the tag library, and therefore, the recommendation object is added to the candidate queue.
Further, in order to ensure that each target attribute tag in the result set corresponds to a preset number of target recommendation objects, thereby avoiding single recommended data and realizing diversity of data recommendation, in this embodiment of the present disclosure, when the number of target recommendation objects corresponding to the target attribute tag reaches a preset value, the target attribute tag needs to be deleted, and the following description specifically includes:
s124: and respectively determining whether the number of the target recommended objects corresponding to each target attribute label reaches a second preset value.
In the embodiment of the disclosure, each target attribute tag corresponds to each target recommendation object, so that the number of the target recommendation objects corresponding to each target attribute tag is determined, and whether the number of the target recommendation objects corresponding to each target attribute tag reaches the second preset value is determined respectively.
It should be noted that, in the embodiment of the present disclosure, the second preset values corresponding to each target attribute tag may be the same or different, and the second preset values are not limited thereto.
For example, when more "singing" anchor needs to be recommended to the user, the second preset value may be set slightly larger, so that the number of "singing" anchors in the result set is larger than the number of other anchors.
S125: and deleting the target attribute tag from the tag library when the number of the target recommended objects corresponding to any one target attribute tag is determined to reach a second preset value.
In the embodiment of the disclosure, when it is determined that the number of the target recommended objects corresponding to any one target attribute tag reaches the second preset value, the target attribute tag is deleted from the tag library, so that the target attribute tags whose number reaches the second preset value are deleted, and it can be ensured that each target attribute tag in the result set corresponds to a target recommended object, thereby ensuring diversity of the target recommended objects in the result set.
Further, in this embodiment of the present disclosure, in order to ensure that the number of target recommendation objects recommended to the user can reach a certain preset value, when it is determined that the number of target recommendation objects in the result set does not reach the preset value, recommendation objects in the candidate queue need to be added to the result set, and a process of obtaining the result set in this embodiment of the present disclosure is described in detail below, which specifically includes:
s126: and determining that all the recommended objects are added into the result set and/or the candidate queue, and when the number of the target recommended objects in the result set does not reach a first preset value, selecting a certain number of recommended objects from the candidate queue and adding the selected recommended objects into the result set.
In the embodiment of the disclosure, each recommendation object may be added to the result set or added to the candidate queue, when it is determined that all recommendation objects are added to the result set or the candidate queue and the number of target recommendation objects in the result set does not reach the first preset value, the number of the target recommendation objects included in the result set at this time is determined, a difference value between the first preset value and the number of the target recommendation objects is calculated, the calculated difference value is used as the number of recommendation objects to be selected from the post-compensation queue, a certain number of recommendation objects are selected from the candidate queue, and the selected recommendation objects are added to the result set.
For example, assuming that the first preset value is 20, when the number of target recommended objects included in the result set is 15 after each recommended object is processed, the difference between the first preset value and the number of target recommended objects is 5, and 5 recommended objects need to be selected from the candidate queue and added to the result set.
It should be noted that, when determining whether each recommendation object can be added to the result set, the recommendation objects are sequentially processed according to the ranking order, and therefore, the recommendation objects in the candidate queue are also ranked according to the preset ranking mode.
S127: and taking the recommendation objects in the result set as target recommendation objects.
In the embodiment of the disclosure, the recommendation objects in the result set are used as target recommendation objects, at this time, the number of the target recommendation objects in the result set reaches a first preset value, and each target attribute tag corresponds to a target recommendation object.
Step 13: and recommending each target recommendation object.
Specifically, after the result set is obtained, the target recommendation object in the result set is recommended.
In the embodiment of the disclosure, the first recommendation scores corresponding to the recommendation objects are determined, and the target recommendation objects in the result set are determined from the recommendation objects subjected to tagging, so that data recommendation is performed according to the first recommendation scores and the attribute tags by applying the idea of a greedy algorithm, and each attribute tag can be guaranteed to correspond to specific data, and meanwhile, the first recommendation scores of the recommendation objects and the diversity of the recommendation objects are considered, and finally, the efficiency and diversity indexes of the result set are improved.
Based on the above embodiment, the following describes in detail a process of training the first scoring model in the embodiment of the present disclosure, and as shown in fig. 2, a schematic flow chart of training the first scoring model in the embodiment of the present disclosure specifically includes:
step 20: and acquiring a training sample set and corresponding recommended value labels.
The training sample set comprises user sample characteristics and recommendation object sample characteristics.
In the embodiment of the disclosure, a training sample set is obtained according to a target of a first scoring model, specifically, an original record is obtained from a client log, each record includes a user id, a recommended object id and a user behavior, feature extraction is performed on the obtained user information and the recommended object information, a training sample set including features of each user sample and features of each recommended object sample is obtained, and meanwhile, each recommendation score label corresponding to the training sample set is obtained.
The user's behavior may be, for example, exposure, clicking, active viewing, etc.
For example, the goal of the first scoring model is defined as a binary problem based on a user behavior log, and the recommendation score labels of the samples are determined, each recommendation score label representing a recommendation score label between one user sample and one recommendation object.
Step 21: inputting any user sample characteristic and any recommended object sample characteristic into an initial first scoring model, determining a first training score between the user sample and the recommended object sample, and adjusting each model parameter of the initial first scoring model according to the first training score and a corresponding recommended score label until a cross entropy loss function of the first scoring model converges to obtain the trained first scoring model.
And determining the cross entropy loss function according to the user sample characteristics, the recommendation object sample characteristics and the corresponding recommendation score labels.
In the embodiment of the disclosure, an initial first scoring model is obtained, based on the initial first scoring model, a user sample corresponding to any user sample feature and any recommended object sample feature are determined as input parameters, a first training score between the user sample corresponding to the user sample feature and a recommended object corresponding to the recommended object sample feature is determined, then, according to the first training score and a recommended score label corresponding to the first training score, each model parameter of the initial first scoring model is adjusted until a cross entropy loss function of the first scoring model converges, and a trained first scoring model is obtained.
It should be noted that, when adjusting each model parameter, an Adam optimization algorithm may be used, which is not limited in the embodiment of the present disclosure.
A possible implementation manner is provided for determining the first training score between the user sample and the recommended object sample in the embodiment of the present disclosure, and the following describes in detail a process of determining the first training score in the embodiment of the present disclosure, and specifically includes:
s211: inputting the user sample characteristics into a first conversion network to obtain a user sample vector, and inputting the recommended object sample characteristics into a second conversion network to obtain a recommended object sample vector.
In the embodiment of the present disclosure, since the parameters input into the initial first scoring model are the user sample features and the recommended object sample features, the user sample features need to be converted into user sample vectors, and the recommended object sample features need to be converted into recommended object sample vectors.
It should be noted that, in the embodiment of the present disclosure, the execution process of obtaining the user sample vector through the first conversion network and the execution process of obtaining the recommendation target sample vector through the second conversion network may be implemented simultaneously.
The following describes a specific training process of the first scoring model in the embodiment of the present disclosure, taking the recommendation object as the anchor as an example. Referring to fig. 3, an exemplary flowchart of training in an embodiment of the disclosure is shown.
The first scoring model comprises a anchor network and a user network. The input parameters of the anchor network are anchor characteristics, the output parameters are anchor vectors, the input parameters of the user network are user characteristics, and the output parameters are user vectors. The user vector and the anchor vector are both 32-dimensional.
The anchor features comprise anchor discrete features, anchor continuous features and text features, the anchor discrete features are input into an Embedding layer (Embedding), the anchor continuous features are input into FC, the text features are input into a text classification network (textCNN), the output of Embedding, the output of FC and the output of textCNN are input into deep FM, the output of deep FM is used as the input of FC, and anchor vectors are obtained.
The user features comprise user discrete features, user continuous features and user sequence features, the user discrete features are input into Embedding, the user continuous features are input into FC, the user sequence features are input into a Deep Interest network model (Deep Interest network, DIN), the output of Embedding, the output of FC and the output of DIN are input into Deep FM, the output of Deep FM is used as the input of FC, and user vectors are obtained.
Then, calculating a cross vector between the user vector and the anchor vector, wherein the cross vector is a 32-dimensional vector, splicing the significant vector, the user vector, the anchor vector and the cross vector to finally form a (96+ k) -dimensional vector, and obtaining a first training score through a sigmod function according to an inner product between the (96+ k) -dimensional vector and a preset weight vector.
And finally, calculating a cross entropy loss function according to the recommended value label and the first training value, adjusting all parameters of the first scoring model until convergence, and outputting the trained first scoring model.
S212: and inputting continuous features of the recommended object samples and discrete features of the recommended object samples in the recommended object sample features into a third conversion network, generating sample significant features corresponding to the recommended object samples, and converting the sample significant features into sample significant vectors.
In the embodiment of the disclosure, a third conversion network in an initial first scoring model is used, continuous features of a recommended object sample and discrete features of the recommended object sample in the recommended object sample features are input into the third conversion network, the continuous features of the recommended sample and the discrete features of the recommended sample are spliced through the third conversion network, sample significant features corresponding to the recommended object sample are generated, and the sample significant features are converted into sample significant vectors.
Further, the recommended object vector and the user vector, significant vector [ f1, f 2., fk ] obtained by offline training may be used]And a weight vector [ w1,w2,...,w96+k]And deploying the data into an online memory database.
S213: and performing cross calculation on the user sample vector and the recommended object sample vector to obtain a sample cross vector.
In the embodiment of the disclosure, according to a preset cross calculation mode, cross calculation is performed on a user sample vector and a recommended object sample vector to obtain a sample cross vector.
The preset cross calculation manner may be, for example, an inner product, which is not limited in the embodiment of the present disclosure.
S214: and splicing the sample significant vector, the user sample vector, the recommended object sample vector and the sample cross vector to obtain a spliced vector.
In the embodiment of the disclosure, the sample significant vector, the user sample vector, the recommended object sample vector and the sample cross vector are spliced to obtain a spliced vector.
For example, if the sample significant vector is a k-dimensional vector, the user sample vector is a 32-dimensional vector, the recommendation target sample vector is a 32-dimensional vector, and the sample cross vector is a 32-dimensional vector, the concatenation vector of the concatenated butterfly is a (96+ k) -dimensional vector.
S215: and performing inner product processing on the splicing vector and a preset weight vector, and obtaining a first training score after activation function processing.
In the embodiment of the disclosure, an inner product between the splicing vector and the preset weight vector is calculated to obtain an inner product result, and the inner product result is processed through an activation function to obtain a first training score.
The activation function may be, for example, a sigmod function, which is not limited in the embodiment of the present disclosure.
The concatenation vector has the same dimension as the predetermined weight vector, and for example, if the concatenation vector is a (96+ k) -dimensional vector, the predetermined weight vector is also a (96+ k) -dimensional vector.
In the embodiment of the disclosure, the first training score is determined through the sample significant vector, the user sample vector, the recommended object sample vector, the sample cross vector and the preset weight vector, and then the initial first scoring model is trained according to the first training score and the corresponding recommended score label, so that the accuracy of model prediction can be improved.
Based on the foregoing embodiment, in the embodiment of the present disclosure, after obtaining the result set, each target recommendation object in the result set may be screened again, and then a plurality of preset target recommendation objects are selected from each target recommendation object in the result set for recommendation, a process of recommending a target recommendation object in the result set in the embodiment of the present disclosure is described below, referring to fig. 4, a schematic flow diagram for recommending a target recommendation object in the result set in the embodiment of the present disclosure specifically includes:
step 40: and respectively aiming at each target recommendation object in the result set, based on the trained second scoring model, and taking the recommendation object characteristics and the user characteristics corresponding to any target recommendation object as input parameters, determining a second recommendation score between the user and the target recommendation object.
In the embodiment of the present disclosure, for each target recommendation object in the result set, the following operations are respectively performed: and based on the trained second scoring model, determining a second recommendation score between the user and the target recommendation object by taking the recommendation object characteristics and the user characteristics corresponding to any target recommendation object as input parameters.
Specifically, the second scoring model in the embodiment of the present disclosure at least includes a user sub-network, a recommendation object sub-network, and a second score transformation function, and the following describes in detail a process of determining a second recommendation score between a user and the target recommendation object in the embodiment of the present disclosure, and specifically includes:
s401: and inputting the user characteristics of the user and the recommendation object characteristics of the target recommendation object into a user sub-network, and determining a first inner product.
In the embodiment of the disclosure, the user characteristics corresponding to the user and the recommended object characteristics of the target recommended object are input into the user sub-network of the second scoring model, the user characteristics are converted into user vectors, the recommended object characteristics are converted into recommended object vectors, and then, the inner product between the user vectors and the recommended object vectors is calculated, so that the first inner product is obtained.
S402: and inputting the recommendation object characteristics corresponding to any target recommendation object into a recommendation object sub-network, and determining a second inner product between the recommendation object characteristics of the target recommendation object and the recommendation object characteristics of other target recommendation objects.
In the embodiment of the disclosure, the target recommendation object feature corresponding to the target recommendation object is input into the recommendation object sub-network, and a second inner product between the target recommendation object feature and each of other recommendation object features is determined.
S403: and inputting the first inner product and the second inner product into a second score conversion function, and determining a second recommendation score between the user and the target recommendation object.
In the embodiment of the disclosure, the first inner product and the second inner product are input into the score conversion network, and then the second recommendation score between the user and the target recommendation object is determined according to the score conversion function.
Further, the following describes in detail the step of training the second scoring model in the embodiment of the present disclosure, which specifically includes: and respectively carrying out iterative training on the initial second scoring model aiming at each user sample characteristic, each recommended object sample characteristic and the corresponding recommended score label, adjusting each model parameter of the initial second scoring model until the cross entropy loss of the second scoring model is converged, and obtaining the trained second scoring model.
And determining the cross entropy loss function according to the user characteristics of each sample, the sample characteristics of each recommendation object and the corresponding recommendation score labels.
It should be noted that the training of the second scoring model is similar to the training process of the first scoring model, and is not described in detail herein.
Step 41: and selecting a plurality of preset target recommendation objects for recommendation according to the second recommendation scores.
In the embodiment of the disclosure, after the second recommendation scores are obtained, the target recommendation objects are sorted according to the second recommendation scores, and a plurality of preset target recommendation objects are selected from the sorted target recommendation objects for recommendation.
In the embodiment of the disclosure, each target recommendation object is determined through the first scoring model, and a plurality of preset target recommendation objects are selected from each target recommendation object for recommendation through the second scoring model, so that data recommendation can be performed to a user more accurately. When the method is applied to a recommendation scene of a live broadcast page, the live broadcast click rate can be improved by 2% on the original basis. In addition, when the first scoring model and the second scoring model are used for model training, the used sample set and the corresponding recommendation score labels are the same, so that the high-performance requirement of a recommendation system can be met, the target consistency of data recommendation can be ensured, and the accuracy of a recommendation result is improved.
Based on the above embodiment, referring to fig. 5, a schematic flow chart of model offline training in the embodiment of the present disclosure specifically includes:
step 50: and determining a training sample set of the first scoring model and a training sample set of the second scoring model and corresponding recommended score labels.
In the embodiment of the present disclosure, according to a current application scenario, targets of the first scoring model and the second scoring model are determined, that is, a sample set and corresponding recommendation score labels for training the first scoring model and the second scoring model are determined.
For example, when applied to a live music recommendation scenario, the quality of the recommendation is evaluated for click and effective viewing, and if so, the recommendation is user-satisfied.
It should be noted that, in the embodiment of the present disclosure, the same target is used by the first scoring model and the second scoring model, and consistency of the target is ensured, that is, the same training sample set and corresponding recommendation score labels are used by the first scoring model and the second scoring model.
Step 51: and training the initial first scoring model based on the training sample set and the corresponding recommended score labels to obtain a trained first scoring model.
In the embodiment of the present disclosure, for each user sample feature in a training sample set, the following operations are respectively performed: inputting any user sample characteristic and any recommended object sample characteristic into an initial first scoring model, determining a first training score between the user sample and the recommended object sample, and adjusting each model parameter of the initial first scoring model according to the first training score and a corresponding recommended score label until a cross entropy loss function of the first scoring model converges to obtain the trained first scoring model.
Step 52: and defining each attribute label and label data conditions corresponding to each attribute label.
Step 53: and training the initial second scoring model based on the training sample set and the corresponding recommended score labels to obtain a trained second scoring model.
In the embodiment of the disclosure, the initial second scoring model is iteratively trained respectively for each user sample feature in the training sample set according to any user sample feature, any recommended object sample feature, and the corresponding recommended score label, and each model parameter of the initial second scoring model is adjusted until the cross entropy loss of the second scoring model converges, so as to obtain the trained second scoring model.
It should be noted that, in the embodiment of the present disclosure, it is ensured that the first scoring model and the second scoring model use the same business objective, and consistency of the objectives is ensured. That is, the training sample set used in the training process of the first scoring model and the second scoring model is the same as the corresponding recommendation score labels. And the training process of the first scoring model and the second scoring model is the same.
In the embodiment of the disclosure, the training sample sets of the first scoring model and the second scoring model are selected, and the first scoring model and the second scoring model are trained according to the training sample sets and the corresponding recommended value labels, so that the first scoring model and the second scoring model adopt the same training steps, and the first scoring model and the second scoring model are trained by using the same training sample sets and the corresponding recommended value labels, and the target consistency of each link of data recommendation can be ensured under the condition of meeting the high-performance requirement of a recommendation system, thereby improving the accuracy of data recommendation.
Based on the above embodiment, referring to fig. 6, a schematic flow diagram of online application of a model in an embodiment of the present disclosure specifically includes:
step 60: and obtaining a first recommendation score between the user and each recommendation object according to the user characteristics and the recommendation object characteristics.
In the embodiment of the disclosure, the user characteristics and the characteristics of each recommended object are obtained, and the first recommendation score between the user and each recommended object is obtained according to the user characteristics and the characteristics of each recommended object.
Step 61: and performing labeling processing on each sorted recommendation object.
Step 62: and determining a target recommendation object in the result set in each recommendation object subjected to tagging.
And step 63: and respectively aiming at each target recommendation object in the result set, based on the trained second scoring model, and taking the recommendation object characteristics and the user characteristics corresponding to any target recommendation object as input parameters, determining a second recommendation score between the user and the target recommendation object.
Step 64: and sequencing the second recommendation scores according to a rearrangement strategy, so as to screen out the recommendation objects of topN for recommendation.
In the embodiment of the present disclosure, a recommendation process of performing rough ranking, labeling processing, fine ranking by using the first scoring model, and rearrangement is used, so that both high score and diversity can be considered.
Based on the above embodiment, referring to fig. 7, a flowchart for determining an attribute tag in the embodiment of the present disclosure specifically includes:
step 700: and identifying the anchor, the number of anchors of the result set and the number of anchors corresponding to each target attribute tag.
In the embodiment of the present disclosure, the anchor identifier is initialized, and may be represented as i ═ 0; the number of anchor included in the result set is initialized, which may be represented as r ═ 0, and the number of anchors corresponding to each target attribute tag is initialized, which may be represented as n _ t ═ 0.
Step 701: and acquiring the ith anchor in the queue.
Step 702: and judging whether the anchor has an attribute tag, if so, executing step 703, and if not, executing step 709.
Step 703: and searching a target attribute label t which has the highest priority and is contained in the label library in each attribute label.
Step 704: and judging whether the target attribute tag t can be found, if so, executing steps 705 and 706, and executing step 709.
Step 705: and (4) setting the anchor number t _ n corresponding to the target attribute label t as n _ t + 1.
Step 706: the result set r is r + 1.
Step 707: and judging whether the anchor number corresponding to the target attribute tag t is greater than a second preset value t _ n, if so, executing step 708, and if not, executing step 710.
Step 708: the target attribute tag t is deleted from the tag library.
Step 709: and entering a candidate queue.
Step 710: i ═ i + 1.
Step 711: and judging whether i is smaller than the queue length, if so, executing the step 701, and if not, executing the step 712.
Step 712: and judging whether r reaches a first preset value, if so, executing step 713, and if not, executing step 714.
Step 713: and (6) outputting.
Step 714: the anchor completion in the candidate queue is used.
Based on the same inventive concept, the embodiment of the present disclosure further provides a data recommendation device, where the data recommendation device may be a hardware structure, a software module, or a hardware structure plus a software module, and the embodiment of the data recommendation device may inherit the content described in the foregoing method embodiment. Based on the above embodiments, referring to fig. 8, a schematic structural diagram of a data recommendation device in an embodiment of the present disclosure is shown, which specifically includes:
the first scoring module 800 is configured to obtain user characteristics and recommended object characteristics, and obtain a first recommendation score between a user and each recommended object according to the user characteristics and the recommended object characteristics, where the first recommendation score represents a prediction score of a preference degree of the user for the recommended object;
a sorting module 801, configured to sort the recommendation objects according to the first recommendation scores;
a processing module 802, configured to perform tagging on the sorted recommendation objects respectively, and determine a target recommendation object located in a result set in the recommendation objects subjected to tagging;
and the recommending module 803 is used for recommending each target recommending object.
Optionally, the processing module 802 is specifically configured to:
respectively aiming at each recommendation object, executing the following operations:
determining each attribute label pre-labeled by any one recommendation object and the priority of each attribute label;
determining a target attribute label meeting a preset priority condition from the attribute labels according to the priority of the attribute labels;
and when the target attribute tags are contained in a pre-configured tag library, determining that the recommended object is used as a target recommended object, and adding the target recommended object to a result set, wherein the tag library contains the attribute tags.
Optionally, when determining a target recommended object in the result set in the recommended objects subjected to tagging, the processing module 802 is further configured to:
when the target attribute label is not contained in the label library, adding the recommendation object to a candidate queue;
determining to add each recommended object to the result set and/or the candidate queue, and when the number of target recommended objects in the result set does not reach a first preset value, selecting a certain number of recommended objects from the candidate queue to add to the result set;
and taking the recommended objects in the result set as target recommended objects.
Optionally, before determining each attribute tag pre-labeled to any one object to be recommended and the priority of each attribute tag, the processing module 802 is further configured to:
determining whether the recommended object has an attribute tag;
when the recommendation object is determined to have no attribute label, the recommendation object is added to the candidate queue.
Optionally, when the target recommendation object is added to the result set, the processing module 802 is further configured to:
respectively determining whether the number of target recommended objects corresponding to each target attribute label reaches a second preset value;
and deleting the target attribute tag from the tag library when the number of the target recommended objects corresponding to any one target attribute tag is determined to reach a second preset value.
Optionally, when obtaining a first recommendation score between the user and each recommended object according to the user characteristic and the characteristics of each recommended object, the first scoring module 800 is specifically configured to:
and predicting and obtaining a first recommendation score between the user and the recommendation object by taking the user characteristics and any one recommendation object characteristic as input parameters based on the trained first scoring model.
Optionally, when the first recommendation score between the user and the recommended object is obtained in a prediction mode, the first scoring module 800 is specifically configured to:
generating a significant feature of the recommended object according to the continuous feature and the discrete feature of the recommended object in the recommended object features, and converting the significant feature into a significant vector;
converting the recommended object features into recommended object vectors, and converting the user features into user vectors;
calculating a cross vector between the recommended object vector and the user vector;
and determining a first recommendation score between the user and the recommended object according to the significant vector, the user vector, the recommended object vector, the cross vector and a preset weight vector.
Optionally, when training the first scoring model, the method further includes:
an obtaining module 804, configured to obtain a training sample set and corresponding recommendation score labels, where the training sample set includes user sample features and recommendation object sample features;
the first training module 805 is configured to input any user sample feature and any recommended object sample feature into an initial first scoring model, determine a first training score between the user sample and the recommended object sample, adjust each model parameter of the initial first scoring model according to the first training score and a corresponding recommended score label until a cross entropy loss function of the first scoring model converges, and obtain the trained first scoring model, where the cross entropy loss function is determined according to each user sample feature, each recommended object sample feature, and a corresponding recommended score label.
Optionally, when determining the first training score between the user sample and the recommended object sample, the first training module 805 is specifically configured to:
inputting the user sample characteristics into a first conversion network to obtain a user sample vector, and inputting the recommended object sample characteristics into a second conversion network to obtain a recommended object sample vector;
inputting continuous features and discrete features of recommended object samples in the recommended object sample features into a third conversion network, generating sample significant features corresponding to the recommended object samples, and converting the sample significant features into sample significant vectors;
performing cross calculation on the user sample vector and the recommended object sample vector to obtain a sample cross vector;
splicing the sample significant vector, the user sample vector, the recommended object sample vector and the sample cross vector to obtain a spliced vector;
and performing inner product processing on the splicing vector and a preset weight vector, and obtaining a first training score after activation function processing.
Optionally, each target recommendation object is recommended, and the recommendation module 803 is specifically configured to:
respectively aiming at each target recommendation object in the result set, based on a trained second scoring model, and taking recommendation object characteristics corresponding to any target recommendation object and the user characteristics as input parameters, determining a second recommendation score between the user and the target recommendation object;
and selecting a plurality of preset target recommendation objects for recommendation according to the second recommendation scores.
Optionally, the second scoring model includes a user sub-network, a recommendation object sub-network, and a second score transformation function, and when a second recommendation score between the user and the target recommendation object is determined, the recommendation module 803 is specifically configured to:
inputting the user characteristics of the user and the recommendation object characteristics of the target recommendation object into the user sub-network, and determining a first inner product;
inputting the recommended object feature corresponding to any one of the target recommended objects into the recommended object sub-network, and determining a second inner product between the recommended object feature of the target recommended object and the recommended object features of other target recommended objects;
and inputting the first inner product and the second inner product into the second score conversion function, and determining a second recommendation score between the user and the target recommendation object.
Optionally, when training the second scoring model, the method further includes:
a second training module 806, configured to perform iterative training on an initial second scoring model respectively for each user sample feature, each recommended object sample feature, and a corresponding recommended score label, adjust each model parameter of the initial second scoring model until cross entropy loss of the second scoring model converges, and obtain the trained second scoring model, where the cross entropy loss function is determined according to each user sample feature, each recommended object sample feature, and a corresponding recommended score label.
Based on the above embodiments, fig. 9 is a schematic structural diagram of an electronic device in an embodiment of the disclosure.
The present disclosure provides an electronic device, which may include a processor 910 (CPU), a memory 920, an input device 930, an output device 940, and the like, wherein the input device 930 may include a keyboard, a mouse, a touch screen, and the like, and the output device 940 may include a Display device, such as a Liquid Crystal Display (LCD), a Cathode Ray Tube (CRT), and the like.
Memory 920 may include Read Only Memory (ROM) and Random Access Memory (RAM), and provides the processor 910 with program instructions and data stored in memory 920. In the embodiment of the present disclosure, the memory 920 may be used to store a program of any data recommendation method in the embodiment of the present disclosure.
The processor 910 is configured to execute any data recommendation method in the embodiments of the present disclosure according to the obtained program instructions by calling the program instructions stored in the memory 920.
Based on the above embodiments, in the embodiments of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program, when executed by a processor, implements the data recommendation method in any of the above method embodiments.
As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the present disclosure. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications can be made in the present disclosure without departing from the spirit and scope of the disclosure. Thus, if such modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is intended to include such modifications and variations as well.

Claims (10)

1. A method for recommending data, comprising:
acquiring user characteristics and various recommended object characteristics, and acquiring first recommended scores between a user and various recommended objects according to the user characteristics and the various recommended object characteristics, wherein the first recommended scores represent predicted scores of the preference degrees of the user for the recommended objects;
sorting the recommended objects according to the first recommended scores;
labeling the sorted recommended objects respectively, and determining target recommended objects in a result set in the labeled recommended objects;
and recommending each target recommendation object.
2. The method according to claim 1, wherein the labeling processing is performed on the sorted recommendation objects, and a target recommendation object in the result set is determined from the labeling processed recommendation objects, specifically including:
respectively aiming at each recommendation object, executing the following operations:
determining each attribute label pre-labeled by any one recommendation object and the priority of each attribute label;
determining a target attribute label meeting a preset priority condition from the attribute labels according to the priority of the attribute labels;
and when the target attribute tags are contained in a pre-configured tag library, determining that the recommended object is used as a target recommended object, and adding the target recommended object to a result set, wherein the tag library contains the attribute tags.
3. The method of claim 2, wherein the determining a target recommendation object in the result set from the recommendation objects after the tagging further comprises:
when the target attribute label is not contained in the label library, adding the recommendation object to a candidate queue;
determining to add each recommended object to the result set and/or the candidate queue, and when the number of target recommended objects in the result set does not reach a first preset value, selecting a certain number of recommended objects from the candidate queue to add to the result set;
and taking the recommended objects in the result set as target recommended objects.
4. The method of claim 2, wherein the determining attribute tags pre-labeled to any one of the objects to be recommended and the priority of the attribute tags further comprises:
determining whether the recommended object has an attribute tag;
when the recommendation object is determined to have no attribute label, the recommendation object is added to the candidate queue.
5. The method of claim 2, wherein adding the target recommendation object to a result set, further comprises:
respectively determining whether the number of target recommended objects corresponding to each target attribute label reaches a second preset value;
and deleting the target attribute tag from the tag library when the number of the target recommended objects corresponding to any one target attribute tag is determined to reach a second preset value.
6. The method of claim 1, wherein obtaining a first recommendation score between the user and each recommended object according to the user characteristics and the characteristics of each recommended object specifically comprises:
and predicting and obtaining a first recommendation score between the user and the recommendation object by taking the user characteristics and any one recommendation object characteristic as input parameters based on the trained first scoring model.
7. The method of claim 6, wherein predicting to obtain a first recommendation score between the user and the recommended object comprises:
generating a significant feature of the recommended object according to the continuous feature and the discrete feature of the recommended object in the recommended object features, and converting the significant feature into a significant vector;
converting the recommended object features into recommended object vectors, and converting the user features into user vectors;
calculating a cross vector between the recommended object vector and the user vector;
and determining a first recommendation score between the user and the recommended object according to the significant vector, the user vector, the recommended object vector, the cross vector and a preset weight vector.
8. A data recommendation device, comprising:
the first scoring module is used for acquiring user characteristics and various recommended object characteristics and acquiring first recommended scores between a user and various recommended objects according to the user characteristics and the various recommended object characteristics, wherein the first recommended scores represent predicted scores of the preference degrees of the user for the recommended objects;
the sorting module is used for sorting the recommended objects according to the first recommended scores;
the processing module is used for respectively performing tagging processing on the sorted recommended objects and determining a target recommended object in a result set in the tagged recommended objects;
and the recommending module is used for recommending each target recommending object.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method of any of claims 1-7 are implemented when the program is executed by the processor.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that: the computer program when executed by a processor implements the steps of the method of any one of claims 1 to 7.
CN202110929331.3A 2021-08-13 2021-08-13 Data recommendation method and device, electronic equipment and storage medium Pending CN113742578A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110929331.3A CN113742578A (en) 2021-08-13 2021-08-13 Data recommendation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110929331.3A CN113742578A (en) 2021-08-13 2021-08-13 Data recommendation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113742578A true CN113742578A (en) 2021-12-03

Family

ID=78730987

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110929331.3A Pending CN113742578A (en) 2021-08-13 2021-08-13 Data recommendation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113742578A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114357294A (en) * 2021-12-30 2022-04-15 北京达佳互联信息技术有限公司 Content recommendation method and device, electronic equipment and storage medium
CN117216318A (en) * 2023-09-11 2023-12-12 中国科学院软件研究所 Short video recommendation method and device based on blogger enhancement

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106503006A (en) * 2015-09-07 2017-03-15 阿里巴巴集团控股有限公司 The sort method and device of application App neutron applications
US20180039675A1 (en) * 2016-08-04 2018-02-08 Baidu Online Network Technology (Beijing) Co., Ltd. Extended search method and apparatus
US10353908B1 (en) * 2018-11-12 2019-07-16 Anthem, Inc. Personalized smart provider search
CN110971659A (en) * 2019-10-11 2020-04-07 贝壳技术有限公司 Recommendation message pushing method and device and storage medium
CN111680219A (en) * 2020-06-09 2020-09-18 腾讯科技(深圳)有限公司 Content recommendation method, device, equipment and readable storage medium
CN111709816A (en) * 2020-06-23 2020-09-25 中国平安财产保险股份有限公司 Service recommendation method, device and equipment based on image recognition and storage medium
CN112699305A (en) * 2021-01-08 2021-04-23 网易传媒科技(北京)有限公司 Multi-target recommendation method, device, computing equipment and medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106503006A (en) * 2015-09-07 2017-03-15 阿里巴巴集团控股有限公司 The sort method and device of application App neutron applications
US20180039675A1 (en) * 2016-08-04 2018-02-08 Baidu Online Network Technology (Beijing) Co., Ltd. Extended search method and apparatus
US10353908B1 (en) * 2018-11-12 2019-07-16 Anthem, Inc. Personalized smart provider search
CN110971659A (en) * 2019-10-11 2020-04-07 贝壳技术有限公司 Recommendation message pushing method and device and storage medium
CN111680219A (en) * 2020-06-09 2020-09-18 腾讯科技(深圳)有限公司 Content recommendation method, device, equipment and readable storage medium
CN111709816A (en) * 2020-06-23 2020-09-25 中国平安财产保险股份有限公司 Service recommendation method, device and equipment based on image recognition and storage medium
CN112699305A (en) * 2021-01-08 2021-04-23 网易传媒科技(北京)有限公司 Multi-target recommendation method, device, computing equipment and medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114357294A (en) * 2021-12-30 2022-04-15 北京达佳互联信息技术有限公司 Content recommendation method and device, electronic equipment and storage medium
CN114357294B (en) * 2021-12-30 2023-02-17 北京达佳互联信息技术有限公司 Content recommendation method and device, electronic equipment and storage medium
CN117216318A (en) * 2023-09-11 2023-12-12 中国科学院软件研究所 Short video recommendation method and device based on blogger enhancement

Similar Documents

Publication Publication Date Title
CN110321422B (en) Method for training model on line, pushing method, device and equipment
CN110909182B (en) Multimedia resource searching method, device, computer equipment and storage medium
US9594826B2 (en) Co-selected image classification
US10949000B2 (en) Sticker recommendation method and apparatus
US10825071B2 (en) Adaptive multi-perceptual similarity detection and resolution
CN111966914A (en) Content recommendation method and device based on artificial intelligence and computer equipment
CN111046188A (en) User preference degree determining method and device, electronic equipment and readable storage medium
CN113742578A (en) Data recommendation method and device, electronic equipment and storage medium
CN111400586A (en) Group display method, terminal, server, system and storage medium
CN111078931A (en) Singing sheet pushing method and device, computer equipment and storage medium
CN111382283A (en) Resource category label labeling method and device, computer equipment and storage medium
CN111209477A (en) Information recommendation method and device, electronic equipment and storage medium
CN112100504A (en) Content recommendation method and device, electronic equipment and storage medium
CN115329131A (en) Material label recommendation method and device, electronic equipment and storage medium
CN110008396B (en) Object information pushing method, device, equipment and computer readable storage medium
CN113704620A (en) User label updating method, device, equipment and medium based on artificial intelligence
CN113836388A (en) Information recommendation method and device, server and storage medium
CN112801053B (en) Video data processing method and device
CN113705683A (en) Recommendation model training method and device, electronic equipment and storage medium
CN113821676A (en) Video retrieval method, device, equipment and storage medium
CN111881352A (en) Content pushing method and device, computer equipment and storage medium
CN112257781A (en) Model training method and device
CN112035740A (en) Project use duration prediction method, device, equipment and storage medium
CN112000888B (en) Information pushing method, device, server and storage medium
CN113807749B (en) Object scoring method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination