Sample screening method, device, equipment, storage medium and program product

By performing feature deletion processing on sample content items to generate copies and determine feature vectors, negative sample content items are screened out, which solves the problem of poor accuracy in the initial stage of model training in the existing technology and improves the accuracy and effect of the content item recommendation model.

CN114492756BActive Publication Date: 2025-09-12BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210107237.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-28
Publication Date
2025-09-12
Estimated Expiration
2042-01-28

AI Technical Summary

Technical Problem

In the prior art, negative sample screening methods lead to poor model accuracy in the initial stage of content item recommendation model training, resulting in poor recommendation effect of the final model.

Method used

By performing feature deletion on the sample content items, two copies are generated, and feature vectors are determined based on these copies to filter out negative sample content items for model training.

Benefits of technology

The reliability of negative sample content items is improved, thereby improving the accuracy and recommendation effect of the content item recommendation model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114492756B_ABST
    Figure CN114492756B_ABST
Patent Text Reader

Abstract

The present application discloses a sample screening method, apparatus, device, storage medium and program product, belonging to the field of neural network technology. The method obtains multiple first sample content items and multiple second sample content items, and performs different feature deletion processing on each first sample content item to obtain two copies of the first sample content item. Then, based on the multiple copies of the first sample content items, a feature vector of each first sample content item is determined, and based on the feature vectors of the multiple first sample content items and the feature vectors of the multiple second sample content items, negative sample content items are screened from the multiple first sample content items. Since the obtained feature vector can represent the content information of the sample content item, the negative sample content items screened based on the content information have high reliability, and the model trained based on the screened negative sample content items has high accuracy, thereby improving the content item recommendation effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of neural network technology, and in particular to a sample screening method, apparatus, device, storage medium and program product. Background Art

[0002] With the development of neural network technology, service providers are now recommending content items such as advertisements to users primarily through content recommendation models, which predict the click-through rate of content items and recommend content items based on this rate. Content recommendation models are typically trained using positive and negative samples. Positive samples are content items recommended to users and clicked on by them. However, compared to negative samples, positive samples are fewer in number. To avoid a large disparity in the number of positive and negative samples, which could affect model training, negative samples need to be screened when training content recommendation models.

[0003] When screening negative samples in related technologies, a certain number of negative samples are first randomly screened from the negative sample set, and model training is performed together with the positive samples. After a certain number of trainings, the click-through rate of each negative sample in the negative sample set is predicted based on the model obtained from the current training. Based on the click-through rate, a certain number of negative samples with higher click-through rates are screened from the negative sample set to participate in the next training. After training for a certain number of times, negative samples are screened again from the negative sample set based on the model obtained from the current training, and then model training is continued until the content recommendation model is finally trained.

[0004] However, in the methods of related technologies, since the negative samples screened last time will be used for the next model training, and the accuracy of the model in the initial training stage is poor, the reliability of the negative samples screened out is poor, and the accuracy of the model finally trained is poor, resulting in poor content item recommendation effect. Summary of the Invention

[0005] The present invention provides a sample screening method, apparatus, device, storage medium, and program product to improve the effectiveness of content item recommendations. The technical solution is as follows:

[0006] In one aspect, a sample screening method is provided, comprising:

[0007] Acquire multiple first sample content items and multiple second sample content items, where the first sample content items are historical content items recommended to a target account, and the second sample content items are content items that the target account has historically clicked on;

[0008] For each first sample content item, performing a first feature deletion process and a second feature deletion process on the first sample content item to obtain a first copy and a second copy;

[0009] determining a feature vector for each first sample content item based on the first and second copies of the plurality of first sample content items, where the feature vector is used to characterize content information of the first sample content item;

[0010] Based on the feature vectors of the plurality of first sample content items and the feature vectors of the plurality of second sample content items, negative sample content items are screened from the plurality of first sample content items, and the negative sample content items are used to train a content item recommendation model.

[0011] In a possible implementation, determining a feature vector of each first sample content item based on the first copy and the second copy of the plurality of first sample content items includes:

[0012] constructing a plurality of sample pairs based on the first and second copies of the plurality of first sample content items;

[0013] Determine the sample label for each sample pair;

[0014] A feature vector of each first sample content item is determined based on the multiple sample pairs and the sample label of each sample pair.

[0015] In another possible implementation, determining the sample label of each sample pair includes:

[0016] For each sample pair, if the sample pair is composed of different copies of the same first sample content item, determine that the sample label of the sample pair is a positive label;

[0017] If the sample pair is composed of copies of different first sample content items, the sample label of the sample pair is determined to be a negative label.

[0018] In another possible implementation, determining the feature vector of each first sample content item based on the multiple sample pairs and the sample label of each sample pair includes:

[0019] For each sample pair, determining the similarity between the two copies in the sample pair based on the sample features of the two copies in the sample pair;

[0020] Determine a target vector matrix based on the similarities and sample labels of the plurality of sample pairs, wherein the target vector matrix stores feature vectors of the plurality of first sample content items;

[0021] A feature vector of each first sample content item is obtained from the target vector matrix.

[0022] In another possible implementation, the filtering of negative sample content items from the plurality of first sample content items based on the feature vectors of the plurality of first sample content items and the feature vectors of the plurality of second sample content items includes:

[0023] For each second sample content item, determining a similarity between a feature vector of the second sample content item and the feature vectors of the plurality of first sample content items to obtain a plurality of similarities;

[0024] obtaining a recommendation parameter, where the recommendation parameter is used to indicate a similarity between the content item recommended to the target account and the second sample content item;

[0025] Based on the recommendation parameter, first sample content items whose similarity meets the recommendation parameter are selected from the plurality of first sample content items as negative sample content items.

[0026] In another possible implementation, the method further includes:

[0027] taking the plurality of second sample content items as positive sample content items;

[0028] Model training is performed based on the positive sample content items and the negative sample content items obtained by screening to obtain the content item recommendation model.

[0029] In another possible implementation, performing a first feature deletion process on the first sample content item to obtain a first copy includes:

[0030] determining, based on a first sample feature of the first sample content item, at least one of a single-valued sample feature and a sequence sample feature in the first sample feature, wherein the single-valued sample feature is used to indicate that the first sample feature is an independent feature, and the sequence sample feature is used to indicate that the first sample feature is a time-related feature;

[0031] Based on at least one of the single-value sample feature and the sequence sample feature in the first sample feature, a first feature deletion process is performed on the first sample content item to obtain a first copy.

