CN118095355A - Model training method, content screening method and related devices - Google Patents
Model training method, content screening method and related devices Download PDFInfo
- Publication number
- CN118095355A CN118095355A CN202410207684.6A CN202410207684A CN118095355A CN 118095355 A CN118095355 A CN 118095355A CN 202410207684 A CN202410207684 A CN 202410207684A CN 118095355 A CN118095355 A CN 118095355A
- Authority
- CN
- China
- Prior art keywords
- user
- content
- sample
- network
- vectors
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
- G06N3/0455—Auto-encoder networks; Encoder-decoder networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9535—Search customisation based on user profiles and personalisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/213—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/047—Probabilistic or stochastic networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Computation (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Molecular Biology (AREA)
- Computational Linguistics (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Mathematical Physics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Probability & Statistics with Applications (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a model training method, a content screening method and a related device, and relates to the technical field of big data. The method comprises the following steps: acquiring user characteristics of a sample user, content characteristics of sample content accessed by the sample user and labels; inputting the user characteristics into a user sub-network to obtain a plurality of user vectors corresponding to the user characteristics, and inputting the content characteristics into a content sub-network to obtain content vectors corresponding to the content characteristics; determining the access probability of the sample user to the sample content according to the obtained user vector and the content vector; calculating a loss value by using a preset loss function, an access probability and a label; and when judging that the user sub-network is not converged based on the loss value, adjusting network parameters of the user sub-network, and returning to the step of acquiring the user characteristics of the sample user, the content characteristics of the sample content accessed by the sample user and the labels. The method and the device can improve the richness of the screened content.
Description
Technical Field
The invention relates to the technical field of big data, in particular to a model training method, a content screening method and a related device.
Background
To increase the access rate of content, a server typically pushes content of interest to a user to a client.
In the related technology, information related to a user is input into a pre-trained model so that the model outputs a user vector of the user, then content which is interested by the user is screened out of a plurality of contents based on the output user vector, the screened content is ranked according to the interested degree of the user by using a ranking model, and then the content with high interested degree of the user is pushed to a client.
However, the models in the related art usually focus on specific features in the input information, and the output user vector can only represent the specific features about the user, so that the richness of the screened content is not high, and after the screened content is sequenced by the sequencing model, the homogeneity of the pushed content is serious, and the rich experience cannot be brought to the user.
Therefore, how to improve the richness of the screened content is a problem to be solved urgently.
Disclosure of Invention
The embodiment of the invention aims to provide a model training method, a content screening method and a related device so as to improve the richness of screened content. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a model training method, where the training method includes:
Acquiring user characteristics of a sample user, content characteristics of sample content accessed by the sample user and labels; the label is used for representing an access result of the sample user for the sample content;
inputting the user characteristics to a user sub-network for generating user vectors to obtain a plurality of user vectors corresponding to the user characteristics, and inputting the content characteristics to a content sub-network for generating content vectors to obtain content vectors corresponding to the content characteristics;
Determining the access probability of the sample user to the sample content according to the obtained user vector and content vector;
Calculating a loss value by using a preset loss function, the access probability and the label;
and when judging that the user sub-network is not converged based on the loss value, adjusting network parameters of the user sub-network, and returning the user characteristics of the obtained sample user, the content characteristics of the sample content accessed by the sample user and the labels.
Optionally, the acquiring manner of the tag includes:
Detecting an access result of a sample user for sample content according to the access operation of the sample user for the sample content; wherein the accessing operation includes: at least one of click rate, play completion rate, and viewing duration;
And determining a label used for representing the access result of the sample user to the sample content according to the access result.
Optionally, the determining the access probability of the sample user to the sample content according to the obtained user vector and the content vector includes:
selecting a user vector with the similarity meeting a preset similarity condition from a plurality of user vectors as a target user vector;
And obtaining the access probability of the sample user to the sample content according to the target user vector and the content vector.
Optionally, the user sub-network includes a preset transform layer, where the preset transform layer is configured to output a plurality of user vectors corresponding to the user features.
Optionally, the preset loss function is a loss function containing predetermined function content; the predetermined function content is regular term constraint content which is used for controlling the similarity of any two user vectors in a plurality of user vectors output by the user sub-network and is lower than a preset similarity threshold.
Optionally, the content of the predetermined function is:
wherein λ and γ are preset experience parameters, H is the total number of user vectors corresponding to the user features output by the user sub-network, O i is the ith user vector, and O j is the jth user vector.
Optionally, the user features include: at least one of user identification, age, sex, member attribute, login attribute, viewing history behavior attribute, click history behavior attribute, long-term portrait and short-term portrait of the sample user;
The content features include: at least one of content identification, content type, content uploading personnel identification and content uploading personnel attribute of the sample content.
In a second aspect, an embodiment of the present invention provides a content screening method, where the method includes:
In response to receiving a content acquisition request containing a user identifier, acquiring user characteristics of a target user represented by the user identifier based on the user identifier;
Inputting user characteristics of a target user as input content to a user sub-network so that the user sub-network outputs a plurality of user vectors; the user sub-network is a network which is obtained based on training of the model training method;
determining a plurality of target contents in a plurality of candidate contents based on the content vectors corresponding to the user vectors and the candidate contents; wherein the plurality of target contents comprise: and utilizing the user vectors to match the obtained candidate content.
Optionally, the similarity of any two user vectors among the plurality of user vectors output by the user sub-network is lower than a preset similarity threshold.
Optionally, the determining process of the plurality of target contents includes:
Splicing the plurality of user vectors into a target user vector;
Processing the content vectors corresponding to the target user vectors and the candidate contents based on a preset algorithm to determine a specified number of content vectors; the preset algorithm is used for selecting a specified number of content vectors with the distance from the target user vector being within a preset distance threshold range;
And taking the candidate contents corresponding to the specified number of content vectors as a plurality of target contents.
In a third aspect, an embodiment of the present invention provides a model training apparatus, including:
The first acquisition module is used for acquiring user characteristics of a sample user, content characteristics of sample content accessed by the sample user and labels; the label is used for representing an access result of the sample user for the sample content;
the first input module is used for inputting the user characteristics to a user sub-network for generating user vectors, obtaining a plurality of user vectors corresponding to the user characteristics, and inputting the content characteristics to a content sub-network for generating content vectors, obtaining the content vectors corresponding to the content characteristics;
the first determining module is used for determining the access probability of the sample user to the sample content according to the obtained user vector and the content vector;
the calculating module is used for calculating a loss value by using a preset loss function, the access probability and the label;
and the adjusting module is used for adjusting network parameters of the user sub-network when judging that the user sub-network is not converged based on the loss value, and returning the user characteristics of the acquired sample user, the content characteristics of the sample content accessed by the sample user and the labels.
In a fourth aspect, an embodiment of the present invention provides a content screening apparatus, including:
The second acquisition module is used for responding to a received content acquisition request containing a user identifier and acquiring the user characteristics of a target user represented by the user identifier based on the user identifier;
The second input module is used for taking the user characteristics of the target user as input contents and inputting the input contents into the user sub-network so that the user sub-network outputs a plurality of user vectors; the user sub-network is a network which is obtained based on training of the model training device;
The second determining module is used for determining a plurality of target contents in a plurality of candidate contents based on the content vectors corresponding to the user vectors and the candidate contents; wherein the plurality of target contents comprise: and utilizing the user vectors to match the obtained candidate content.
The embodiment of the invention also provides electronic equipment, which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface, and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the model training method and the content screening method when executing the programs stored in the memory.
The embodiment of the invention also provides a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and the computer program realizes the model training method and the content screening method when being executed by a processor.
According to the model training method provided by the embodiment of the invention, the user characteristics of the obtained sample user are input into a user sub-network to be trained for generating user vectors, a plurality of user vectors corresponding to the user characteristics are obtained, the content characteristics of sample contents accessed by the obtained sample user are input into a content sub-network for generating the content vectors, and the content vectors corresponding to the content characteristics are obtained; according to the user vector and the content vector, determining the access probability of the sample user for the sample content, calculating a loss value by using a preset loss function, the access probability and a label for representing the access result of the sample user for the sample content, adjusting network parameters of the user sub-network when judging that the user sub-network is converged based on the loss value, and returning to the step of acquiring the user characteristics, the content characteristics and the label. The user sub-network trained based on the model training method provided by the scheme can output various user vectors, and the richness of the screened content is improved.
In addition, in the content screening method provided by the embodiment of the invention, the user characteristics of the target user are used as input content and are input into the user sub-network trained by the model training method provided by the embodiment of the invention to obtain a plurality of user vectors, and then a plurality of target contents are determined in a plurality of candidate contents based on the content vectors corresponding to the plurality of user vectors and each candidate content; because the plurality of target contents comprise candidate contents which are obtained by matching the user vectors, the determined plurality of target content vectors comprise a plurality of specific characteristics related to the user, and therefore, the method can improve the richness of the determined plurality of target contents and the richness of the screened contents.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
FIG. 1 is a flow chart of a first model training method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a second model training method according to an embodiment of the present invention;
Fig. 3 is a flowchart of a first content screening method according to an embodiment of the present invention;
Fig. 4 is a flowchart of a second content screening method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a dual tower model structure according to an embodiment of the present invention;
Fig. 6 is a flowchart of a third content screening method according to an embodiment of the present invention;
Fig. 7 is a schematic structural diagram of a user sub-network according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a model training device according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a content screening apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.
For a better understanding of embodiments of the present invention, the prior art is described below.
To increase the access rate of content, a server typically pushes content of interest to a user to a client. For example, a server in a video recommendation system may push a video to a client of a user interested in the video, where a user interested in any video may also be referred to as a user matching the video interest.
In the related art, in order to reduce the computing pressure and hardware overhead, in a recommendation process of pushing content to a client, there is a process of pre-screening a content set containing a plurality of contents to reduce the pressure of a sorting process, and by way of example, it is generally avoided to sort a massive content set directly by using a sorting model, firstly, information related to a user is input into a pre-trained model to enable the model to output a user vector of the user, then, based on the output user vector, content which is more interested by the user is screened out of the content set containing the plurality of contents, and then, after the screened content is sorted according to the interested degree of the user by using the sorting model, content with high interested degree of the user is pushed to the client.
However, models in the related art are typically focused on specific features in the input information, and the output user vector can only characterize specific features about the user; illustratively, based on the historical past behavior of the user, a user vector is generated for the user that characterizes only one particular feature of the user, with the screened content being dominated by the user's recent interests. The quality of the pushed content can be determined by the screened content, the richness of the content screened by applying the related technology is not high, and after the screened content is sequenced by the sequencing model, the pushed content is serious in homogeneity and cannot bring rich experience to the user.
Therefore, how to improve the richness of the screened content is a problem to be solved urgently.
In order to improve the richness of the screened content, the embodiment of the invention provides a model training method, a content screening method and a related device.
The following first describes a model training method provided by the embodiment of the present invention.
The model training method provided by the embodiment of the invention can be applied to electronic equipment, the electronic equipment is particularly used for training a model, and in the specific application, the electronic equipment can be a smart phone, a tablet personal computer and the like, which are all reasonable.
The model training method provided by the embodiment of the invention can comprise the following steps:
Acquiring user characteristics of a sample user, content characteristics of sample content accessed by the sample user and labels; the label is used for representing an access result of the sample user for the sample content;
inputting the user characteristics to a user sub-network for generating user vectors to obtain a plurality of user vectors corresponding to the user characteristics, and inputting the content characteristics to a content sub-network for generating content vectors to obtain content vectors corresponding to the content characteristics;
Determining the access probability of the sample user to the sample content according to the obtained user vector and content vector;
Calculating a loss value by using a preset loss function, the access probability and the label;
and when judging that the user sub-network is not converged based on the loss value, adjusting network parameters of the user sub-network, and returning the user characteristics of the obtained sample user, the content characteristics of the sample content accessed by the sample user and the labels.
According to the model training method provided by the embodiment of the invention, the user characteristics of the obtained sample user are input into a user sub-network to be trained for generating user vectors, a plurality of user vectors corresponding to the user characteristics are obtained, the content characteristics of sample contents accessed by the obtained sample user are input into a content sub-network for generating the content vectors, and the content vectors corresponding to the content characteristics are obtained; according to the user vector and the content vector, determining the access probability of the sample user for the sample content, calculating a loss value by using a preset loss function, the access probability and a label for representing the access result of the sample user for the sample content, adjusting network parameters of the user sub-network when judging that the user sub-network is converged based on the loss value, and returning to the step of acquiring the user characteristics, the content characteristics and the label. The user sub-network trained based on the model training method provided by the scheme can output various user vectors, and the richness of the screened content is improved.
The following describes a model training method provided by the embodiment of the invention with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a model training method according to an embodiment of the present invention, and as shown in fig. 1, the method may include steps S101 to S105.
S101, acquiring user characteristics of a sample user, content characteristics of sample content accessed by the sample user and labels.
The tag is used for representing an access result of the sample user for the sample content.
It will be appreciated that the user characteristics of the sample user, the content characteristics of the sample content accessed by the sample user, and the labels may be collectively referred to as training samples, one training sample may be generated each time a sample user accesses a sample content, and multiple training samples may be directly acquired for training when training the model. When a client of a sample user plays a video content, the user characteristics of the sample user and the content characteristics of the video content may be used as input sample data in training samples of a user sub-network and a content sub-network to be input, the client sends the playing condition of the video content to a server, and the server determines a label of the training sample according to the playing condition of the video content.
Optionally, in the process that the sample user accesses the sample content, the click operation of the sample user on the client can be responded, and the client displays the sample content selected by the click operation; in the process that the sample user accesses the sample content, the sample content can also be directly displayed at a preset display position of the client, wherein the preset display position can be a position in a recommendation interface of the client. It should be noted that, whether the sample content is displayed by the clicking operation or the sample content is displayed directly, the displayed sample content may be the sample content accessed by the sample user, that is, the sample content accessed by the sample user may be the sample content directly displayed in the client, or the sample content clicked by the sample user, for example, the sample content accessed by the sample user may be a video clicked by the sample user, or may be a video automatically played in a recommendation interface of the client. The embodiment of the present invention is merely illustrative, and not limited to, a specific manner in which a sample user accesses sample content and a specific definition of sample content. In the scheme, sample content selected by clicking operation for display and sample content directly displayed are used as sample content in a training sample, so that the data size of the training sample is increased, and the accuracy of a model to be trained is improved; moreover, the sample content directly displayed by the client is not the content which is actively clicked and accessed by the sample user, and the sample content directly displayed by the client can contain the potential interests which are never found by the sample user, so that the user sub-network trained based on the sample content directly displayed by the client can pay attention to the content which the user cannot actively pay attention to, the potential interests which are never found by the user are mined, and the richness of the screened content is improved.
Optionally, in one implementation, the user feature includes: at least one of user identification, age, sex, member attribute, login attribute, viewing history behavior attribute, click history behavior attribute, long-term portrait and short-term portrait of the sample user;
The content features include: at least one of content identification, content type, content uploading personnel identification and content uploading personnel attribute of the sample content.
It will be appreciated that in the user feature, the user identification of the sample user may be an identity of the sample user, such as an identity ID (Identity Document, identity number); the age may be a specific age value of the sample user, or a value for identifying an age range, so as to identify the age of the sample user, and reduce the workload of generating the user vector based on the user characteristics, for example, 1 indicates that the age range is 20-30 years old, 2 indicates that the age range is 30-40 years old, and the embodiment of the present invention is merely illustrative and not particularly limited for the specific form of the age in the user characteristics; gender is the gender of the sample user, and may be exemplified by 1 for female gender and 0 for male gender; the member attribute is used for representing whether the sample user is a member of the client; the login attribute is used for indicating whether the sample user logs in the personal account number of the sample user when accessing the sample content; the viewing history behavior attribute is used for representing whether the sample content is the sample content directly displayed by the client; the click history behavior attribute is used for representing whether the sample content is the sample content selected by the click operation of the sample user; the long-term portrait is a user portrait generated by analyzing the behaviors of the sample user in a specified long time based on a user portrait model, for example, the long-term portrait is a user portrait generated by analyzing the behaviors of the sample user in nearly half a year, and the long-term portrait can stably represent the user characteristics of the sample user; the short-term portraits are based on a user portraits model, and are generated by analyzing the behaviors of a sample user in a specified short time, for example, the short-term portraits are generated by analyzing the behaviors of the sample user in seven days, and the short-term portraits can timely represent the user characteristics of the sample user; the long-term representation characterizes the sample user with a higher stability of user characteristics than the short-term representation, but with less real-time.
It will be appreciated that in the content feature, the content identification of the sample content is used to identify the sample content; the content type of the sample content may be a pre-divided category; the content uploading personnel identifier can be an identity identifier of a personnel uploading the sample content to the server; the content upload personnel attribute may be a personnel type of a person uploading the sample content to the server. For example, if the sample content is video content, the content type may be documentaries, cartoon or comedy, etc.; the client side and the server side serve as a free content sharing platform, a person can upload content to the server side by himself through the client side, the identity of the person serves as a content uploading person attribute, the person type of the person can be a pre-divided person type, such as an entertainment type, a makeup type, a history type and the like, and the person type of the person serves as a content uploading person attribute.
When a sample user accesses sample content, the server side can acquire a user identifier, a login attribute, a viewing history behavior attribute and a clicking history behavior attribute of the sample user according to an access instruction of the client side to access the sample content; after the service end obtains the user identification, at least one of age, sex, member attribute, long-term portrait and short-term portrait of the sample user can be obtained from the database storing the user information according to the user identification. The server side can acquire the content identifier of the sample content according to the access instruction of the sample content, and acquire at least one of the content type, the content uploading personnel identifier and the content uploading personnel attribute of the sample content from the database storing the content information according to the content identifier of the sample content.
In the scheme, the user characteristics utilized in the training model can comprise user personal information, related information of user watching or clicking content and long-term portrait of the user, the content characteristics can comprise basic information of the content, abundant and various information is used as training samples, and the user personalized information is fully utilized for model training, so that the training samples can comprise different interests and hobbies owned by most users, and interests of the users which are not discovered are continuously discovered while the interests of the users are discovered.
Optionally, in an implementation manner, the tag obtaining manner includes steps A1-A2.
A1, detecting an access result of a sample user for sample content according to the access operation of the sample user for the sample content.
Wherein the accessing operation includes: at least one of click-through rate, play-out rate, and viewing duration.
A2, determining a label used for representing the access result of the sample user to the sample content according to the access result.
It may be appreciated that in the process that the sample user accesses the sample content, the client may establish a connection with the server through the access instruction, and send an access operation to the server, where the access operation may characterize a content presentation situation, and the access operation may include at least one of a click rate, a play completion rate, and a viewing duration. Since the access operation can characterize the condition of the content presentation, the access result of the sample user to the sample content can be detected through the access operation. For example, if the sample content is video content, the click rate of the video content is high, the play completion rate is high, and the viewing time is long, and the access result of the sample user for the video content is access. For example, if the click rate exceeds the preset click index value, the completion rate exceeds the preset completion index value, and/or the viewing duration exceeds the preset duration index value, it may be determined that the access result of the sample user to the sample content is access; if the click rate is lower than the preset click index value, the finishing rate is lower than the preset finishing index value, and/or the checking duration is lower than the preset duration index value, the access result of the sample user to the sample content can be determined to be unaccessed. Optionally, under the condition that the access result of the sample user to the sample content is detected to be access, a positive label can be set for a training sample containing user characteristics and content characteristics, wherein the positive label characterizes the access result of the sample user to the sample content in the training sample as access; and setting a negative label for a training sample containing user characteristics and content characteristics under the condition that the access result of the sample user to the sample content is detected to be unvisited, wherein the negative label is used for representing that the access result of the sample user to the sample content in the training sample is unvisited.
It should be noted that, the access result of the sample user to the sample content is used to characterize the willingness of the sample user to access the sample content, and may also be understood as whether the sample user is interested in the sample content.
According to the scheme, the access result of the sample user for the sample content is detected according to the access operation, and then the label of the training sample is determined according to the access result, so that the label can be accurately set for the training sample, and the accuracy of model training is improved.
S102, inputting the user characteristics to a user sub-network for generating user vectors to obtain a plurality of user vectors corresponding to the user characteristics, and inputting the content characteristics to a content sub-network for generating content vectors to obtain the content vectors corresponding to the content characteristics.
It will be appreciated that the network structure of the user sub-network may be preset, and the user sub-network may extract a plurality of user vectors for the input user features based on its own network structure. The content sub-network may be a pre-trained network model, the content network may be obtained by inputting the content features into the content sub-network, and the content network may characterize the content features of the sample content. The content subnetwork may be, for example, a trained DNN (Dynamic Neural Network ) network structure. Alternatively, the content subnetwork may be a network to be trained, and in the process of training the user subnetwork, the content subnetwork may also be trained, which is not specifically limited and only illustrated in the embodiment of the present invention.
Alternatively, the user sub-network and the content sub-network may adopt a dual-tower model structure, and the user sub-network and the content sub-network may be used as a main network of the dual-tower model structure.
Optionally, in an implementation manner, the user sub-network includes a preset transform layer, where the preset transform layer is configured to output a plurality of user vectors corresponding to the user features.
It will be appreciated that the user sub-network may include a preset transform layer, and the preset transform layer is configured to output a plurality of user vectors corresponding to the user features, and illustratively, the input user features are processed based on the attention network and the full connection layer superimposed in the transform layer, and the plurality of user vectors are output through a plurality of linear transformation layers and a softmax layer in the transform layer.
It should be noted that, based on the relationship between each part of the user characteristics and other parts in each user vector output by the transducer layer, in the model, the relationship may be a specific characteristic, which may also be referred to as a user interest, and the specific characteristics of any two user vectors may be similar or dissimilar.
In the scheme, a plurality of user vectors corresponding to the user characteristics are acquired based on a transducer layer included in the user sub-network, so that the richness of the content screened based on the plurality of user vectors is ensured.
S103, determining the access probability of the sample user for the sample content according to the obtained user vector and the content vector.
It will be appreciated that the user vector may characterize the user characteristics of the sample user, the content vector may characterize the content characteristics of the sample content, and the probability of access of the sample user to the sample content may be determined based on the distance between a user vector and a content vector in the vector space.
S104, calculating a loss value by using a preset loss function, the access probability and the label.
It can be appreciated that, since the tag is used to characterize the access result of the sample user to the sample content, the tag can be used as a true value, and the calculated loss value can characterize the gap between the access probability and the true value by using the preset loss function, the access probability and the tag.
Optionally, in an implementation manner, the preset loss function is a loss function including predetermined function content, where the predetermined function content is regular term constraint content used for controlling similarity of any two user vectors in the plurality of user vectors output by the user sub-network, and the regular term constraint content is lower than a preset similarity threshold.
It is understood that the function content of the preset loss function may include: the predetermined function content and the specified loss function content can be used for calculating the loss value to be utilized of a single training sample by using the access probability and the specified loss function, and the loss value can be obtained by adding the loss value to be utilized and the regular term constraint content serving as the predetermined function content.
The loss value calculated by using a single training sample composed of the user characteristics of one sample user and the content characteristics of one sample content is the loss value of the single training sample, and if a large number of training samples are input to the user sub-network and the content sub-network, the loss values of the training samples need to be accumulated to generate a final total loss value.
For example, the specified loss function may be a cross entropy loss function, specifically, for any training sample, the function content is:
Wherein the training sample set comprises a plurality of training samples, each training sample comprises a sample user, a sample content and a label of the sample content, and, for any training sample, O m is the most similar user vector among a plurality of user vectors of the sample user in the training sample to the content vector of the sample content in the training sample, e i is the content vector of the sample content in the training sample, The access probability of the training sample is that of a sample user in the training sample aiming at sample content; exp is an exponential function based on a natural constant e, I is a total number of a plurality of preset sample contents, and the plurality of preset sample contents may at least include: sample content in the training sample set and/or sample content of the continuously updated training samples, e k is a content vector of kth sample content in the plurality of sample contents with the number of I.
Alternatively, in specifying the loss function,Also denoted as P θ (i|m).
It should be noted that, the specified loss function may be a negative sampling loss function commonly used in the recall model field, and the content of the cross entropy loss function is only illustrated herein, and is not limited in particular.
Optionally, in one implementation, for any training sample, that is, for a plurality of user vectors corresponding to any user feature, the predetermined function content is:
wherein λ and γ are preset experience parameters, H is the total number of user vectors corresponding to the user features output by the user sub-network, O i is the ith user vector, and O j is the jth user vector.
It can be understood that, according to the historical data, the empirical parameters may be preset as λ and γ, H is the total number of user vectors corresponding to the user features output by the user sub-network, O i is the ith user vector, O j is the jth user vector, for example, the total number of user vectors is 4,O 1 is the 1 st user vector, O 2 is the 2 nd user vector, O 3 is the 3 rd user vector, O 4 is the 4 th user vector, and the similarity of any two user vectors in the four user vectors may be constrained to be lower than the preset similarity threshold by the content of the predetermined function.
In the scheme, the loss value is calculated by utilizing the preset loss function containing the preset function content, so that the accuracy of a training model can be improved, the trained user sub-network can output a plurality of dissimilar user vectors, the diversity of specific features contained in the user vectors is improved, and the richness of the screened content is further improved.
Optionally, if there is only one training sample, the function content of the loss value calculated by using the preset loss function, the access probability and the tag may be:
The total_loss is a loss value of a single training sample, loss is a loss value to be utilized calculated by using a specified loss function, the function content of loss can be the specified loss function, and the specific function content of the specified loss function can be:
If training is performed by using a training sample set including a plurality of training samples, the loss value calculated by using the preset loss function, the access probability and the label is the accumulation of the loss values of the training samples, and the specific function content may be:
Wherein, I u is the total number of the plurality of sample contents in the training sample set; u is the total number of multiple sample users in the training sample set.
And S105, when judging that the user sub-network is not converged based on the loss value, adjusting network parameters of the user sub-network, and returning to the step of acquiring the user characteristics of the sample user, the content characteristics of the sample content accessed by the sample user and the labels.
It can be understood that if the loss value does not reach the preset loss threshold, the model is not trained, the user sub-network is not converged, the network parameters of the user sub-network are adjusted, and then a training sample is obtained to train the user sub-network.
According to the model training method provided by the embodiment of the invention, the user characteristics of the obtained sample user are input into a user sub-network to be trained for generating user vectors, a plurality of user vectors corresponding to the user characteristics are obtained, the content characteristics of sample contents accessed by the obtained sample user are input into a content sub-network for generating the content vectors, and the content vectors corresponding to the content characteristics are obtained; according to the user vector and the content vector, determining the access probability of the sample user for the sample content, calculating a loss value by using a preset loss function, the access probability and a label for representing the access result of the sample user for the sample content, adjusting network parameters of the user sub-network when judging that the user sub-network is converged based on the loss value, and returning to the step of acquiring the user characteristics, the content characteristics and the label. The user sub-network trained based on the model training method provided by the scheme can output various user vectors, and the richness of the screened content is improved.
In the scheme, the user characteristics utilized in the training model can comprise user personal information, related information of user watching or clicking content and long-term portrait of the user, the content characteristics can comprise basic information of the content, and abundant and various information is used as training samples and integrated into a transformer network, so that a user sub-network can capture the correlation between the content accessed by the user, capture multi-interest expression of the user, and enable recommendation results to be accurate and rich on the premise of meeting the actual conditions that most users have different volunteers and hobbies, and prevent the impression fatigue brought by content homogenization; and through a plurality of user vectors output by the user sub-network, the screened content is ensured to contain a plurality of interest representations, and the personalized recommended 'thousands of people and thousands of faces' are upgraded to 'thousands of people and everywhere faces'. In addition, the user characteristics of the sample user and the sample content actively clicked and accessed by the sample user can contain the existing interests of the sample user, and the user sub-network obtained by training based on the user characteristics of the sample user and the sample content actively clicked and accessed by the sample user can extract the existing interests of the user aiming at the user characteristics of the user; the sample content directly displayed by the client can contain potential interests which are never found by the sample user, and the user sub-network trained based on the sample content directly displayed by the client can pay attention to the content which the user cannot actively pay attention to.
Optionally, in another embodiment, as shown in fig. 2, step S103 includes steps S1031 and S1032 based on the model training method shown in fig. 1.
S1031, selecting a user vector with the similarity meeting a preset similarity condition from the plurality of user vectors as a target user vector.
It can be understood that in the process of training the user sub-network, the content vector can represent the content characteristics of the sample content accessed by the sample user, and under the condition that the content characteristics of the sample content are known, the user vector of the sample user with the most likely access result can be directly selected as the target user vector; for example, given that the content type of the sample content a is an animation, among the user vectors 1, 2, 3, and 4 of the sample user, only the specific feature represented by the user vector 1 can indicate that the sample user likes to watch the animation, and the user vector 1 can be regarded as the target user vector.
Alternatively, among the plurality of user vectors, a user vector having the highest similarity to the content vector may be selected as the target user vector. Illustratively, distances between a plurality of user vectors and the content vector are calculated, and the user vector closest to the content vector is taken as the target user vector.
S1032, according to the target user vector and the content vector, obtaining the access probability of the sample user for the sample content.
It can be understood that the vector operation process can be performed on the target user vector and the content vector to obtain an operation result, and the operation result can be used as the access probability. For example, the target user vector and the content vector may be subjected to vector dot product processing, so as to obtain the access probability of the sample user to the sample content. For example, the target user vector is user embedding, the content vector is item embedding, and the access probability is user embedding × item embedding.
In the scheme, only one user vector is selected in the process of training the user sub-network, the access probability is calculated, the model training efficiency can be improved, the similarity between the selected user vector and the content vector is highest, the accuracy of the access probability can be improved, and the model training accuracy is further improved.
The following describes a content screening method provided by the embodiment of the invention.
The content screening method provided by the embodiment of the invention can be applied to electronic equipment, the electronic equipment is particularly used for screening a plurality of target contents for sorting, and in the specific application, the electronic equipment can be a smart phone, a tablet personal computer and the like, so that the method is reasonable.
The embodiment of the invention provides a content screening method, which comprises the following steps:
In response to receiving a content acquisition request containing a user identifier, acquiring user characteristics of a target user represented by the user identifier based on the user identifier;
Inputting user characteristics of a target user as input content to a user sub-network so that the user sub-network outputs a plurality of user vectors; the user sub-network is a network trained based on the model training method described in the foregoing embodiment;
determining a plurality of target contents in a plurality of candidate contents based on the content vectors corresponding to the user vectors and the candidate contents; wherein the plurality of target contents comprise: and utilizing the user vectors to match the obtained candidate content.
In the content screening method provided by the embodiment of the invention, user characteristics of a target user are used as input content and are input into a user sub-network trained by the model training method provided by the embodiment of the invention to obtain a plurality of user vectors, and then a plurality of target contents are determined in a plurality of candidate contents based on the plurality of user vectors and content vectors corresponding to each candidate content; because the plurality of target contents comprise candidate contents which are obtained by matching the user vectors, the determined plurality of target content vectors comprise a plurality of specific characteristics related to the user, and therefore, the method can improve the richness of the determined plurality of target contents and the richness of the screened contents.
The following describes a content screening method provided by an embodiment of the present invention with reference to the accompanying drawings.
Fig. 3 is a flow chart of a content screening method according to an embodiment of the present invention, as shown in fig. 3, the method may include steps S301 to S303.
S301, in response to receiving a content acquisition request containing a user identifier, acquiring user characteristics of a target user represented by the user identifier based on the user identifier.
It will be appreciated that prior to ranking the content of interest to the target user using the ranking model, the screening of the content of interest to the target user may be performed to obtain user characteristics of the target user from a database storing user information of the target user. The user characteristics specifically include similar information types to those of the sample user in the foregoing embodiment, and will not be described in detail herein.
For example, a server executing the content filtering method may receive a content acquisition request including a user identifier, and the server acquires, based on the user identifier in the content acquisition request, a user feature of a target user represented by the user identifier.
S302, user characteristics of a target user are used as input contents and are input into a user sub-network, so that the user sub-network outputs a plurality of user vectors.
The user sub-network is a network trained by the model training method provided by the embodiment of the invention.
It can be understood that after the user characteristics of the target user are input into the user sub-network trained based on the model training method provided by the embodiment of the invention, the user sub-network can output a plurality of user vectors.
Optionally, in one implementation, the similarity of any two user vectors among the plurality of user vectors output by the user sub-network is lower than a preset similarity threshold.
It can be understood that the user sub-network trained by the model training method can output a plurality of user vectors, and the similarity of any two user vectors is lower than a preset similarity threshold value, so that the plurality of user vectors can be focused on different specific features, and the richness of the screened content is improved.
S303, determining a plurality of target contents in a plurality of candidate contents based on the content vectors corresponding to the user vectors and the candidate contents.
Wherein the plurality of target contents comprise: and utilizing the user vectors to match the obtained candidate content.
It may be understood that content vectors corresponding to a plurality of candidate contents may be obtained in advance, the plurality of content vectors may be determined according to the similarity between each user vector and the content vector corresponding to the plurality of candidate contents, the determined candidate content corresponding to the content vector is used as target content, the target content is the accessed content of the access result of the target user, the plurality of target content includes the candidate content obtained by matching with each user vector, the determined plurality of target content vectors include a plurality of specific features related to the user, and in other schemes, the content interested by the target user may be selected by sorting the plurality of target content using a sorting model.
In the scheme, the user sub-network can output a plurality of user vectors with low similarity, so that different specific characteristics can be focused by utilizing the user vectors output by the user sub-network, the target content screened out based on the plurality of different user vectors can cover various interests of the user, the content interested by the target user can be selected by sequencing the plurality of target content by utilizing the sequencing model, the click rate of the selected content can be improved by pushing the selected content to the client of the target user, the richness of the pushed content can be improved, and rich experience is brought for the target user.
Alternatively, in another embodiment, as shown in fig. 4, in the content screening method shown in fig. 3, the determining process of the plurality of target contents includes steps S401 to S403.
S401, splicing a plurality of user vectors into a target user vector.
It will be appreciated that the plurality of user vectors output by the user sub-network may be stitched into a target user vector, which may be indicative of a plurality of interests of the target user, as the plurality of user vectors may be able to focus on different specific features, and thus may be able to include a plurality of specific features.
S402, processing the content vectors corresponding to the target user vectors and the candidate contents based on a preset algorithm to determine a specified number of content vectors.
The preset algorithm is used for selecting a specified number of content vectors with the distance from the target user vector being within a preset distance threshold range.
S403, using the candidate content corresponding to the content vectors with the specified number as a plurality of target contents.
It can be understood that the target user vector can represent various interests of the target user, based on a preset algorithm, the matching degree of the interests of the target user and the candidate contents can be detected, and a specified number of candidate contents with higher matching degree are taken as the target contents, wherein the matching degree can be represented by the similarity between the target user vector and the content vector of the candidate contents, and can also be represented by the distance between the target user vector and the content vector of the candidate contents in a vector space. The preset algorithm may be a nearest neighbor algorithm, and the distance between the target user vector and the content vectors of the plurality of candidate contents may be calculated by using the nearest neighbor algorithm, K content vectors closest to the target user vector are determined, and K candidate contents corresponding to the determined content vectors are used as the target contents.
Optionally, since the target user vector is a spliced vector, the dimension of the target user vector may be higher than the content vector, and after the target user vector is obtained by splicing, the dimension of the target user vector may be reduced, so as to obtain a target user vector with the same dimension as the content vector, so that the target user vector and the content vector may be processed conveniently.
In the scheme, a plurality of user vectors are spliced into the target user vector capable of representing various interests of the user, the accuracy of determining the target content can be improved by processing the target user vector and the content vector of the candidate content through a preset algorithm, the target content which is accessed as the access result of the target user is screened out, the richness of the pushed content is improved, and rich experience is brought to the target user.
Alternatively, in order to better understand the model training method provided by the embodiment of the present invention, the model training method is described below with reference to fig. 5.
As shown in fig. 5, in the model training process, a dual-tower model structure formed by a user sub-network and a content sub-network may be adopted, user features of a sample user are input into the user sub-network, and an activation function layer in the user sub-network may increase a linear expression for the user features, where the activation function layer may be referred to as RELU layers; outputting a user vector 1, a user vector 2, a user vector 3 and a user vector 4 through a transducer layer; the content characteristics of the sample content are input into a content sub-network, the content sub-network is a DNN network, three activation function layers exist, and the content sub-network can output the content vector of the sample content. Wherein the user characteristics include: at least one of user identification, age, gender, membership attribute, login attribute, viewing history behavior attribute, click history behavior attribute, long-term portrait, short-term portrait of the sample user; the content features include: at least one of a content identification, a content type, a content upload personnel identification, and a content upload personnel attribute of the sample content.
Selecting a user vector with similarity meeting a preset similarity condition from a plurality of user vectors as a target user vector; and carrying out vector dot product processing on the target user vector and the content vector to obtain the access probability of the sample user to the sample content. For example, the target user vector is user embedding, the content vector is item embedding, and the access probability is user embedding × item embedding. Calculating a loss value by using a preset loss function, the access probability and the label; and when judging that the user sub-network is not converged based on the loss value, adjusting network parameters of the user sub-network, and returning the user characteristics of the obtained sample user, the content characteristics of the sample content accessed by the sample user and the labels.
According to the model training method provided by the embodiment of the invention, the user characteristics of the obtained sample user are input into a user sub-network to be trained for generating user vectors, a plurality of user vectors corresponding to the user characteristics are obtained, the content characteristics of sample contents accessed by the obtained sample user are input into a content sub-network for generating the content vectors, and the content vectors corresponding to the content characteristics are obtained; according to the user vector and the content vector, determining the access probability of the sample user for the sample content, calculating a loss value by using a preset loss function, the access probability and a label for representing the access result of the sample user for the sample content, adjusting network parameters of the user sub-network when judging that the user sub-network is converged based on the loss value, and returning to the step of acquiring the user characteristics, the content characteristics and the label. The user sub-network trained based on the model training method provided by the scheme can output various user vectors, and the richness of the screened content is improved.
Alternatively, in order to better understand the content screening method provided by the embodiment of the present invention, the content screening method is described below with reference to fig. 6.
Fig. 6 is a flow chart of a content screening method, as shown in fig. 6, the content screening method includes steps S601-S605.
S601, generating a training sample containing user characteristics and content characteristics.
It can be appreciated that the user characteristics of the sample user, the content characteristics of the sample content accessed by the sample user, and the tags can be obtained, a training sample including the user characteristics and the content characteristics is generated, and the obtained tags are used as the tags of the training sample.
S602, training a deep neural network model.
It can be understood that the user characteristics can be input to a user sub-network to be trained for generating user vectors, so as to obtain a plurality of user vectors corresponding to the user characteristics, and the content characteristics can be input to a content sub-network for generating content vectors, so as to obtain content vectors corresponding to the content characteristics; wherein the user characteristics include: at least one of user identification, age, gender, membership attribute, login attribute, viewing history behavior attribute, click history behavior attribute, long-term portrait, short-term portrait of the sample user; the content features include: at least one of a content identification, a content type, a content upload personnel identification, and a content upload personnel attribute of the sample content. Then, according to the obtained user vector and content vector, determining the access probability of the sample user for the sample content; calculating a loss value by using a preset loss function, the access probability and the label; and when judging that the user sub-network is not converged based on the loss value, adjusting network parameters of the user sub-network, and training the user sub-network by using a training sample.
S603, model prediction.
Inputting the user characteristics of the target user as input content to the trained user sub-network so that the user sub-network outputs a plurality of user vectors; and determining a plurality of target contents in the plurality of candidate contents based on the content vectors corresponding to the user vectors and the candidate contents.
S604, a recall candidate set containing a plurality of target content is generated.
S605, recommending the content.
It can be appreciated that the ranking model can be utilized to rank a plurality of target content, so that content with high interest level of the user can be pushed to the client.
In the scheme, the user sub-network capable of outputting a plurality of user vectors with low similarity is trained, the trained user sub-network is utilized to screen out the target content with high richness, a recall candidate set containing a plurality of target content is obtained, the plurality of target content in the recall candidate set is ordered, personalized recommendation of the content can be realized, and the richness of the recommended content is improved.
Alternatively, in order to better understand the content screening method provided by the embodiment of the present invention, the content screening method is described below with reference to fig. 7.
Fig. 7 is a schematic structural diagram of a trained user sub-network, as shown in fig. 7, in the process of content screening by applying the user sub-network, user characteristics of a target user may be input into the user sub-network, an activation function layer in the user sub-network may increase a linear expression for the user characteristics, and then a user vector 1, a user vector 2, a user vector 3 and a user vector 4 may be output through a transducer layer. The user characteristics of the input user sub-network may include at least one of a user identification, an age, a sex, a member attribute, a login attribute, a viewing history behavior attribute, a click history behavior attribute, and a long-term portrait, a short-term portrait of the target user. Then, at a user vector splicing layer, splicing a plurality of user vectors into a target user vector; processing the content vectors corresponding to the target user vectors and the candidate contents based on a preset algorithm to determine a specified number of content vectors; the preset algorithm is used for selecting a specified number of content vectors with the distance from the target user vector being within a preset distance threshold range; candidate contents corresponding to the specified number of content vectors are used as a plurality of target contents; the plurality of target contents comprise candidate contents which are obtained by matching the user vectors.
In the scheme, user characteristics of a target user are used as input contents and are input into a user sub-network trained by the model training method provided by the embodiment of the invention to obtain a plurality of user vectors, and then a plurality of target contents are determined in a plurality of candidate contents based on the content vectors corresponding to the plurality of user vectors and each candidate content; because the plurality of target contents comprise candidate contents which are obtained by matching the user vectors, the determined plurality of target content vectors comprise a plurality of specific characteristics related to the user, and therefore, the method can improve the richness of the determined plurality of target contents and the richness of the screened contents.
Based on the foregoing model training method, the embodiment of the present invention further provides a model training device, as shown in fig. 8, where the device includes:
A first obtaining module 810, configured to obtain a user characteristic of a sample user, a content characteristic of sample content accessed by the sample user, and a tag; the label is used for representing an access result of the sample user for the sample content;
A first input module 820, configured to input the user feature to a user sub-network for generating a user vector, obtain a plurality of user vectors corresponding to the user feature, and input the content feature to a content sub-network for generating a content vector, obtain a content vector corresponding to the content feature;
A first determining module 830, configured to determine, according to the obtained user vector and content vector, an access probability of the sample user for the sample content;
a calculating module 840, configured to calculate a loss value using a preset loss function, the access probability, and the tag;
an adjustment module 850, configured to adjust network parameters of the user subnetwork when it is determined that the user subnetwork is not converged based on the loss value, and return the user characteristics of the obtained sample user, the content characteristics of the sample content accessed by the sample user, and the label to the step of obtaining the user characteristics of the sample user
Optionally, the acquiring manner of the tag includes:
Detecting an access result of a sample user for sample content according to the access operation of the sample user for the sample content; wherein the accessing operation includes: at least one of click rate, play completion rate, and viewing duration;
And determining a label used for representing the access result of the sample user to the sample content according to the access result.
Optionally, the first determining module is specifically configured to:
selecting a user vector with the similarity meeting a preset similarity condition from a plurality of user vectors as a target user vector;
And obtaining the access probability of the sample user to the sample content according to the target user vector and the content vector.
Optionally, the user sub-network includes a preset transform layer, where the preset transform layer is configured to output a plurality of user vectors corresponding to the user features.
Optionally, the preset loss function is a loss function containing predetermined function content; the predetermined function content is regular term constraint content which is used for controlling the similarity of any two user vectors in a plurality of user vectors output by the user sub-network and is lower than a preset similarity threshold.
Optionally, the content of the predetermined function is:
wherein λ and γ are preset experience parameters, H is the total number of user vectors corresponding to the user features output by the user sub-network, O i is the ith user vector, and O j is the jth user vector.
Optionally, the user features include: at least one of user identification, age, sex, member attribute, login attribute, viewing history behavior attribute, click history behavior attribute, long-term portrait and short-term portrait of the sample user;
The content features include: at least one of content identification, content type, content uploading personnel identification and content uploading personnel attribute of the sample content.
According to the model training method provided by the embodiment of the invention, the user characteristics of the obtained sample user are input into a user sub-network to be trained for generating user vectors, a plurality of user vectors corresponding to the user characteristics are obtained, the content characteristics of sample contents accessed by the obtained sample user are input into a content sub-network for generating the content vectors, and the content vectors corresponding to the content characteristics are obtained; according to the user vector and the content vector, determining the access probability of the sample user for the sample content, calculating a loss value by using a preset loss function, the access probability and a label for representing the access result of the sample user for the sample content, adjusting network parameters of the user sub-network when judging that the user sub-network is converged based on the loss value, and returning to the step of acquiring the user characteristics, the content characteristics and the label. The user sub-network trained based on the model training method provided by the scheme can output various user vectors, and the richness of the screened content is improved.
Based on the foregoing content screening method, an embodiment of the present invention further provides a content screening apparatus, as shown in fig. 9, where the apparatus includes:
A second obtaining module 910, configured to obtain, based on a user identifier, a user feature of a target user represented by the user identifier, in response to receiving a content obtaining request including the user identifier;
A second input module 920, configured to input, as input content, a user feature of a target user to a user sub-network, so that the user sub-network outputs a plurality of user vectors; the user sub-network is a network obtained by training based on the model training method provided by the embodiment of the invention;
a second determining module 930, configured to determine a plurality of target contents from the plurality of candidate contents based on the content vectors corresponding to the respective user vectors and the respective candidate contents; wherein the plurality of target contents comprise: and utilizing the user vectors to match the obtained candidate content.
Optionally, the similarity of any two user vectors among the plurality of user vectors output by the user sub-network is lower than a preset similarity threshold.
Optionally, the determining process of the plurality of target contents includes:
Splicing the plurality of user vectors into a target user vector;
Processing the content vectors corresponding to the target user vectors and the candidate contents based on a preset algorithm to determine a specified number of content vectors; the preset algorithm is used for selecting a specified number of content vectors with the distance from the target user vector being within a preset distance threshold range;
And taking the candidate contents corresponding to the specified number of content vectors as a plurality of target contents.
In the content screening method provided by the embodiment of the invention, user characteristics of a target user are used as input content and are input into a user sub-network trained by the model training method provided by the embodiment of the invention to obtain a plurality of user vectors, and then a plurality of target contents are determined in a plurality of candidate contents based on the plurality of user vectors and content vectors corresponding to each candidate content; because the plurality of target contents comprise candidate contents which are obtained by matching the user vectors, the determined plurality of target content vectors comprise a plurality of specific characteristics related to the user, and therefore, the method can improve the richness of the determined plurality of target contents and the richness of the screened contents.
The embodiment of the invention also provides an electronic device, as shown in fig. 10, which comprises a processor 1001, a communication interface 1002, a memory 1003 and a communication bus 1004, wherein the processor 1001, the communication interface 1002 and the memory 1003 complete communication with each other through the communication bus 1004,
A memory 1003 for storing a computer program;
The processor 1001 is configured to implement the model training method and the content screening method provided by the embodiments of the present invention when executing the program stored in the memory 1003.
The communication bus mentioned by the above terminal may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The memory may include random access memory (Random Access Memory, RAM) or may include non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, abbreviated as CPU), a network processor (Network Processor, abbreviated as NP), etc.; but may also be a digital signal Processor (DIGITAL SIGNAL Processor, DSP), application Specific Integrated Circuit (ASIC), field-Programmable gate array (FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components.
In yet another embodiment of the present invention, a computer readable storage medium is provided, where a computer program is stored, where the computer program, when executed by a processor, implements the model training method and the content screening method according to any of the foregoing embodiments.
In yet another embodiment of the present invention, a computer program product comprising instructions, which when run on a computer, causes the computer to perform the model training method and the content screening method of any of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk Solid STATE DISK (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments in part.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims (14)
1. A model training method, characterized in that the training method comprises:
Acquiring user characteristics of a sample user, content characteristics of sample content accessed by the sample user and labels; the label is used for representing an access result of the sample user for the sample content;
inputting the user characteristics to a user sub-network for generating user vectors to obtain a plurality of user vectors corresponding to the user characteristics, and inputting the content characteristics to a content sub-network for generating content vectors to obtain content vectors corresponding to the content characteristics;
Determining the access probability of the sample user to the sample content according to the obtained user vector and content vector;
Calculating a loss value by using a preset loss function, the access probability and the label;
and when judging that the user sub-network is not converged based on the loss value, adjusting network parameters of the user sub-network, and returning the user characteristics of the obtained sample user, the content characteristics of the sample content accessed by the sample user and the labels.
2. The method according to claim 1, wherein the obtaining the tag includes:
Detecting an access result of a sample user for sample content according to the access operation of the sample user for the sample content; wherein the accessing operation includes: at least one of click rate, play completion rate, and viewing duration;
And determining a label used for representing the access result of the sample user to the sample content according to the access result.
3. The method of claim 1, wherein determining the probability of access of the sample user to the sample content based on the obtained user vector and content vector comprises:
selecting a user vector with the similarity meeting a preset similarity condition from a plurality of user vectors as a target user vector;
And obtaining the access probability of the sample user to the sample content according to the target user vector and the content vector.
4. The method of claim 1, wherein the subscriber sub-network includes a preset transformer layer, and the preset transformer layer is configured to output a plurality of subscriber vectors corresponding to the subscriber features.
5. The method of claim 1, wherein the predetermined loss function is a loss function including predetermined function content; the predetermined function content is regular term constraint content which is used for controlling the similarity of any two user vectors in a plurality of user vectors output by the user sub-network and is lower than a preset similarity threshold.
6. The method of claim 5, wherein the predetermined function content is:
wherein λ and γ are preset experience parameters, H is the total number of user vectors corresponding to the user features output by the user sub-network, O i is the ith user vector, and O j is the jth user vector.
7. The method of any of claims 1-6, wherein the user characteristics comprise: at least one of user identification, age, sex, member attribute, login attribute, viewing history behavior attribute, click history behavior attribute, long-term portrait and short-term portrait of the sample user;
The content features include: at least one of content identification, content type, content uploading personnel identification and content uploading personnel attribute of the sample content.
8. A method of content screening, the method comprising:
In response to receiving a content acquisition request containing a user identifier, acquiring user characteristics of a target user represented by the user identifier based on the user identifier;
Inputting user characteristics of a target user as input content to a user sub-network so that the user sub-network outputs a plurality of user vectors; wherein the user sub-network is a network trained based on the training method of any one of claims 1-7;
determining a plurality of target contents in a plurality of candidate contents based on the content vectors corresponding to the user vectors and the candidate contents; wherein the plurality of target contents comprise: and utilizing the user vectors to match the obtained candidate content.
9. The method of claim 8, wherein the similarity of any two user vectors among the plurality of user vectors output by the user subnetwork is below a preset similarity threshold.
10. The method of claim 8, wherein the determining of the plurality of target content comprises:
Splicing the plurality of user vectors into a target user vector;
Processing the content vectors corresponding to the target user vectors and the candidate contents based on a preset algorithm to determine a specified number of content vectors; the preset algorithm is used for selecting a specified number of content vectors with the distance from the target user vector being within a preset distance threshold range;
And taking the candidate contents corresponding to the specified number of content vectors as a plurality of target contents.
11. A model training device, characterized in that the training device comprises:
The first acquisition module is used for acquiring user characteristics of a sample user, content characteristics of sample content accessed by the sample user and labels; the label is used for representing an access result of the sample user for the sample content;
the first input module is used for inputting the user characteristics to a user sub-network for generating user vectors, obtaining a plurality of user vectors corresponding to the user characteristics, and inputting the content characteristics to a content sub-network for generating content vectors, obtaining the content vectors corresponding to the content characteristics;
the first determining module is used for determining the access probability of the sample user to the sample content according to the obtained user vector and the content vector;
the calculating module is used for calculating a loss value by using a preset loss function, the access probability and the label;
and the adjusting module is used for adjusting network parameters of the user sub-network when judging that the user sub-network is not converged based on the loss value, and returning the user characteristics of the acquired sample user, the content characteristics of the sample content accessed by the sample user and the labels.
12. A content screening apparatus, the apparatus comprising:
The second acquisition module is used for responding to a received content acquisition request containing a user identifier and acquiring the user characteristics of a target user represented by the user identifier based on the user identifier;
The second input module is used for taking the user characteristics of the target user as input contents and inputting the input contents into the user sub-network so that the user sub-network outputs a plurality of user vectors; wherein the user sub-network is a network trained based on the training device of claim 11;
The second determining module is used for determining a plurality of target contents in a plurality of candidate contents based on the content vectors corresponding to the user vectors and the candidate contents; wherein the plurality of target contents comprise: and utilizing the user vectors to match the obtained candidate content.
13. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
A processor for implementing the method of any of claims 1-10 when executing a program stored on a memory.
14. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410207684.6A CN118095355A (en) | 2024-02-26 | 2024-02-26 | Model training method, content screening method and related devices |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410207684.6A CN118095355A (en) | 2024-02-26 | 2024-02-26 | Model training method, content screening method and related devices |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118095355A true CN118095355A (en) | 2024-05-28 |
Family
ID=91141682
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410207684.6A Pending CN118095355A (en) | 2024-02-26 | 2024-02-26 | Model training method, content screening method and related devices |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118095355A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119047816A (en) * | 2024-10-31 | 2024-11-29 | 贵州安易和信科技有限公司 | Management method and system for two-dimension code intelligent house number plate system |
-
2024
- 2024-02-26 CN CN202410207684.6A patent/CN118095355A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119047816A (en) * | 2024-10-31 | 2024-11-29 | 贵州安易和信科技有限公司 | Management method and system for two-dimension code intelligent house number plate system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111159564B (en) | Information recommendation method, device, storage medium and computer equipment | |
CN110781321B (en) | Multimedia content recommendation method and device | |
CN111444428A (en) | Information recommendation method and device based on artificial intelligence, electronic equipment and storage medium | |
US20170250930A1 (en) | Interactive content recommendation personalization assistant | |
US20060247940A1 (en) | Compatibility scoring of users in a social network | |
CN112597395A (en) | Object recommendation method, device, equipment and storage medium | |
CN112528147A (en) | Content recommendation method and apparatus, training method, computing device, and storage medium | |
CN111159563B (en) | Method, device, equipment and storage medium for determining user interest point information | |
CN111651666B (en) | User topic recommendation method, device, computer equipment and storage medium | |
US20230334314A1 (en) | Content recommendation method and apparatus, device, storage medium, and program product | |
CN111858969B (en) | Multimedia data recommendation method, device, computer equipment and storage medium | |
CN112989179A (en) | Model training and multimedia content recommendation method and device | |
CN118095355A (en) | Model training method, content screening method and related devices | |
US20240152512A1 (en) | Machine learning for dynamic information retrieval in a cold start setting | |
CN113254513B (en) | Sequencing model generation method, sequencing device and electronic equipment | |
CN112115300B (en) | Text processing method, device, electronic device and readable storage medium | |
CN113127720A (en) | Hot word searching determination method and device | |
WO2024113641A1 (en) | Video recommendation method and apparatus, and electronic device, computer-readable storage medium and computer program product | |
CN111143688B (en) | Evaluation method and system based on mobile news client | |
CN116366923A (en) | A video recommendation method, device and electronic equipment | |
CN117132323A (en) | Recommended content analysis method, recommended content analysis device, recommended content analysis equipment, recommended content analysis medium and recommended content analysis program product | |
CN113934872A (en) | Search result sorting method, device, equipment and storage medium | |
CN114218492A (en) | Method, system, device and medium for recommending user-generated content | |
CN115017362B (en) | Data processing method, electronic device and storage medium | |
CN111353101A (en) | Data pushing method |
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 |