[0032] In another possible implementation, performing a first feature deletion process on the first sample content item based on at least one of a single-value sample feature and a sequence sample feature in the first sample feature to obtain a first copy includes at least one of the following implementations:

[0033] discarding a preset number of single-valued sample features from the single-valued sample features to obtain the first copy;

[0034] Some of the sequence sample features are set to zero to obtain the first copy.

[0035] In one aspect, a sample screening device is provided, comprising:

[0036] an acquisition module, configured to acquire a plurality of first sample content items and a plurality of second sample content items, wherein the first sample content items are historical content items recommended to a target account, and the second sample content items are content items that the target account has historically clicked on;

[0037] A processing module, configured to perform a first feature deletion process and a second feature deletion process on each first sample content item, respectively, to obtain a first copy and a second copy;

[0038] a first determining module, configured to determine a feature vector of each first sample content item based on the first and second copies of the plurality of first sample content items, wherein the feature vector is used to represent content information of the first sample content item;

[0039] The screening module is configured to screen negative sample content items from the plurality of first sample content items based on the feature vectors of the plurality of first sample content items and the feature vectors of the plurality of second sample content items, wherein the negative sample content items are used to train a content item recommendation model.

[0040] In one possible implementation, the first determination module is configured to construct a plurality of sample pairs based on the first and second copies of the plurality of first sample content items; determine a sample label for each sample pair; and determine a feature vector for each first sample content item based on the plurality of sample pairs and the sample label of each sample pair.

[0041] In another possible implementation, the first determination module is configured to, for each sample pair, determine that the sample label of the sample pair is a positive label if the sample pair is composed of different copies of the same first sample content item; and determine that the sample label of the sample pair is a negative label if the sample pair is composed of copies of different first sample content items.

[0042] In another possible implementation, the first determination module is configured to determine, for each sample pair, the similarity between the two copies in the sample pair based on the sample features of the two copies in the sample pair; determine a target vector matrix based on the similarities and sample labels of the multiple sample pairs, wherein the target vector matrix stores feature vectors of multiple first sample content items; and obtain the feature vector of each first sample content item from the target vector matrix.

[0043] In another possible implementation, the screening module is used to determine, for each second sample content item, the similarity between the feature vector of the second sample content item and the feature vectors of the multiple first sample content items to obtain multiple similarities; obtain a recommendation parameter, where the recommendation parameter is used to represent the similarity between the content item recommended to the target account and the second sample content item; and based on the recommendation parameter, screen the first sample content item whose similarity meets the recommendation parameter from the multiple first sample content items as a negative sample content item.

[0044] In another possible implementation, the apparatus further includes:

[0045] The training module is configured to use the plurality of second sample content items as positive sample content items; perform model training based on the positive sample content items and the negative sample content items obtained by screening to obtain the content item recommendation model.

[0046] In another possible implementation, the processing module is used to determine at least one of a single-valued sample feature and a sequence sample feature in the first sample feature based on the first sample feature of the first sample content item, the single-valued sample feature is used to indicate that the first sample feature is an independent feature, and the sequence sample feature is used to indicate that the first sample feature is a feature associated with time; based on at least one of the single-valued sample feature and the sequence sample feature in the first sample feature, the first feature deletion processing is performed on the first sample content item to obtain a first copy.

[0047] In another possible implementation, the processing module is configured to discard a preset number of single-valued sample features in the single-valued sample features to obtain the first copy; and set some sequence sample features in the sequence sample features to zero to obtain the first copy.

[0048] On the one hand, an electronic device is provided, comprising one or more processors and one or more memories, wherein the one or more memories store at least one program code, and the at least one program code is loaded and executed by the one or more processors to implement a sample screening method as described in any possible implementation manner.

[0049] On the one hand, a computer-readable storage medium is provided, wherein the storage medium stores at least one program code, and the at least one program code is loaded and executed by a processor to implement a sample screening method as described in any possible implementation manner.

[0050] In one aspect, a computer program product is provided, wherein the computer program product stores at least one program code, and the at least one program code is loaded and executed by a processor to implement a sample screening method as described in any possible implementation manner.

[0051] The beneficial effects of the technical solutions provided in the embodiments of the present application include at least:

[0052] An embodiment of the present application provides a sample screening method, which performs different feature deletion processing on the same sample content item to obtain two copies of the same sample content item, and then determines the feature vector of each sample content item based on the copies of multiple sample content items. Since the obtained feature vector can represent the content information of the sample content item, the negative sample content items screened based on the content information have high reliability, and the model trained based on the screened negative sample content items has high accuracy, thereby improving the content item recommendation effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0054] Figure 1 is a schematic diagram of an implementation environment of a sample screening method provided in an embodiment of the present application;

[0055] Figure 2 This is a flow chart of a sample screening method provided in an embodiment of the present application;

[0056] Figure 3 This is a flow chart of a sample screening method provided in an embodiment of the present application;

[0057] Figure 4 is a schematic diagram of screening negative sample content items provided by an embodiment of the present application;

[0058] Figure 5 is a structural schematic diagram of a sample screening device provided in an embodiment of the present application;

[0059] Figure 6 This is a structural block diagram of a terminal provided in an embodiment of the present application;

[0060] Figure 7 This is a structural block diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0062] The terms "first," "second," "third," and "fourth," etc. in the specification and claims of this application and the accompanying drawings are used to distinguish different objects, not to describe a specific order. In addition, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements, but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.

[0063] Figure 1 This is a schematic diagram of an implementation environment of a sample screening method provided in an embodiment of the present application, see Figure 1 The implementation environment includes: an electronic device, which can be provided as a terminal 101, can be provided as a server 102, or can be provided as a terminal 101 and a server 102.

[0064] If the electronic device is provided as the terminal 101 , the terminal 101 filters negative sample content items from historical content items recommended to the target account.

[0065] In one possible implementation, terminal 101 sends the negative sample content item to server 102. Accordingly, the implementation environment further includes server 102. Terminal 101 is connected to server 102 via a wireless or wired network. Server 102 performs model training based on the negative sample content item and the positive sample content item to obtain a content item recommendation model. In another possible implementation, terminal 101 performs model training based on the negative sample content item and the positive sample content item to obtain a content item recommendation model.

[0066] In addition, a target application can also be installed on the terminal 101. If the terminal 101 obtains a content recommendation model trained by the server 102, the server 102 determines the content items to be recommended based on the content recommendation model. When the user opens the main interface of the target application, the server 102 sends the recommended content items to the terminal 101, and the terminal 101 displays the content items on the main interface. If the terminal 101 obtains a content recommendation model trained by itself, the terminal 101 determines the content items to be recommended based on the content recommendation model, and when the user opens the main interface of the target application, the terminal 101 displays the content items on the main interface.

[0067] If the electronic device is provided as server 102, server 102 will screen negative sample content items. Furthermore, server 102 may also perform model training on the negative sample content items along with the positive sample content items to obtain a content item recommendation model, and determine the content items to be recommended based on the content item recommendation model. Accordingly, the implementation environment also includes: a terminal 101, which is connected to server 102 via a wireless or wired network. A target application is installed on terminal 101. When a user opens the target application and displays the main interface, server 102 sends the content items it has determined to terminal 101, which then displays the content items.

[0068] If the electronic device is provided as a terminal 101 and a server 102, the server 102 screens negative sample content items and performs model training on these negative sample content items along with the positive sample content items to obtain a content item recommendation model. The content item to be recommended is determined based on this content item recommendation model. The target application is installed on the terminal 101. When the user opens the main interface of the target application, the server 102 sends its recommended content items to the terminal 101, which then displays the content items on the main interface. Alternatively, the content items are displayed on a content recommendation interface preceding the main interface.

[0069] In embodiments of the present application, this method can be applied in a variety of scenarios. If the content item is a food advertisement, the method can be applied to a food recommendation scenario. In this scenario, when a user opens a target application, a recommendation window is displayed on the target application's main interface, displaying the food recommended to the user. Alternatively, the recommended food is displayed on a content recommendation interface before the target application displays its main interface. The target application can be a food application or another application.

[0070] If the content item is a video advertisement, this method can be applied to a video recommendation scenario. In this scenario, the target application is a video application. When the user opens the video application, the recommended videos are displayed on the main interface of the video application. Alternatively, the recommended videos are displayed on the content recommendation interface before the main interface of the video application is displayed.

[0071] The content item may also be a picture advertisement, a shopping advertisement or other content item. In the embodiment of the present application, the content item is not specifically limited.

[0072] The terminal 101 is at least one of a mobile phone, a tablet computer, a PC (Personal Computer), etc. The server 102 can be at least one of a single server, a server cluster consisting of multiple servers, a cloud server, a cloud computing platform, and a virtualization center.

[0073] Figure 2This is a flow chart of a sample screening method provided in an embodiment of the present application, see Figure 2 , the method comprising:

[0074] Step 201: Acquire multiple first sample content items and multiple second sample content items, where the first sample content items are historical content items recommended to a target account, and the second sample content items are content items that have been clicked on by the target account in the past.

[0075] Step 202: For each first sample content item, perform a first feature deletion process and a second feature deletion process on the first sample content item to obtain a first copy and a second copy.

[0076] Step 203: Based on the first copies and the second copies of the plurality of first sample content items, determine a feature vector for each first sample content item, where the feature vector is used to represent content information of the first sample content item.

[0077] Step 204: Based on the feature vectors of the plurality of first sample content items and the feature vectors of the plurality of second sample content items, negative sample content items are filtered from the plurality of first sample content items, and the negative sample content items are used to train the content item recommendation model.

[0078] In a possible implementation, determining a feature vector of each first sample content item based on the first copy and the second copy of the plurality of first sample content items includes:

[0079] constructing a plurality of sample pairs based on the first and second copies of the plurality of first sample content items;

[0080] Determine the sample label for each sample pair;

[0081] A feature vector of each first sample content item is determined based on the plurality of sample pairs and the sample label of each sample pair.

[0082] In another possible implementation, determining the sample label of each sample pair includes:

[0083] For each sample pair, if the sample pair is composed of different copies of the same first sample content item, determine that the sample label of the sample pair is a positive label;

[0084] If the sample pair is composed of copies of different first sample content items, the sample label of the sample pair is determined to be a negative label.

[0085] In another possible implementation, determining a feature vector of each first sample content item based on a plurality of sample pairs and a sample label of each sample pair includes:

[0086] For each sample pair, based on the sample features of the two copies in the sample pair, determine the similarity between the two copies in the sample pair;

[0087] Determine a target vector matrix based on similarities and sample labels of the plurality of sample pairs, wherein the target vector matrix stores feature vectors of the plurality of first sample content items;

[0088] The feature vector of each first sample content item is obtained from the target vector matrix.

[0089] In another possible implementation, filtering negative sample content items from the plurality of first sample content items based on the feature vectors of the plurality of first sample content items and the feature vectors of the plurality of second sample content items includes:

[0090] For each second sample content item, determining a similarity between a feature vector of the second sample content item and feature vectors of a plurality of first sample content items to obtain a plurality of similarities;

[0091] Obtaining a recommendation parameter, where the recommendation parameter is used to indicate a similarity between the content item recommended to the target account and the second sample content item;

[0092] Based on the recommendation parameter, first sample content items whose similarity meets the recommendation parameter are screened from the plurality of first sample content items as negative sample content items.

[0093] In another possible implementation, the method further includes:

[0094] taking the plurality of second sample content items as positive sample content items;

[0095] Based on the positive sample content items and the filtered negative sample content items, model training is performed to obtain a content item recommendation model.

[0096] In another possible implementation, performing a first feature deletion process on the first sample content item to obtain the first copy includes:

[0097] Determining, based on a first sample feature of the first sample content item, at least one of a single-valued sample feature and a sequence sample feature in the first sample feature, wherein the single-valued sample feature is used to indicate that the first sample feature is an independent feature, and the sequence sample feature is used to indicate that the first sample feature is a time-related feature;

[0098] Based on at least one of the single-value sample feature and the sequence sample feature in the first sample feature, a first feature deletion process is performed on the first sample content item to obtain a first copy.

[0099] In another possible implementation, based on at least one of the single-value sample feature and the sequence sample feature in the first sample feature, performing first feature deletion processing on the first sample content item to obtain the first copy includes at least one of the following implementations:

[0100] Discard a preset number of single-valued sample features in the single-valued sample features to obtain a first copy;

[0101] Some of the sequence sample features are set to zero to obtain a first copy.

[0102] An embodiment of the present application provides a sample screening method, which performs different feature deletion processing on the same sample content item to obtain two copies of the same sample content item, and then determines the feature vector of each sample content item based on the copies of multiple sample content items. Since the obtained feature vector can represent the content information of the sample content item, the negative sample content items screened based on the content information have high reliability, and the model trained based on the screened negative sample content items has high accuracy, thereby improving the content item recommendation effect.

[0103] Figure 3 This is a flow chart of a sample screening method provided in an embodiment of the present application, which is executed by an electronic device. Figure 3 , the method comprising:

[0104] Step 301: The electronic device obtains a plurality of first sample content items and a plurality of second sample content items.

[0105] The first sample content item is a historical content item recommended to the target account, and the second sample content item is a content item that has been clicked on by the target account in the past.

[0106] The historical time range corresponding to the first sample content item can be set and modified as needed, for example, to a historical time range of one month, two months, or six months. The historical time range corresponding to the second sample content item can be the same as or different from the historical time range corresponding to the first sample content item, and this is not specifically limited.

[0107] The electronic device can obtain multiple first sample content items and multiple second sample content items from the sample library. The first sample content items and the second sample content items can be food advertisements, video advertisements, picture advertisements, etc., which are not specifically limited.

[0108] Step 302: For each first sample content item, the electronic device performs a first feature deletion process on the first sample content item to obtain a first copy.

[0109] This step can be achieved by following the steps (1) to (2), including:

[0110] (1) The electronic device determines at least one of a single-valued sample feature and a sequence sample feature in the first sample feature based on the first sample feature of the first sample content item.

[0111] The single-value sample feature is used to indicate that the first sample feature is an independent feature, and the sequence sample feature is used to indicate that the first sample feature is a feature associated with time.

[0112] For each first sample content item, the electronic device determines the feature type of each first sample feature in the first sample content item, and based on the feature type, determines from the first sample features a first sample feature whose feature type is a single-valued feature, i.e., a single-valued sample feature, and / or determines from the first sample features a first sample feature whose feature type is a sequence feature, i.e., a sequence sample feature.

[0113] For example, single-value sample features include age features, price features, etc., and sequence sample features include movie viewing record features, shopping record features, and other time-related features.

[0114] (2) The electronic device performs a first feature deletion process on the first sample content item based on at least one of the single-value sample feature and the sequence sample feature in the first sample feature to obtain a first copy.

[0115] Step (2) can be implemented by at least one of the following implementations:

[0116] In a first implementation manner, the electronic device discards a preset number of single-valued sample features from the single-valued sample features to obtain a first copy.

[0117] In this implementation, the electronic device may randomly discard a preset number of single-valued sample features, or may discard a preset number of single-valued sample features in a certain order. This is not specifically limited in the embodiments of the present application. After the electronic device discards the preset number of single-valued sample features, the remaining first sample features constitute the first copy.

[0118] Among them, the preset number can be set and changed as needed, and is not specifically limited in the embodiments of the present application.

[0119] In a second implementation manner, the electronic device sets some of the sequence sample features to zero to obtain a first copy.

[0120] In this implementation, the electronic device may randomly set some of the sequence sample features to zero, or may set some of the sequence sample features to zero in chronological order. This is not specifically limited in the embodiments of the present application. Furthermore, the electronic device may obtain a preset ratio and set the sequence sample features of the preset ratio to zero. The preset ratio may be set and changed as needed, for example, the preset ratio is 10%, 20%, or 30%. After the electronic device sets the sequence sample features of the preset ratio to zero, the remaining first sample features constitute the first copy.

[0121] In an embodiment of the present application, the electronic device may discard only a preset number of single-value sample features, may set only some sequence sample features to zero, or may simultaneously discard a preset number of single-value sample features and set some sequence sample features to zero, that is, the following third implementation method: the electronic device discards a preset number of single-value sample features in the single-value sample features, and sets some sequence sample features in the sequence sample features to zero to obtain a first copy.

[0122] In this implementation, the electronic device simultaneously discards a preset number of single-value sample features and sets some sequence sample features to zero, and then forms the remaining first sample features into a first copy.

[0123] Step 303: The electronic device performs a second feature deletion process on the first sample content item to obtain a second copy.

[0124] In this step, the electronic device may discard only a preset number of single-valued sample features, may set only some sequence sample features to zero, or may discard a preset number of single-valued sample features and set some sequence sample features to zero at the same time, except that the discarded preset number of single-valued sample features and / or some sequence sample features set to zero are not exactly the same as those in step 302.

[0125] For example, in step 302, the electronic device only discards a preset number of single-valued sample features, and in step 303, the electronic device also only discards a preset number of single-valued sample features. Then, the single-valued sample features discarded in step 303 or the number of single-valued sample features are not exactly the same as those in step 302.

[0126] For example, the electronic device only sets some sequence sample features to zero in step 302 and also only sets some sequence sample features to zero in step 303. Then, the partial sequence sample features set to zero in step 303 and step 302 are not completely the same.

[0127] For example, in step 303, the electronic device simultaneously discards a preset number of single-valued sample features and sets some sequence sample features to zero. In step 303, the electronic device also simultaneously discards a preset number of single-valued sample features and sets some sequence sample features to zero. Then, the single-valued sample features discarded in step 303 and step 302 are not completely the same and / or the partial sequence sample features set to zero are not completely the same.

[0128] After the electronic device obtains the first copy and the second copy of the first sample content item, it can input the sample features of the first copy into the feedforward neural network to obtain the feature vector of the first copy, and input the sample features of the second copy into the feedforward neural network to obtain the feature vector of the second copy.

[0129] In the embodiment of the present application, the electronic device performs data augmentation processing twice on the same first sample content item to obtain different copies of the same first sample content item. The different copies of the same first sample content item are input into the feedforward neural network for representation learning to obtain feature vectors of the copies. Figure 4 For each first sample content item, the first copy and the second copy of the first sample content item both contain high-level semantic information of the first sample content item.

[0130] Step 304: The electronic device constructs a plurality of sample pairs based on the first copies and the second copies of the plurality of first sample content items.

[0131] In the embodiment of the present application, after processing through the above steps 302 and 303, the first copy and the second copy of each first sample content item are obtained, and multiple sample pairs are constructed by combining the first copies and the second copies of multiple first sample content items.

[0132] The electronic device may combine two copies of the same first sample content item into a sample pair, or may combine two copies of different first sample content items into a sample pair.

[0133] Step 305: The electronic device determines a sample label for each sample pair.

[0134] For each sample pair, if the sample pair is composed of different copies of the same first sample content item, the sample label of the sample pair is determined to be a positive label; if the sample pair is composed of copies of different first sample content items, the sample label of the sample pair is determined to be a negative label.

[0135] Step 306: The electronic device determines a feature vector of each first sample content item based on the multiple sample pairs and the sample label of each sample pair.

[0136] The feature vector is used to represent content information of the first sample content item.

[0137] This step can be achieved by following the steps (1) to (3), including:

[0138] (1) For each sample pair, the electronic device determines the similarity between the two copies in the sample pair based on the sample features of the two copies in the sample pair.

[0139] For each first sample content item, the feature vector of the first copy and the feature vector of the second copy of the first sample content item have been obtained in step 303. Therefore, in this step, the electronic device can directly determine the inner product of the feature vectors of the two copies in the sample pair based on the feature vectors of the two copies in the sample pair, and characterize the similarity of the two copies by the value obtained by the vector inner product.

[0140] In an embodiment of the present application, if the electronic device does not input different copies of the first sample content item into the feedforward neural network in step 303, the electronic device can input the sample features of the two copies in each sample pair into the feedforward neural network when performing this step to obtain feature vectors of the two copies in each sample pair. Then, for each sample pair, the electronic device determines the inner product of the feature vectors of the two copies in the sample pair based on the feature vectors of the two copies in the sample pair, and determines the similarity of the two copies using the value obtained by the vector inner product.

[0141] The electronic device may also determine the similarity between the two copies in the sample pair by determining the Euclidean distance between the feature vectors of the two copies in the sample pair. In the embodiment of the present application, the manner in which the electronic device determines the similarity between the two copies in the sample pair is not specifically limited.

[0142] (2) The electronic device determines a target vector matrix based on the similarities of multiple sample pairs and sample labels.

[0143] The electronic device can perform model training based on the similarity and sample labels of multiple sample pairs using InfoNCE as a loss function. When the model determines, based on the similarity of the sample pairs, that the sample labels of the sample pairs are the same as the known sample labels of the sample pairs, the electronic device determines that model training is complete.

[0144] The electronic device determines the matrix parameters based on the model parameters of the model obtained after training. For each first sample content item, the electronic device inputs the sample features of the first sample content item into the target vector matrix determined by the matrix parameters to obtain the feature vector of the first sample content item. The feature vectors of multiple first sample content items constitute the target vector matrix.

[0145] (3) The electronic device obtains the feature vector of each first sample content item from the target vector matrix.

[0146] Before inputting the sample features of the first sample content items into the initial vector matrix, the electronic device may arrange the multiple first sample content items in chronological order from recent to recent or from recent to recent. In this way, the feature vectors of the multiple first sample content items in the resulting target vector matrix are also arranged in this order. In this step, the electronic device may sequentially obtain the feature vectors of each first sample content item in this order.

[0147] The feature vector of each first sample content item obtained through the target vector matrix can well express its own semantic information and be distinguished from the feature vectors of other first sample content items.

[0148] In an embodiment of the present application, contrastive learning is used to interpret the same first sample content item in two different ways, and then the copies processed in the two ways are compared. This is equivalent to learning the representation of the sample content item from multiple channels, and the learning is more comprehensive. Therefore, the reliability of the negative sample content item obtained by screening is higher.

[0149] Step 307: The electronic device filters negative sample content items from the plurality of first sample content items based on the feature vectors of the plurality of first sample content items and the feature vectors of the plurality of second sample content items.

[0150] This step can be achieved by following the steps (1) to (3), including:

[0151] (1) For each second sample content item, the electronic device determines the similarity between a feature vector of the second sample content item and feature vectors of multiple first sample content items to obtain multiple similarities.

[0152] In this step, the electronic device may also determine the similarity between the second sample content item and each first sample content item by using a vector inner product to obtain multiple similarities. Alternatively, the electronic device may determine the similarity by determining the Euclidean distance between the feature vector of the second sample content item and the feature vector of the first sample content item.

[0153] In this step, the electronic device may determine the similarity in the same manner as or different from the similarity in step 306 (1), and this is not specifically limited.

[0154] (2) The electronic device obtains recommended parameters.

[0155] The recommendation parameter is used to indicate the similarity between the content item recommended to the target account and the second sample content item. The electronic device can obtain the recommendation parameter set by the user.

[0156] In the embodiment of the present application, the recommendation parameters can be set and changed as needed. If you want to increase the learning difficulty of the model, you can set a higher recommendation parameter so that the similarity between the negative sample content items and the second sample content items is higher. If simple negative sample content items are needed to achieve rapid model convergence, you can set a lower recommendation parameter so that the similarity between the negative sample content items and the second sample content items is lower.

[0157] (3) Based on the recommendation parameter, the electronic device selects, from the plurality of first sample content items, first sample content items whose similarity meets the recommendation parameter as negative sample content items.

[0158] Based on the recommendation parameter, the electronic device selects a first sample content item whose similarity is not less than the recommendation parameter from multiple first sample content items as a negative sample content item. Figure 4.

[0159] In the embodiments of the present application, negative sample content items are screened based on the similarity between the positive sample content item and the first sample content item, which can improve the reliability of the screened negative sample content items. Furthermore, different sample screening criteria can be adaptively formulated to take into account different model training requirements, making this method highly versatile and transferable.

[0160] Step 308: The electronic device uses the plurality of second sample content items as positive sample content items, performs model training based on the positive sample content items and the negative sample content items obtained by screening, and obtains a content item recommendation model.

[0161] The electronic device can perform model training based on the positive sample content items and the screened negative sample content items until the model meets the convergence condition, thereby obtaining a content item recommendation model.

[0162] In an embodiment of the present application, the electronic device separates the screening process of negative sample content items from the training process of the content item recommendation model, which not only improves the performance of model training but also avoids excessive overhead of model training.

[0163] After the electronic device obtains the content item recommendation model, it can obtain multiple content items to be recommended, determine the click rate of the target account for each content item to be recommended, select one or more content items with the highest click rate from the multiple content items to be recommended, and recommend the selected one or more content items to the target account.

[0164] In the embodiments of the present application, the electronic device may be provided as a terminal, may be provided as a server, or may be provided as a terminal and a server. Here, only the example of the electronic device being provided as a terminal and a server is used for explanation.

[0165] If the electronic device is provided as a terminal and a server, the server screens the negative sample content items and performs model training based on the positive sample content items and the screened negative sample content items to obtain a content item recommendation model. The terminal is installed with a target application, and the server can pre-acquire multiple content items to be recommended, select one or more content items with the highest click-through rate from the multiple content items to be recommended according to the content item recommendation model, and send the selected one or more content items to the terminal. When the user opens the target application, the terminal displays the one or more content items on the main interface of the target application based on the received one or more content items. Alternatively, the terminal displays one or more content items on the content recommendation interface before entering the main interface of the target application.

[0166] For example, the server predetermines one or more content items, and the terminal directly displays the one or more content items when displaying the main interface of the target application. If the content item is a food advertisement, the terminal displays a recommendation box on the main interface of the target application. The recommendation box displays promotional food from one or more merchants, or displays the merchant name, coupons, and validity period of the coupons of one or more merchants. The recommendation box can also display the merchant's store entrance. When the terminal detects that the option corresponding to the store entrance is triggered, it jumps from the current interface to the main interface of the store. The main interface of the store can display a variety of food, and users can select food according to their needs.

[0167] In an embodiment of the present application, when a user opens a target application and the terminal displays the main interface of the target application, the server may also obtain multiple content items to be recommended, select one or more content items with the highest click-through rate from the multiple content items to be recommended based on the content item recommendation model, and send the selected one or more content items to the terminal, so that the terminal displays the received one or more content items on the main interface. Alternatively, when the terminal displays a content recommendation interface before the main interface of the target application, the server may determine one or more content items based on the content item recommendation model, send the one or more content items to the terminal, and the terminal displays the one or more content items on the content recommendation interface.

[0168] An embodiment of the present application provides a sample screening method, which performs different feature deletion processing on the same sample content item to obtain two copies of the same sample content item, and then determines the feature vector of each sample content item based on the copies of multiple sample content items. Since the obtained feature vector can represent the content information of the sample content item, the negative sample content items screened based on the content information have high reliability, and the model trained based on the screened negative sample content items has high accuracy, thereby improving the content item recommendation effect.

[0169] Figure 5 This is a schematic diagram of the structure of a sample screening device provided in an embodiment of the present application, see Figure 5 , the device comprises:

[0170] An acquisition module 501 is configured to acquire a plurality of first sample content items and a plurality of second sample content items, wherein the first sample content items are historical content items recommended to a target account, and the second sample content items are content items that have been clicked on by the target account in the past;

[0171] A processing module 502 is configured to perform a first feature deletion process and a second feature deletion process on each first sample content item, respectively, to obtain a first copy and a second copy;

[0172] A first determining module 503 is configured to determine a feature vector of each first sample content item based on the first and second copies of the plurality of first sample content items, where the feature vector is used to represent content information of the first sample content item;

[0173] The screening module 504 is configured to screen negative sample content items from the plurality of first sample content items based on the feature vectors of the plurality of first sample content items and the feature vectors of the plurality of second sample content items, where the negative sample content items are used to train the content item recommendation model.

[0174] In one possible implementation, the first determination module 503 is configured to construct a plurality of sample pairs based on the first and second copies of a plurality of first sample content items; determine a sample label for each sample pair; and determine a feature vector for each first sample content item based on the plurality of sample pairs and the sample label of each sample pair.

[0175] In another possible implementation, the first determination module 503 is configured to, for each sample pair, determine that the sample label of the sample pair is a positive label if the sample pair is composed of different copies of the same first sample content item; and determine that the sample label of the sample pair is a negative label if the sample pair is composed of copies of different first sample content items.

[0176] In another possible implementation, the first determination module 503 is used to determine, for each sample pair, the similarity between the two copies in the sample pair based on the sample features of the two copies in the sample pair; determine a target vector matrix based on the similarities and sample labels of multiple sample pairs, wherein the target vector matrix stores feature vectors of multiple first sample content items; and obtain the feature vector of each first sample content item from the target vector matrix.

[0177] In another possible implementation, the screening module 504 is used to determine, for each second sample content item, the similarity between a feature vector of the second sample content item and feature vectors of multiple first sample content items, to obtain multiple similarities; obtain a recommendation parameter, where the recommendation parameter is used to represent the similarity between the content item recommended to the target account and the second sample content item; and based on the recommendation parameter, screen, from the multiple first sample content items, a first sample content item whose similarity meets the recommendation parameter as a negative sample content item.

[0178] In another possible implementation, the apparatus further includes:

[0179] The training module is used to take the plurality of second sample content items as positive sample content items; perform model training based on the positive sample content items and the negative sample content items obtained by screening to obtain a content item recommendation model.

[0180] In another possible implementation, the processing module 502 is used to determine at least one of a single-valued sample feature and a sequence sample feature in the first sample feature based on the first sample feature of the first sample content item, where the single-valued sample feature is used to indicate that the first sample feature is an independent feature, and the sequence sample feature is used to indicate that the first sample feature is a feature associated with time; based on at least one of the single-valued sample feature and the sequence sample feature in the first sample feature, the first feature deletion processing is performed on the first sample content item to obtain a first copy.

[0181] In another possible implementation, the processing module 502 is configured to discard a preset number of single-valued sample features in the single-valued sample features to obtain a first copy; and set some sequence sample features in the sequence sample features to zero to obtain the first copy.

[0182] An embodiment of the present application provides a sample screening device that performs different feature deletion processing on the same sample content item to obtain two copies of the same sample content item, and then determines a feature vector for each sample content item based on the copies of multiple sample content items. Since the obtained feature vector can represent the content information of the sample content item, the negative sample content items screened based on the content information have high reliability, and the model trained based on the screened negative sample content items has high accuracy, thereby improving the content item recommendation effect.

[0183] It should be noted that the sample screening device provided in the above embodiment is merely an example of the division of the functional modules described above when screening samples. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the electronic device can be divided into different functional modules to complete all or part of the functions described above. In addition, the sample screening device provided in the above embodiment and the sample screening method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0184] If the electronic device is provided as a terminal, see Figure 6 , Figure 6 The following is a block diagram of a terminal 600 according to an exemplary embodiment of the present application. Terminal 600 may be a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. Terminal 600 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other similar names.

[0185] Typically, the terminal 600 includes a processor 601 and a memory 602 .

[0186] The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 601 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0187] The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 602 is used to store at least one program code, which is executed by the processor 601 to implement the sample screening method provided in the method embodiment of the present application.

[0188] In some embodiments, terminal 600 may optionally include a peripheral device interface 603 and at least one peripheral device. Processor 601, memory 602, and peripheral device interface 603 may be connected via a bus or signal lines. Each peripheral device may be connected to peripheral device interface 603 via a bus, signal lines, or circuit boards. Specifically, the peripheral device may include at least one of a radio frequency circuit 604, a touchscreen display 605, a camera 606, an audio circuit 607, a positioning component 608, and a power supply 609.

[0189] The peripheral device interface 603 can be used to connect at least one I / O (Input / Output)-related peripheral device to the processor 601 and the memory 602. In some embodiments, the processor 601, the memory 602, and the peripheral device interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 601, the memory 602, and the peripheral device interface 603 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

[0190] The radio frequency circuit 604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 604 communicates with communication networks and other communication devices via electromagnetic signals. The radio frequency circuit 604 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The radio frequency circuit 604 can communicate with other terminals via at least one wireless communication protocol. Such wireless communication protocols include, but are not limited to, metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the radio frequency circuit 604 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.

[0191] Display screen 605 is used to display a user interface (UI). This UI can include graphics, text, icons, videos, or any combination thereof. When display screen 605 is a touchscreen display, it can also capture touch signals on or above the surface of display screen 605. These touch signals can be input as control signals to processor 601 for processing. Display screen 605 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there can be a single display screen 605, located on the front panel of terminal 600. In other embodiments, there can be at least two display screens 605, located on different surfaces of terminal 600 or in a foldable design. In still other embodiments, display screen 605 can be a flexible display, located on a curved or foldable surface of terminal 600. Display screen 605 can also be configured as a non-rectangular, irregular shape, also known as a special-shaped screen. Display screen 605 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0192] The camera assembly 606 is used to capture images or videos. Optionally, the camera assembly 606 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 606 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0193] The audio circuit 607 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals that are input into the processor 601 for processing, or input into the radio frequency circuit 604 to achieve voice communication. For the purpose of stereo sound collection or noise reduction, there may be multiple microphones, each located in different parts of the terminal 600. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert electrical signals from the processor 601 or the radio frequency circuit 604 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 607 may also include a headphone jack.

[0194] Positioning component 608 is used to locate the current geographic location of terminal 600 to implement navigation or LBS (Location Based Service). Positioning component 608 can be based on the US GPS (Global Positioning System), China's BeiDou system, Russia's Greninja system, or the European Union's Galileo system.

[0195] Power supply 609 is used to power various components in terminal 600. Power supply 609 can be AC ​​power, DC power, disposable batteries, or rechargeable batteries. When power supply 609 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0196] In some embodiments, the terminal 600 further includes one or more sensors 610 , including but not limited to: an acceleration sensor 611 , a gyroscope sensor 612 , a pressure sensor 613 , a fingerprint sensor 614 , an optical sensor 615 , and a proximity sensor 616 .

[0197] The accelerometer 611 can detect the magnitude of acceleration along the three coordinate axes of the coordinate system established by the terminal 600. For example, the accelerometer 611 can be used to detect the components of gravity acceleration along the three coordinate axes. The processor 601 can control the touch screen display 605 to display the user interface in a landscape or portrait view based on the gravity acceleration signal collected by the accelerometer 611. The accelerometer 611 can also be used to collect game or user motion data.

[0198] The gyroscope sensor 612 can detect the orientation and rotation angle of the terminal 600. It can work with the accelerometer 611 to collect the user's 3D movements on the terminal 600. Based on the data collected by the gyroscope sensor 612, the processor 601 can implement the following functions: motion sensing (for example, changing the UI based on the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0199] The pressure sensor 613 can be set on the side frame of the terminal 600 and / or the lower layer of the touch screen display 605. When the pressure sensor 613 is set on the side frame of the terminal 600, it can detect the user's grip signal of the terminal 600, and the processor 601 performs left and right hand recognition or shortcut operations based on the grip signal collected by the pressure sensor 613. When the pressure sensor 613 is set on the lower layer of the touch screen display 605, the processor 601 controls the operational controls on the UI interface based on the user's pressure operation on the touch screen display 605. The operational controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0200] The fingerprint sensor 614 is used to collect the user's fingerprint. The processor 601 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 614, or the fingerprint sensor 614 identifies the user's identity based on the collected fingerprint. When the user's identity is recognized as a trusted identity, the processor 601 authorizes the user to perform relevant sensitive operations, such as unlocking the screen, viewing encrypted information, downloading software, making payments, and changing settings. The fingerprint sensor 614 can be set on the front, back, or side of the terminal 600. When a physical button or manufacturer logo is provided on the terminal 600, the fingerprint sensor 614 can be integrated with the physical button or manufacturer logo.

[0201] The optical sensor 615 is used to detect ambient light intensity. In one embodiment, the processor 601 can control the display brightness of the touchscreen display 605 based on the ambient light intensity detected by the optical sensor 615. Specifically, when the ambient light intensity is high, the display brightness of the touchscreen display 605 is increased; when the ambient light intensity is low, the display brightness of the touchscreen display 605 is decreased. In another embodiment, the processor 601 can also dynamically adjust the shooting parameters of the camera assembly 606 based on the ambient light intensity detected by the optical sensor 615.

[0202] Proximity sensor 616, also known as a distance sensor, is typically located on the front panel of terminal 600. Proximity sensor 616 is used to detect the distance between the user and the front of terminal 600. In one embodiment, when proximity sensor 616 detects that the distance between the user and the front of terminal 600 is gradually decreasing, processor 601 controls touchscreen display 605 to switch from the screen-on state to the screen-off state. When proximity sensor 616 detects that the distance between the user and the front of terminal 600 is gradually increasing, processor 601 controls touchscreen display 605 to switch from the screen-off state to the screen-on state.

[0203] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the terminal 600, and the terminal 600 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0204] If the electronic device is provided as a server, see Figure 7 , Figure 7 This is a block diagram of the structure of an electronic device 700 provided in an embodiment of the present application. The electronic device 700 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 701 and one or more memories 702, wherein the memory 702 stores at least one program code, and the at least one program code is loaded and executed by the processor 701 to implement the methods provided in the above-mentioned various method embodiments. Of course, the electronic device 700 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The electronic device 700 may also include other components for implementing device functions, which will not be described in detail here.

[0205] If the electronic device is provided as a terminal and a server, the structural block diagrams of the terminal and the server can be respectively referred to Figure 6 and Figure 7 .

[0206] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory device including program code. The program code can be executed by a processor in an electronic device to perform the sample screening method of the above embodiment. For example, the computer-readable storage medium can be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.

[0207] In an exemplary embodiment, a computer program product is further provided. The computer program product stores at least one program code, and the at least one program code is loaded and executed by a processor to implement the sample screening method in the embodiment of the present application.

[0208] In some embodiments, the computer program involved in the embodiments of the present application may be deployed and executed on a computer device, or on multiple computer devices located at one location, or on multiple computer devices distributed at multiple locations and interconnected through a communication network. Multiple computer devices distributed at multiple locations and interconnected through a communication network may constitute a blockchain system.

[0209] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0210] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A sample screening method, characterized in that: The method comprises: Acquire multiple first sample content items and multiple second sample content items, where the first sample content items are historical content items recommended to a target account, and the second sample content items are content items that the target account has historically clicked on; For each first sample content item, performing a first feature deletion process and a second feature deletion process on the first sample content item to obtain a first copy and a second copy; determining a feature vector for each first sample content item based on the first and second copies of the plurality of first sample content items, where the feature vector is used to characterize content information of the first sample content item; Based on the feature vectors of the plurality of first sample content items and the feature vectors of the plurality of second sample content items, filtering negative sample content items from the plurality of first sample content items, wherein the negative sample content items are used to train a content item recommendation model; The determining, based on the first and second copies of the plurality of first sample content items, a feature vector of each first sample content item comprises: constructing a plurality of sample pairs based on the first and second copies of the plurality of first sample content items; Determine the sample label for each sample pair; determining a feature vector of each first sample content item based on the multiple sample pairs and the sample label of each sample pair; The determining, based on the plurality of sample pairs and the sample label of each sample pair, a feature vector of each first sample content item includes: For each sample pair, determining the similarity between the two copies in the sample pair based on the sample features of the two copies in the sample pair; Determine a target vector matrix based on the similarities and sample labels of the plurality of sample pairs, wherein the target vector matrix stores feature vectors of the plurality of first sample content items; Obtaining a feature vector of each first sample content item from the target vector matrix; The filtering of negative sample content items from the plurality of first sample content items based on the feature vectors of the plurality of first sample content items and the feature vectors of the plurality of second sample content items includes: For each second sample content item, determining a similarity between a feature vector of the second sample content item and the feature vectors of the plurality of first sample content items to obtain a plurality of similarities; obtaining a recommendation parameter, where the recommendation parameter is used to indicate a similarity between the content item recommended to the target account and the second sample content item; Based on the recommendation parameter, first sample content items whose similarity meets the recommendation parameter are selected from the plurality of first sample content items as negative sample content items.

2. The method according to claim 1, characterized in that Determining the sample label of each sample pair includes: For each sample pair, if the sample pair is composed of different copies of the same first sample content item, determine that the sample label of the sample pair is a positive label; If the sample pair is composed of copies of different first sample content items, the sample label of the sample pair is determined to be a negative label.

3. The method according to claim 1, characterized in that The method further comprises: taking the plurality of second sample content items as positive sample content items; Model training is performed based on the positive sample content items and the negative sample content items obtained by screening to obtain the content item recommendation model.

4. The method according to claim 1, wherein The process of performing a first feature deletion process on the first sample content item to obtain a first copy includes: determining, based on a first sample feature of the first sample content item, at least one of a single-valued sample feature and a sequence sample feature in the first sample feature, wherein the single-valued sample feature is used to indicate that the first sample feature is an independent feature, and the sequence sample feature is used to indicate that the first sample feature is a time-related feature; Based on at least one of the single-value sample feature and the sequence sample feature in the first sample feature, a first feature deletion process is performed on the first sample content item to obtain a first copy.

5. The method according to claim 4, characterized in that The performing a first feature deletion process on the first sample content item based on at least one of the single-value sample feature and the sequence sample feature in the first sample feature to obtain a first copy includes at least one of the following implementations: discarding a preset number of single-valued sample features from the single-valued sample features to obtain the first copy; Some of the sequence sample features are set to zero to obtain the first copy.

6. A sample screening device, characterized in that: The device comprises: an acquisition module, configured to acquire a plurality of first sample content items and a plurality of second sample content items, wherein the first sample content items are historical content items recommended to a target account, and the second sample content items are content items that the target account has historically clicked on; A processing module, configured to perform a first feature deletion process and a second feature deletion process on each first sample content item, respectively, to obtain a first copy and a second copy; a first determining module, configured to determine a feature vector of each first sample content item based on the first and second copies of the plurality of first sample content items, wherein the feature vector is used to represent content information of the first sample content item; a screening module, configured to screen negative sample content items from the plurality of first sample content items based on the feature vectors of the plurality of first sample content items and the feature vectors of the plurality of second sample content items, wherein the negative sample content items are used to train a content item recommendation model; Determining the feature vector of each first sample content item based on the first and second copies of the plurality of first sample content items includes: constructing a plurality of sample pairs based on the first and second copies of the plurality of first sample content items; determining a sample label for each sample pair; and determining the feature vector of each first sample content item based on the plurality of sample pairs and the sample label of each sample pair; The determining of the feature vector of each first sample content item based on the multiple sample pairs and the sample label of each sample pair includes: for each sample pair, determining the similarity between the two copies in the sample pair based on the sample features of the two copies in the sample pair; determining a target vector matrix based on the similarities and sample labels of the multiple sample pairs, wherein the feature vectors of the multiple first sample content items are stored in the target vector matrix; and obtaining the feature vector of each first sample content item from the target vector matrix; The method of screening negative sample content items from the multiple first sample content items based on the feature vectors of the multiple first sample content items and the feature vectors of the multiple second sample content items includes: for each second sample content item, determining the similarity between the feature vector of the second sample content item and the feature vectors of the multiple first sample content items to obtain multiple similarities; obtaining a recommendation parameter, where the recommendation parameter is used to represent the similarity between the content item recommended to the target account and the second sample content item; and based on the recommendation parameter, screening, from the multiple first sample content items, first sample content items whose similarity meets the recommendation parameter as negative sample content items.

7. An electronic device, characterized in that: The electronic device includes one or more processors and one or more memories, wherein at least one program code is stored in the one or more memories, and the at least one program code is loaded and executed by the one or more processors to implement the sample screening method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that The storage medium stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the sample screening method according to any one of claims 1 to 5.

9. A computer program product, characterized in that The computer program product stores at least one program code, and the at least one program code is loaded and executed by a processor to implement the sample screening method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Content recommendation method and device, computer equipment and storage medium

    CN111931075A

  • Recommended commodity information determination method and device, storage medium and electronic equipment

    CN112712418A