Data processing method, electronic device, and storage medium

CN117743840BActive Publication Date: 2026-11-03XINGIN INFORMATION TECH (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211685738.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-27
Publication Date
2026-11-03
Estimated Expiration
2042-12-27

AI Technical Summary

Technical Problem

In existing technologies, when training a model based on the feature similarity between object features and recommendation data features, the information is insufficient, resulting in low model accuracy and poor recommendation performance.

Method used

Construct a recommendation sample set, divide it into first and second feature sets, construct positive and negative sample feature sets, train the target model using the initial model, and combine multiple feature similarities for model training, including feature similarities between object features and recommendation feature sets, and between positive and negative sample feature sets.

Benefits of technology

This improved the model's prediction accuracy and enhanced the recommendation effect. By combining multiple feature similarities to train the model, it learned more information and improved the recommendation effect of the recommendation data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117743840B_ABST
    Figure CN117743840B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a data processing method, an electronic device and a storage medium, and are applied to the technical field of data processing. The method comprises the following steps: obtaining N recommendation sample sets; constructing a positive sample feature set and a negative sample feature set associated with each recommendation sample set based on a first recommendation subset and a second recommendation subset corresponding to each recommendation sample set; inputting the N recommendation sample sets, the positive sample feature set and the negative sample feature set into an initial model to obtain a first feature similarity, a second feature similarity and a third feature similarity corresponding to each recommendation sample set; training the initial model based on the three kinds of feature similarities to obtain a target model; obtaining a target object feature of a target object and a target feature set of recommendation data; and determining a target feature similarity between the target object feature and the target feature set based on the target model to determine a recommendation degree of the target object for the recommendation data. The embodiments of the present application can improve the recommendation effect for the recommendation data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a data processing method, electronic device and storage medium. Background Technology

[0002] In recommendation tasks, the main objective is to accurately predict the recommendation level of an object across multiple recommendation data sets, and based on this recommendation level, push recommended data that the object might be interested in to the object's terminal to improve recommendation performance. For example, if the recommendation data is notes, the recommendation level of an object for a note can be determined by determining the feature similarity between the object features of the object and the note features. Existing prediction methods typically construct feature pairs containing object features and recommendation data features to train an initial model using these feature pairs. For instance, the initial model is trained using the feature similarity between object features and recommendation data features in each feature pair. However, this approach, which trains solely on the feature similarity between object features and recommendation data features, results in insufficient information learned by the model, leading to low accuracy and poor recommendation performance for the recommended data. Summary of the Invention

[0003] This application provides a data processing method, an electronic device, and a storage medium, which can improve the recommendation effect of recommendation data.

[0004] On one hand, embodiments of this application provide a data processing method, the method comprising:

[0005] Obtain N recommendation sample sets; each recommendation sample set includes the object features of a sample object and a recommendation feature set of a recommendation sample, and each recommendation feature set includes feature information under multiple recommendation features; multiple recommendation features are divided into a first feature set and a second feature set based on the feature relevance between any two recommendation features; the recommendation feature set included in a recommendation sample set is divided into a first recommendation subset and a second recommendation subset based on the first feature set and the second feature set; N is a positive integer;

[0006] Based on the first recommendation subset and the corresponding second recommendation subset of each recommendation sample set, construct the positive sample feature set associated with each recommendation sample set and the associated N-1 negative sample feature sets;

[0007] Input N recommendation sample sets, the positive sample feature set associated with each recommendation sample set, and the N-1 negative sample feature sets associated with each recommendation sample set into the initial model to obtain the first feature similarity corresponding to each recommendation sample set, the second feature similarity corresponding to the positive sample feature set associated with each recommendation sample set, and the third feature similarity corresponding to the N-1 negative sample feature sets associated with each recommendation sample set.

[0008] The initial model is trained based on the first feature similarity, the second feature similarity, and the third feature similarity corresponding to each recommendation sample set, and the target model is obtained.

[0009] Obtain the target object features and the target feature set of the recommendation data. Determine the target feature similarity between the target object features and the target feature set based on the target model. Then, determine the recommendation degree of the target object for the recommendation data based on the target feature similarity.

[0010] On one hand, embodiments of this application provide a data processing apparatus, the apparatus comprising:

[0011] The acquisition module is used to acquire N recommendation sample sets. Each recommendation sample set includes the object features of a sample object and a recommendation feature set of the recommended sample. Each recommendation feature set includes feature information under multiple recommendation features. Multiple recommendation features are divided into a first feature set and a second feature set based on the feature relevance between any two recommendation features. The recommendation feature set included in a recommendation sample set is divided into a first recommendation subset and a second recommendation subset based on the first feature set and the second feature set. N is a positive integer.

[0012] The processing module is used to construct a set of positive sample features and a set of N-1 negative sample features associated with each recommended sample set based on the first recommended subset and the corresponding second recommended subset.

[0013] The processing module is also used to input N recommended sample sets, the positive sample feature set associated with each recommended sample set, and the N-1 negative sample feature sets associated with each recommended sample set into the initial model, and obtain the first feature similarity corresponding to each recommended sample set, the second feature similarity corresponding to the positive sample feature set associated with each recommended sample set, and the third feature similarity corresponding to the N-1 negative sample feature sets associated with each recommended sample set.

[0014] The processing module is also used to train an initial model based on the first feature similarity, the second feature similarity, and the third feature similarity corresponding to each recommendation sample set, to obtain the target model;

[0015] The determination module is used to obtain the target object features of the target object and the target feature set of the recommendation data, determine the target feature similarity between the target object features and the target feature set based on the target model, and determine the recommendation degree of the target object for the recommendation data based on the target feature similarity.

[0016] On one hand, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory is used to store a computer program, the computer program including program instructions, and the processor is configured to invoke the program instructions to execute some or all of the steps in the above method.

[0017] On one hand, embodiments of this application provide a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, are used to perform some or all of the steps in the above-described method.

[0018] Accordingly, according to one aspect of this application, a computer program product or computer program is provided, comprising program instructions stored in a computer-readable storage medium. A processor of a computer device reads the program instructions from the computer-readable storage medium and executes the program instructions, causing the computer device to perform some or all of the steps in the above-described method.

[0019] In this embodiment, N recommendation sample sets can be obtained. Based on the first and second recommendation subsets corresponding to each recommendation sample set, a positive sample feature set and a negative sample feature set associated with each recommendation sample set are constructed. Each positive sample feature set and each negative sample feature set includes two types of features (e.g., two recommendation subsets, such as the first and second recommendation subsets corresponding to the same recommendation sample set or the first and second recommendation subsets corresponding to different recommendation sample sets). The N recommendation sample sets, the positive sample feature set associated with each recommendation sample set, and the negative sample feature set are input into the initial model to obtain the first feature similarity, the second feature similarity, and the third feature similarity corresponding to each recommendation sample set. The initial model is trained based on the corresponding first feature similarity, second feature similarity, and third feature similarity to obtain the target model. The target object features of the target object and the target feature set of the recommendation data are obtained. The target feature similarity between the target object features and the target feature set is determined based on the target model. The recommendation degree of the target object for the recommendation data is determined based on the target feature similarity. The above method not only combines the first feature similarity of the recommendation sample set (e.g., the feature similarity between object features and recommendation feature sets) to train the initial model, but also combines the second feature correlation of the positive sample feature set associated with each recommendation sample set (e.g., the feature similarity between two features included in the positive sample feature set) and the third feature similarity of the negative sample feature set (e.g., the feature similarity between two features included in the negative sample feature set). This allows the initial model to learn more information based on the aforementioned multiple feature similarities during training, making the predictions of the trained target model more accurate, thereby improving the recommendation effect for recommendation data. Attached Figure Description

[0020] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 A schematic diagram illustrating a recommendation scenario for recommendation data provided in an embodiment of this application;

[0022] Figure 2 A flowchart illustrating a data processing method provided in an embodiment of this application;

[0023] Figure 3 A flowchart illustrating a data processing method provided in an embodiment of this application;

[0024] Figure 4 A schematic diagram of a scenario for training an initial model, provided as an embodiment of this application;

[0025] Figure 5 This application provides a schematic diagram of a recommended scenario for a target object.

[0026] Figure 6 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;

[0027] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0029] The data processing method proposed in this application is implemented in an electronic device, which can be a server or a terminal. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, and big data and artificial intelligence platforms. The terminal can be a smartphone, tablet computer, laptop computer, desktop computer, etc., but is not limited to these.

[0030] This application proposes a data processing method. This method acquires N recommendation sample sets, constructs a set of positive sample features and N-1 sets of negative sample features associated with each recommendation sample set based on a first subset and a second subset corresponding to each set, and trains an initial model using the N recommendation sample sets, the associated positive sample features, and the associated N-1 sets of negative sample features to obtain a trained target model. Specifically, the process involves training an initial model using the N recommendation sample sets, the associated positive sample features, and the associated N-1 sets of negative sample features to obtain a first feature similarity, a second feature similarity for each associated positive sample feature set, and a third feature similarity for each associated N-1 sets of negative sample features. The initial model is then trained based on these first, second, and third feature similarities to obtain the target model. During model training, this method can combine multiple feature similarities to learn more information, thereby improving the model's prediction accuracy.

[0031] Subsequently, the recommendation level of the target object relative to the recommendation data can be determined using the target model. For example, the target model can be used to determine the target feature similarity between the target object features of the target object and the target feature set of the recommendation data, and the recommendation level can be determined based on this target feature similarity.

[0032] A recommendation sample set includes the object features of a sample object and a recommendation feature set of the recommended samples. A recommendation feature set includes feature information under multiple recommendation features. There is a feature correlation between any two recommendation features, and multiple recommendation features can be divided into a first feature set and a second feature set based on the feature correlation between any two recommendation features. Correspondingly, multiple feature information from the recommendation feature set included in each recommendation sample set can be divided into the corresponding first recommendation subset and second recommendation subset based on the division results of multiple recommendation features.

[0033] For example, recommendation feature 1 is the number of likes and recommendation feature 2 is the number of views. Recommendation feature 1 is assigned to the first feature set and recommendation feature 2 is assigned to the second feature set. The recommendation feature set consists of feature information 1 under recommendation feature 1 (e.g., representing 100 likes) and feature information 2 under recommendation feature 2 (e.g., representing 100 views). Therefore, feature information 1 is assigned to the first recommendation subset and feature information 2 is assigned to the second recommendation subset.

[0034] Therefore, a schematic diagram of a recommendation scenario based on this data processing method can be shown as follows: Figure 1As shown, the electronic device can acquire N recommendation sample sets, each including two different features, such as object features of a sample object and a recommendation feature set of a recommended sample. Multiple feature information from the recommendation feature set included in each recommendation sample set can be divided into their respective first and second recommendation subsets. Based on the first and second recommendation subsets corresponding to each recommendation sample set, a positive sample feature set and N-1 associated negative sample feature sets are constructed for each recommendation sample set. Using an initial model, the first feature similarity corresponding to each recommendation sample set, the second feature similarity corresponding to the associated positive sample feature set, and the third feature similarity corresponding to the associated N-1 negative sample feature sets are obtained. The initial model is then trained based on the first, second, and third feature similarities to obtain the target model. Subsequently, the target object features of the target object and the target feature set of the recommendation data can be acquired. The target model is used to determine the target feature similarity between the target object features and the target feature set to obtain the recommendation degree of the target object for the recommendation data. The electronic device can then determine the recommendation data to be recommended based on the recommendation degree for the recommendation data.

[0035] Both the positive and negative sample feature sets include two different types of features. For example, the positive sample feature set includes a first and a second recommendation subset corresponding to the same recommendation sample set. The negative sample feature set includes a first and a second recommendation subset corresponding to different recommendation sample sets. In other words, the first feature similarity is the feature similarity between the two features included in the recommendation sample set. The second feature similarity is the feature similarity between the two features included in the positive sample feature set. The third feature similarity is the feature similarity between the two features included in the negative sample feature set.

[0036] Optionally, in some embodiments, the electronic device can execute the data processing method according to actual business needs to improve the recommendation effect for the recommendation data. The technical solution of this application can be applied to recommendation scenarios for any type of recommendation data. For example, the recommendation data can be notes published by online objects. A recommendation sample set can be constructed based on the object features of the online objects and the note feature set. A target model can be trained based on the recommendation sample set according to the technical solution proposed in this application. The recommendation degree of the online object for the notes can be determined through the target model, thereby identifying the notes to be recommended for the online object. For example, the recommendation data can be live streaming rooms. A recommendation sample set can be constructed based on the object features of the online objects and the live streaming room feature set. A target model can be trained based on the recommendation sample set according to the technical solution proposed in this application. The recommendation degree of the online object for the live streaming rooms can be determined through the target model, thereby identifying the live streaming rooms to be recommended for the online object.

[0037] It should be noted that in specific embodiments of this application, when scenarios involving the acquisition of user information and related data, such as user characteristics, user permission or consent is required. That is, when these embodiments are applied to specific products or technologies, the collection, use, and processing of relevant user data comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, a prompt message can be issued through an interactive interface to indicate what data will be collected or acquired. Specifically, the types and content of this data can be presented to the user through a list or similar method. Further data collection and processing will only proceed after a confirmation or instruction to allow data collection is received on the interactive interface.

[0038] It is understood that the above scenarios are merely examples and do not constitute a limitation on the application scenarios of the technical solutions provided in the embodiments of this application. The technical solutions of this application can also be applied to other scenarios. For example, as those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0039] Based on the foregoing description, this application proposes a data processing method that can be executed by the aforementioned electronic device. Please refer to... Figure 2 , Figure 2 This is a flowchart illustrating a data processing method provided in an embodiment of this application.

[0040] like Figure 2 As shown, the data processing method of this application embodiment may include the following flow:

[0041] S201. Obtain N recommendation sample sets.

[0042] In some embodiments, N is a positive integer. A recommendation sample set includes the object features of a sample object and a recommendation feature set of the recommendation sample. A recommendation feature set includes feature information under multiple recommendation features. The recommendation sample set can be obtained based on online objects and recommendation data of online objects generating recommendation behaviors. For example, online objects within a preset time period (e.g., within 3 months) and recommendation data of online objects performing recommendation behaviors can be collected, and the object features of the online objects and the recommendation feature set of the corresponding recommendation data of the online objects can be obtained. A recommendation sample set can be constructed based on the object features of the online objects and the recommendation feature set of the corresponding recommendation data. Here, a recommendation behavior indicates that an online object has generated a valid recommendation for the recommendation data. The specific type of recommendation behavior can be determined according to the specific recommendation scenario. For example, it could be an online object clicking on the recommendation data, an online object browsing the recommendation data for a specified duration, etc. There is no limitation here.

[0043] In other words, a recommendation sample set is determined based on an online object and the recommendation data from which that online object performed a recommendation action. For example, if online object A performed a recommendation action on recommendation data A and online object B performed a recommendation action on recommendation data B, then the object feature A of online object A and the recommendation feature set A of recommendation data A can be considered as a recommendation sample set, including the object features of the sample objects and the recommendation feature set of the recommended samples. Correspondingly, the object feature B of online object B and the recommendation feature set B of recommendation data B can be considered as a recommendation sample set.

[0044] It can be understood that when an online user makes a recommendation based on a set of recommended data, it can be considered that the online user is interested in that data, and the recommendation level for that data can be considered to be a first preset value (e.g., 1). When an online user does not make a recommendation based on a set of recommended data, it can be considered that the online user is not interested in that data, and the recommendation level for that data can be considered to be a second preset value (e.g., 0).

[0045] In some embodiments, the object features of a sample object may include feature information under one or more object attribute features, which can be used to characterize the relevant attributes of the sample object. The recommendation feature set of a recommended sample may include feature information under multiple recommendation features. These multiple recommendation features can be used to characterize the relevant attributes of the recommended sample. Feature information refers to the specific information under the corresponding feature. For example, if the recommendation feature is the number of likes, and the feature information is 100, it means that the recommended data has 100 likes. The aforementioned multiple object attribute features and multiple recommendation features are specific feature types set based on a specific recommendation scenario. There are no limitations on object attribute features and recommendation features here.

[0046] For example, object attribute features can be based on the object's basic profile and object behavior settings. For instance, object attribute features based on the object's basic profile could be the object's age, gender, etc.; object attribute features based on object behavior could refer to the object's behavioral characteristics in response to recommendation data. For example, if the recommendation data is notes, object attribute features could be the object's like sequence for notes (e.g., the object's like sequence for notes within three days or one week), the object's favorite sequence for notes (e.g., the object's favorite sequence for notes within three days or one week), and so on. These sequences can be determined based on the note identifiers of the liked or favorited notes, and the note identifier for each published note can be obtained according to a preset generation rule. This generation rule can be set according to the actual recommendation scenario.

[0047] For example, recommendation features can be data recommended to the target device, such as notes published by online users or live streams by broadcasters. Recommendation features can be set based on the behavior of other users towards the recommended data, the basic profile of the recommended data, and the basic profile of the user to which the recommended data belongs. Taking notes as an example, recommendation features set based on the basic profile of the recommended data could be note type, tags carried by the note, posting time of the note, etc.; recommendation features set based on the basic profile of the user could be the age of the note's publisher, the identifier of the note's publisher, etc.; recommendation features set based on the behavior of other users towards the recommended data could be the total number of times the note was liked by users within one or three days, the sequence of likes for the note within one or three days, the sequence of collections for the note within one or three days, etc.

[0048] In some embodiments, the aforementioned multiple recommendation features can be divided into a first feature set and a second feature set based on the feature relevance between any two recommendation features. The first feature set includes at least one recommendation feature, and the second feature set includes at least one recommendation feature. The divided first feature set and second feature set are two related feature sets, meaning that the recommendation features included in the first feature set and the recommendation features included in the second feature set have a high feature relevance. Alternatively, the recommendation features in the first feature set and the recommendation features in the second feature set are related recommendation features. For a detailed description of the specific method for dividing these multiple recommendation features, please refer to the relevant descriptions in the following embodiments.

[0049] Accordingly, the recommendation feature set included in each recommendation sample set can be divided based on the first feature set and the second feature set. That is, the recommendation feature set included in a recommendation sample set can be divided into a first recommendation subset and a second recommendation subset based on the first feature set and the second feature set. Each recommendation sample set corresponds to a first recommendation subset and a second recommendation subset. The first recommendation subset includes feature information under at least one recommendation feature indicated by the first feature set, and the second recommendation subset includes feature information under at least one recommendation feature indicated by the second feature set. It can be understood that the first feature set and the second feature set are related, meaning that the feature information in the first recommendation subset is related to the feature information in the second recommendation subset; in other words, the feature similarity between the feature information in the first recommendation subset and the feature information in the second recommendation subset is high.

[0050] For example, multiple recommendation features include recommendation features 1-4. Recommendation features 1 and 3 are assigned to the first feature set, and recommendation features 2 and 4 are assigned to the second feature set. The recommendation feature set includes feature information 1-4 under recommendation features 1-4. Therefore, feature information 1 and feature information 3 can be assigned to the first recommendation subset, and feature information 2 and feature information 4 can be assigned to the second recommendation subset. The feature information (feature information 1 and feature information 3) in the first recommendation subset has a high feature similarity to the feature information (feature information 2 and feature information 4) in the second recommendation subset.

[0051] It's understandable that a recommendation feature set represents the relevant features exhibited by a recommendation sample. Therefore, the first and second recommendation subsets from the same feature set have the highest feature similarity compared to first and second recommendation subsets from different feature sets. For example, the feature similarity between the first and second recommendation subsets from the same feature set can be considered to be 1. Furthermore, to better learn the information between the first and second recommendation subsets from the same feature set, the feature similarity between the first and second recommendation subsets from different feature sets can be considered to be 0.

[0052] S202. Based on the first recommendation subset and the corresponding second recommendation subset of each recommendation sample set, construct the positive sample feature set associated with each recommendation sample set and the associated N-1 negative sample feature sets.

[0053] In some embodiments, the first and second recommendation subsets corresponding to a given recommendation sample set can be considered as similar feature sets. Conversely, the first and second recommendation subsets corresponding to different recommendation sample sets can be considered as dissimilar feature sets. Therefore, the first and second recommendation subsets corresponding to a given recommendation sample set can be used as the positive sample feature set associated with that recommendation sample set, and a negative sample feature set associated with that recommendation sample set can be constructed based on the first recommendation subset corresponding to that recommendation sample set and the second recommendation subsets corresponding to other recommendation sample sets. Since there are N-1 other recommendation sample sets, N-1 corresponding negative sample feature sets can be obtained. It should be understood that the initial training objective of the model is to ensure that the feature similarity between the first and second recommendation subsets in the positive sample feature set is 1, and the feature similarity between the first and second recommendation subsets in the negative sample feature set is 0.

[0054] In other words, the positive sample feature set associated with the i-th recommendation sample set in the N recommendation sample sets includes: the first recommendation subset and the corresponding second recommendation subset corresponding to the i-th recommendation sample set. Any negative sample feature set associated with the i-th recommendation sample set includes: the first recommendation subset corresponding to the i-th recommendation sample set and the second recommendation subset corresponding to any recommendation sample set in the N recommendation sample sets other than the i-th recommendation sample set. i is a positive integer less than or equal to N.

[0055] For example, recommended sample set 1 corresponds to first recommended subset 1 and second recommended subset 1, recommended sample set 2 corresponds to first recommended subset 2 and second recommended subset 2, and recommended sample set 3 corresponds to first recommended subset 3 and second recommended subset 3; therefore, the positive sample feature set associated with recommended sample set 1 includes first recommended subset 1 and second recommended subset 1, the associated negative sample feature set 1 includes first recommended subset 1 and second recommended subset 2, and the associated negative sample feature set 2 includes first recommended subset 1 and second recommended subset 3.

[0056] S203. Input N recommended sample sets, the positive sample feature set associated with each recommended sample set, and the N-1 negative sample feature sets associated with each recommended sample set into the initial model to obtain the first feature similarity corresponding to each recommended sample set, the second feature similarity corresponding to the positive sample feature set associated with each recommended sample set, and the third feature similarity corresponding to the N-1 negative sample feature sets associated with each recommended sample set.

[0057] In some embodiments, N recommendation sample sets can be input into the initial model to obtain the first feature similarity corresponding to each recommendation sample set. Here, the first feature similarity corresponding to the i-th recommendation sample set is the feature similarity between the object features included in the i-th recommendation sample set and its recommendation feature set.

[0058] Furthermore, the positive sample feature sets associated with each recommended sample set can be input into the initial model to obtain the second feature similarity corresponding to the positive sample feature sets associated with each recommended sample set. Specifically, the second feature similarity corresponding to the i-th recommended sample set is the feature similarity between the first and second recommended subsets included in the positive sample feature set associated with the i-th recommended sample set. In other words, the second feature similarity is the feature similarity between the first and second recommended subsets corresponding to the i-th recommended sample set.

[0059] Furthermore, the N-1 negative sample feature sets associated with each recommended sample set can be input into the initial model to obtain the second feature similarity corresponding to each of the N-1 negative sample feature sets associated with each recommended sample set. One negative sample feature set yields one second feature similarity. The third feature similarity corresponding to the i-th recommended sample set is the feature similarity between the first and second recommended subsets included in each of the N-1 negative sample feature sets associated with the i-th recommended sample set. In other words, the third feature similarity is the feature similarity between the first recommended subset corresponding to the i-th recommended sample set and the second recommended subsets corresponding to other recommended sample sets.

[0060] In some embodiments, the first feature similarity corresponding to the i-th recommendation sample set obtained from the initial model can be obtained by performing feature processing on the object feature and the recommendation feature set in the i-th recommendation sample set respectively by the initial model to obtain the first vector corresponding to the object feature and the second vector corresponding to the recommendation feature set, and the similarity between the first vector corresponding to the object feature and the second vector corresponding to the recommendation feature set can be determined as the first feature similarity.

[0061] In some embodiments, obtaining the second feature similarity corresponding to the i-th recommended sample set from the initial model can be achieved by performing feature processing on the first recommended subset and the second recommended subset in the positive sample feature set associated with the i-th recommended sample set, respectively, to obtain the first vector corresponding to the first recommended subset in the positive sample feature set and the second vector corresponding to the second recommended subset in the positive sample feature set. The similarity between the first vector corresponding to the first recommended subset in the positive sample feature set and the second vector corresponding to the second recommended subset in the positive sample feature set can be determined as the second feature similarity.

[0062] In some embodiments, the third feature similarity corresponding to the i-th recommended sample set obtained from the initial model can be achieved by performing feature processing on the first recommended subset and the second recommended subset in the negative sample feature set associated with the i-th recommended sample set, respectively, to obtain the first vector corresponding to the first recommended subset in the negative sample feature set and the second vector corresponding to the second recommended subset in the negative sample feature set. The similarity between the first vector corresponding to the first recommended subset in the negative sample feature set and the second vector corresponding to the second recommended subset in the negative sample feature set can be determined as the third feature similarity.

[0063] Optionally, the initial model described above can determine and output the corresponding first and second vectors, and the electronic device can determine the corresponding first feature similarity, second feature similarity, and third feature similarity based on the corresponding first and second vectors. Alternatively, the initial model described above can determine and output the corresponding first feature similarity, second feature similarity, and third feature similarity. Specific methods for determining the aforementioned various feature similarities can be found in the relevant descriptions of the following embodiments.

[0064] S204. Train the initial model based on the first feature similarity, the second feature similarity, and the third feature similarity corresponding to each recommendation sample set to obtain the target model.

[0065] In some embodiments, the process of training the initial model may be as follows: determining a first loss value for the initial model for each recommended sample set based on the first feature similarity corresponding to each recommended sample set; determining a second loss value for the initial model for each recommended sample set based on the second feature similarity and the corresponding third feature similarity corresponding to each recommended sample set; and training the initial model using the first loss value and the second loss value to obtain the target model.

[0066] In some embodiments, the specific method for determining the second loss value of a recommendation sample set for the initial model based on the second feature similarity and the corresponding third feature similarity of the recommendation sample set can be designed based on the idea of ​​contrastive learning. For example, determining the second loss value Loss of the i-th recommendation sample set for the initial model. 2.i It could be:

[0067]

[0068] Among them, s(z) i ,z' i ) represents the second feature similarity corresponding to the positive sample feature set associated with the i-th recommendation sample set; z i z' represents the first subset of recommendations corresponding to the i-th recommendation sample set; i s(z) represents the second recommendation subset corresponding to the i-th recommendation sample set; i ,z' j z' represents the feature similarity of the j-th sample feature set among N sample feature sets (including the positive sample feature set associated with the i-th recommendation sample set and the associated N-1 negative sample feature sets); j τ represents the second recommended subset in the feature set of the j-th sample; τ represents the hyperparameter set.

[0069] Furthermore, the specific method for determining the first loss value can also refer to the method for determining the second loss value, that is, the first loss value is determined based on the implementation of contrastive learning. The method for determining the first loss value can be found in the relevant description of the following embodiments.

[0070] In some embodiments, training the initial model using the first loss value and the second loss value can be achieved by determining N first target loss values ​​for the initial model based on the first loss value of each recommended sample set for the initial model, and determining N second target loss values ​​for the initial model based on the second loss value of each recommended sample set for the initial model, and training the initial model using the first target loss value and the second target loss value to obtain the target model.

[0071] Wherein, the first target loss value Loss1 can be determined as follows:

[0072]

[0073] Among them, Loss 1.i This represents the first loss value of the i-th recommendation sample set in the N recommendation sample sets for the initial model.

[0074] Accordingly, the second objective loss value Loss2 can be determined as follows:

[0075]

[0076] Among them, Loss 2.i This represents the second loss value for the i-th recommendation sample set in the N recommendation sample sets for the initial model.

[0077] Therefore, training the initial model using the first and second target loss values ​​can be achieved by determining training loss values ​​for the initial model using N recommendation sample sets based on the first and second target loss values, and then training the initial model using these training loss values. The target model is obtained when the initial model training converges. The determination of the training loss value Loss can be as follows:

[0078] Loss = Loss1 + αLoss2

[0079] Here, α represents the hyperparameter. It can be understood that the training loss value at this point is the overall loss value of the initial model when predicting on N recommendation sample sets. These N recommendation sample sets can refer to a batch of sample data, which can be used to train the initial model in one round. Subsequently, multiple batches of sample data (each batch may or may not be repeated) can be obtained to train the initial model in multiple rounds to obtain the target model.

[0080] The initial model described above is trained based on multiple feature similarities, allowing it to learn more information and improve training performance. Furthermore, through two contrastive learning training processes (contrastive learning based on object features and recommendation feature sets, and contrastive learning based on the first and second recommendation subsets), it can better learn the similarities between object features and recommendation feature sets. This means it can effectively learn the commonalities (e.g., commonalities between recommendation sample sets and positive sample feature sets) and / or differences (e.g., differences between negative sample feature sets) between different features, resulting in more accurate predictions of feature similarity between object features and recommendation feature sets and improving the model's generalization ability. In addition, this approach reduces the workload of labeling sample data and automatically constructs a large amount of sample data (e.g., recommendation sample sets, positive sample feature sets, etc.) based on online object recommendation behavior, leading to better model fitting and higher accuracy.

[0081] In some embodiments, online data (such as online objects and recommendation data of online objects performing recommendation behaviors within an hour) may be collected at specified intervals, and a recommendation sample set may be constructed based on the online data to obtain the latest recommendation sample set. Furthermore, at specified times, the previously deployed target model may be trained using the currently constructed recommendation sample set to update the model parameters. For example, a recommendation sample set may be constructed every hour of the day, and at the end of the day, the previously constructed recommendation sample set may be used to continue training the deployed target model according to the above process to update the model parameters. The latest trained target model may then be deployed for subsequent recommendations.

[0082] S205. Obtain the target object features of the target object and the target feature set of the recommendation data. Based on the target model, determine the target feature similarity between the target object features and the target feature set, and determine the recommendation degree of the target object for the recommendation data based on the target feature similarity.

[0083] In some embodiments, after training the target model, target object features of online target objects and target feature sets of recommendation data can be obtained. These target object features and target feature sets are then input into the target model, which makes predictions based on them to obtain the target feature similarity between the target object features and the target feature set. The target object features and target feature sets of the recommendation data can be pre-stored in a feature database. When recommendations for the target object are needed, they are retrieved from the feature database. Furthermore, since some feature information in the target object features and target feature sets is subject to change, the latest feature information can be retrieved at specified intervals to update the feature database, resulting in a more accurate target feature similarity. For example, if the target feature set of the recommendation data includes the number of likes, the latest number of likes for the recommendation data can be retrieved every hour and updated in the feature database.

[0084] For example, determining the target feature similarity from the target model can be achieved by obtaining the first target vector corresponding to the target object feature and the second target vector corresponding to the target feature set from the target model, and determining the similarity between the first target vector and the second target vector, and defining this similarity as the target feature similarity.

[0085] In some embodiments, the recommendation score of a target object for the recommended data can be determined based on the similarity of target features. This recommendation score represents the target object's level of interest in the recommended data. A higher similarity indicates a greater level of interest, making the recommended data more worthy of recommendation to the target object, thereby improving the recommendation effect. The recommendation score can be determined by setting the target feature similarity as the recommendation score. Alternatively, it can be determined based on the mapping relationship between feature similarity and recommendation score. This mapping relationship can be set according to empirical values.

[0086] For example, when a target object online is detected to meet recommendation criteria, the system retrieves the target feature set from multiple stored recommendation data sets, sequentially determines the recommendation score for each recommendation data set, and then makes recommendations based on that score. This could involve identifying recommendation data with a recommendation score greater than a threshold as the data to be recommended and pushing it to the target object's device. Meeting recommendation criteria could also occur when the target object opens the recommended application's homepage, triggering the push of recommendation data.

[0087] Therefore, this application embodiment employs a data processing mechanism for recommendation data. This mechanism not only trains the initial model by combining the first feature similarity of the recommendation sample set (e.g., the feature similarity between object features and recommendation feature sets), but also by combining the second feature correlation of the positive sample feature set associated with each recommendation sample set (e.g., the feature similarity between two features included in the positive sample feature set (i.e., the feature similarity between the first and second recommendation subsets corresponding to the same recommendation sample set)) and the third feature similarity of the negative sample feature set (e.g., the feature similarity between two features included in the negative sample feature set (i.e., the feature similarity between the first and second recommendation subsets corresponding to different recommendation sample sets)). This allows the initial model to learn more information based on the aforementioned multiple feature similarities during training, making the predictions of the trained target model more accurate and thus improving the recommendation effect for recommendation data.

[0088] Please see Figure 3 , Figure 3 This is a flowchart illustrating a data processing method provided in an embodiment of this application. This method can be executed by the aforementioned electronic device. Figure 3 As shown, the data processing method in this embodiment may include the following steps:

[0089] S301. Obtain N recommendation sample sets.

[0090] For a detailed description of the recommended sample set, please refer to the relevant description in the above embodiments.

[0091] It can be seen that the recommendation feature set in the recommendation sample set includes feature information under multiple recommendation features. There is a feature correlation between any two recommendation features under these multiple recommendation features, also known as feature mutual information. Based on the feature correlation between any two recommendation features, the multiple recommendation features can be divided to obtain a first feature set and a second feature set with high feature correlation. Based on the division results of the multiple recommendation features, the division result of the recommendation feature set in each recommendation sample set is determined, thus obtaining the first recommendation subset and the second recommendation subset corresponding to each recommendation sample set.

[0092] In some embodiments, the multiple recommendation features include a first recommendation feature and a second recommendation feature. The feature correlation between the first recommendation feature and the second recommendation feature can be understood as the feature correlation between any feature information under the first recommendation feature and any feature information under the second recommendation feature.

[0093] Let the first recommended feature include multiple first feature information, and the second recommended feature include multiple second feature information. Determining the feature relevance between the first and second recommended features can specifically involve constructing multiple feature information pairs for the multiple first and second feature information, where each feature information pair includes one first feature information and one second feature information. Based on the feature co-occurrence information corresponding to the first and second feature information included in each feature information pair, the feature relevance of each feature information pair is determined, and the feature relevance between the first and second recommended features is determined based on the feature relevance of each feature information pair. For example, the average relevance of the feature relevance of each feature information pair can be used to determine the feature relevance between the first and second recommended features. Alternatively, the sum of the feature relevance of each feature information pair can be used to determine the feature relevance between the first and second recommended features.

[0094] Optionally, a specified number (e.g., 1000) of recommended feature sets can be pre-selected, and multiple first feature information included in the first recommended feature can be determined based on the feature information under the first recommended feature contained in the specified number of recommended feature sets. Similarly, multiple second feature information included in the second recommended feature can be determined based on the feature information under the second recommended feature contained in the specified number of recommended feature sets. This allows for the determination of the feature correlation between the first and second recommended features based on these multiple recommended feature sets. For example, the deduplicated feature information from the feature information under the first recommended feature contained in the specified number of recommended feature sets can be determined as the first feature information. Likewise, the deduplicated feature information from the feature information under the second recommended feature contained in the specified number of recommended feature sets can be determined as the second feature information.

[0095] In some embodiments, each first feature and each second feature constitute a feature information pair. The feature relevance of each constructed feature information pair can be determined based on the specified number of recommended feature sets. That is, the feature relevance between the first and second feature information in the feature information pair. The specified number of recommended feature sets can be used to determine the feature co-occurrence information of the first and second feature information included in each feature information pair within the specified number of recommended feature sets, and the corresponding feature relevance can be determined based on this feature co-occurrence information.

[0096] In some embodiments, feature co-occurrence information may include first occurrence information of first feature information, second occurrence information of second feature information, and joint occurrence information of first and second feature information. Taking any one of a plurality of feature information pairs as a target feature information pair (assuming the target feature information pair includes first target feature information and second target feature information), determining the feature occurrence information of the target feature information pair may involve determining U recommended feature sets containing first target feature information, V recommended feature sets containing second target feature information, and R recommended feature sets simultaneously containing both first and second target feature information from a specified number of recommended feature sets. The ratio of the number of U recommended feature sets to the specified number is determined as the first occurrence information of the first target feature information, the ratio of the number of V recommended feature sets to the specified number is determined as the second occurrence information of the second target feature information, and the ratio of the number of R recommended feature sets to the specified number is determined as the joint occurrence information of the first and second target feature information. U, V, and R are integers.

[0097] Among them, according to the first occurrence information p(u) i ), the second occurrence information p(v) j ) and joint occurrence information p(u i ,v j Determine the feature relevance MI(u) of the target feature information pair. i ,v j It could be:

[0098]

[0099] Among them, u i This represents the first target feature information, which is the first feature information in any pair of feature information, i.e., the i-th first feature information among multiple first feature information, where 1 ≤ i ≤ the number of multiple first feature information; v j The second target feature information is the second feature information in any pair of feature information, that is, the j-th second feature information in a variety of second feature information, where 1≤j≤the number of multiple second feature information.

[0100] Therefore, the feature relevance of each feature information pair can be obtained through the above method. The sum of the feature relevance of each feature information pair can be determined as the feature relevance between the first and second recommended features. This allows us to obtain the feature relevance between any two recommended features. That is:

[0101]

[0102] Where U represents the first recommended feature and V represents the second recommended feature.

[0103] It is understandable that when the feature information under the first recommendation feature contained in a recommendation feature set meets the inclusion condition for the first target feature information, then the recommendation feature set is determined to contain the first target feature information. Recommendation features can be numerical (e.g., related age features), categorical (e.g., related gender features), or sequential (e.g., related like sequence features). The inclusion condition may differ for different types of recommendation features.

[0104] For example, let the feature information under a first recommendation feature contained in a recommendation feature set be the feature information to be compared. Taking numerical recommendation features as an example, the feature information to be compared and the first target feature information can be divided into corresponding categories according to the partitioning rules. If the category corresponding to the feature information to be compared is the same as the category corresponding to the first target feature information, then the feature information to be compared is determined to satisfy the inclusion condition for the first target feature information. That is to say, the inclusion condition for the first target feature information means that the category corresponding to the feature information to be compared is the same as the category corresponding to the first target feature information. The partitioning rules can be different for different numerical recommendation features, and can be set according to the specific scenario.

[0105] For example, the first recommended feature is the age of the target object, and the classification rule is [<18, 19-30, 31-40, 41-50, 51-60, >60]. If the first target feature information is 25, it is classified into 19-30. If the feature information to be compared is 23, it is also classified into 19-30. At this time, the feature information to be compared meets the inclusion condition for the first target feature information. If the feature information to be compared is 35, it is also classified into 31-40. At this time, the feature information to be compared does not meet the inclusion condition for the first target feature information.

[0106] For example, taking categorical recommendation features as an example, if the feature information to be compared is the same as the first target feature information, then it is determined that the feature information to be compared contains the inclusion condition for the first target feature information. That is, the inclusion condition for the first target feature information means that the feature information to be compared is the same as the first target feature information. For example, the first recommendation feature is the gender of the target user, and the first target feature information is female; if the feature information to be compared is female, then the feature information to be compared satisfies the inclusion condition for the first target feature information; if the feature information to be compared is male, then the feature information to be compared does not satisfy the inclusion condition for the first target feature information.

[0107] For example, taking sequence-based recommendation features as an example, if a predetermined number of sequence values ​​in the feature information to be compared all appear in the first target feature information, or a predetermined number of sequence values ​​in the first target feature information all appear in the feature information to be compared, then the feature information to be compared is determined to satisfy the inclusion condition for the first target feature information. In other words, the inclusion condition for the first target feature information means that the feature information to be compared contains a predetermined number of sequence values ​​in the first target feature information, or that the first target feature information contains a predetermined number of sequence values ​​in the feature information to be compared. The predetermined number can refer to the total number of sequence values ​​in a sequence, or it can refer to the number of sequence values ​​representing a specified proportion in a sequence, such as the number of 2 / 3 of the sequence values ​​in the first target feature information. No further limitation is made here.

[0108] For example, suppose the preset quantity indicated by the inclusion condition of the first target feature information is the total number of sequence values ​​in a sequence, the first recommendation feature is the like sequence of recommendation data within a day, and the first target feature information is [1,2,5,9,12,24]. If the feature information to be compared is [1,2,5,8,13,24], then each sequence value in the first target feature information does not appear in the feature information to be compared, and each sequence value in the feature information to be compared does not appear in the first target feature information. In this case, the feature information to be compared... The information does not meet the inclusion condition for the first target feature information; if the feature information to be compared is [1,2,5,9,12,24,25], then each sequence value in the first target feature information appears in the feature information to be compared, and the feature information to be compared satisfies the inclusion condition for the first target feature information; if the feature information to be compared is [1,2,5,9,12], then each sequence value in the feature information to be compared appears in the first target feature information, and the feature information to be compared satisfies the inclusion condition for the first target feature information.

[0109] Accordingly, when the feature information under the second recommended feature contained in a recommended feature set satisfies the inclusion condition for the second target feature information, it is determined that the recommended feature set contains the second target feature information. This inclusion condition for the second target feature information can be the same as the inclusion condition for the first target feature information. When the feature information under the first recommended feature contained in a recommended feature set satisfies the inclusion condition for the first target feature information and the feature information under the second recommended feature contained in the recommended feature set satisfies the inclusion condition for the second target feature information, it is determined that the recommended feature set contains both the first target feature information and the second target feature information.

[0110] It is understandable that the feature relevance between two recommendation features is determined based on the feature relevance between the individual feature information of each recommendation feature. The feature relevance between two feature information is determined by the co-occurrence of the two feature information within the recommendation feature set of a recommendation data set (i.e., a recommendation sample). The more recommendation feature sets where the two feature information co-occurs, the greater the feature relevance between them; in vector space, the vectors corresponding to these two feature information should be more similar. In other words, the feature relevance between two recommendation features can actually be understood as the feature relevance between the individual feature information of each recommendation feature. Since a recommendation feature typically contains multiple feature information, and the feature relevance between each feature information and each feature information contained in other recommendation features differs, a total feature relevance can be obtained based on the feature relevance between each feature information contained in one recommendation feature and each feature information contained in another recommendation feature. This total feature relevance is then used as the feature relevance between the two recommendation features. The greater this feature relevance, the more related the two recommendation features are; that is, the more similar the vectors corresponding to the individual feature information of the two recommendation features should be.

[0111] Optionally, multiple batches of a specified number of recommendation feature sets can be selected, and the feature correlation between any two recommendation features can be determined based on each batch of recommendation feature sets. For example, the average correlation between any two recommendation features determined based on each batch of recommendation feature sets can be used as the final feature correlation between any two recommendation features. It can be understood that each batch of recommendation feature sets is different, and the multiple first feature information and multiple second feature information determined based on different recommendation feature sets are different.

[0112] For example, the process of determining the feature relevance between two recommended features may include the following: obtaining N sets of recommended features; determining multiple first feature information contained in the first recommended feature from the feature information contained in the N sets of recommended features; determining multiple second feature information contained in the second recommended feature from the feature information contained in the N sets of recommended features; constructing multiple feature information pairs for each first feature information and each second feature information; any one of these multiple feature information pairs is the target feature information pair; the feature relevance of the target feature information pair is determined as follows:

[0113] From N recommended feature sets, determine U recommended feature sets containing the first target feature information. Specifically, determine whether the feature information under the first recommended feature contained in each recommended feature set meets the inclusion condition for the first target feature information. Determine the recommended feature sets that meet the inclusion condition for the first target feature information as U recommended feature sets containing the first target feature information, and determine the ratio of the number of U to N as the first occurrence information of the first target feature information.

[0114] From N recommended feature sets, V recommended feature sets containing the second target feature information are determined. Specifically, it is determined whether the feature information under the second recommended feature contained in each recommended feature set meets the inclusion condition for the second target feature information. The recommended feature sets that meet the inclusion condition for the second target feature information are determined as V recommended feature sets containing the second target feature information, and the ratio of the number of V to N is determined as the second occurrence information of the second target feature information.

[0115] From N recommended feature sets, determine R recommended feature sets that simultaneously contain first target feature information and second target feature information. Specifically, determine whether the feature information under the second recommended feature contained in each recommended feature set in U recommended feature sets satisfies the inclusion condition for the second target feature information. Determine the recommended feature sets in U recommended feature sets that satisfy the inclusion condition for the second target feature information as R recommended feature sets that simultaneously contain first target feature information and second target feature information, and determine the ratio of R to N as the joint occurrence information.

[0116] The feature relevance of the target feature information pair is determined based on the first occurrence information, the second occurrence information, and the joint occurrence information; the feature relevance of each feature information pair can be determined in the above manner to obtain the feature relevance between the first recommended feature and the second recommended feature.

[0117] In some embodiments, after determining the feature correlation between any two recommendation features, multiple recommendation features can be divided into a first feature set and a second feature set based on the feature correlation. Accordingly, the feature information in the recommendation feature set included in each recommendation sample set can be divided based on the first feature set and the second feature set to obtain a first recommendation subset and a second recommendation subset corresponding to each recommendation sample set.

[0118] In some embodiments, multiple recommendation feature sets are provided, including a first recommendation feature and a second recommendation feature, and the feature correlation between the first recommendation feature and the second recommendation feature is greater than a correlation threshold (when the feature correlation between two recommendation features is greater than the correlation threshold, the two recommendation features are considered to be relatively related features, that is, the corresponding vectors are relatively similar in the vector space). The method of partitioning multiple recommendation features is to partition the first recommendation feature into the first feature set and the second recommendation feature into the second feature set, that is, to make the two relatively related recommendation features as close to each other as possible to different feature sets. In other words, based on the feature correlation between any two recommendation features, two recommendation features with a feature correlation greater than the correlation threshold are arbitrarily selected for the first round of partitioning in the recommendation feature partitioning process.

[0119] In some embodiments, multiple recommendation feature sets include a third recommendation feature, and the partitioning result of the third recommendation feature can be determined based on the recommendation features already existing in the first and second feature sets. For example, if the feature correlation between the first and third recommendation features is less than the feature correlation between the second and third recommendation features, then the third recommendation feature is assigned to the first feature set; if the feature correlation between the first and third recommendation features is greater than the feature correlation between the second and third recommendation features, then the third recommendation feature is assigned to the second feature set. This makes the third recommendation feature more relevant to recommendation features in another feature set. That is, it aims to maximize the feature correlation between two recommendation features in different feature sets, thereby maximizing the feature correlation between the first and second feature sets.

[0120] In some embodiments, if the feature correlation between the first and third recommended features is equal to the feature correlation between the second and third recommended features, then the partitioning result of the third recommended feature can be determined by combining the recommended features related to the third recommended feature. Specifically, this can involve obtaining a fourth recommended feature and determining the partitioning result of the third recommended feature based on the feature correlation between the first and fourth recommended features and the feature correlation between the second and fourth recommended features. This partitioning result is used to indicate whether the third recommended feature should be assigned to the first feature set or the second feature set.

[0121] The fourth recommended feature can be a recommended feature whose feature relevance to the third recommended feature is greater than a relevance threshold. If no recommended feature has a feature relevance to the third recommended feature greater than the relevance threshold, then the recommended feature with the highest feature relevance to the third recommended feature is determined as the fourth recommended feature. For example, if the feature relevance between the third recommended feature and recommended feature B in recommended feature AD is greater than the relevance threshold, then recommended feature B is the fourth recommended feature. Alternatively, if the feature relevance between the third recommended feature and recommended features AD is not greater than the relevance threshold, and the feature relevance between recommended feature B and the third recommended feature is the highest among the feature relevances between recommended features AD and the third recommended feature, then recommended feature B is the fourth recommended feature.

[0122] In some embodiments, the partitioning result of the third recommended feature based on the feature relevance between the first recommended feature and the fourth recommended feature, and the feature relevance between the second recommended feature and the fourth recommended feature, can be as follows: if the feature relevance between the first recommended feature and the fourth recommended feature is greater than the feature relevance between the second recommended feature and the fourth recommended feature, then the third recommended feature is partitioned into the first feature set; if the feature relevance between the first recommended feature and the fourth recommended feature is less than the feature relevance between the second recommended feature and the fourth recommended feature, then the third recommended feature is partitioned into the second feature set.

[0123] Understandably, when the feature relevance between the first and fourth recommended features is greater than that between the second and fourth recommended features, the fourth recommended feature should be assigned to the second feature set, and the third recommended feature should be assigned to the first feature set accordingly. Conversely, when the feature relevance between the first and fourth recommended features is less than that between the second and fourth recommended features, the fourth recommended feature should be assigned to the first feature set, and the third recommended feature should be assigned to the second feature set accordingly. In this case, when obtaining the fourth recommended feature, it could be a recommended feature whose feature relevance to the third recommended feature is greater than a relevance threshold, and whose feature relevance to the first recommended feature and its relevance to the second recommended feature are different, thus serving as the fourth recommended feature.

[0124] Furthermore, if the feature correlation between the first and fourth recommended features is equal to the feature correlation between the second and fourth recommended features, and the multiple recommended features only include the first, second, third, and fourth recommended features, then the third and fourth recommended features can be assigned to any different feature sets.

[0125] Furthermore, if the feature correlation between the first and third recommended features is equal to the feature correlation between the second and third recommended features, and the multiple recommended features only include the first, second, and third recommended features, then the third recommended feature can be assigned to any feature set.

[0126] Therefore, the remaining recommendation features among the various recommendation features can be divided according to the above process. When dividing the remaining recommendation features, the division result is determined by combining the feature relevance between each remaining recommendation feature and the recommendation features in the first feature set, as well as the feature relevance between each remaining recommendation feature and the recommendation features in the second feature set. Let the remaining recommendation features include the fifth recommendation feature.

[0127] For example, if the maximum feature correlation between the fifth recommended feature and the recommended features in the first feature set is greater than the maximum feature correlation between the fifth recommended feature and the recommended features in the second feature set, then the remaining recommended features are assigned to the second feature set. If the maximum feature correlation between the fifth recommended feature and the recommended features in the first feature set is less than the maximum feature correlation between the fifth recommended feature and the recommended features in the second feature set, then the fifth recommended feature is assigned to the first feature set. If the maximum feature correlation between the fifth recommended feature and the recommended features in the first feature set is equal to the maximum feature correlation between the fifth recommended feature and the recommended features in the second feature set, then the assignment result of the fifth recommended feature is determined based on the sixth recommended feature. It can be understood that the assignment principle for the fifth recommended feature can be the same as that for the third recommended feature, and the description of the sixth recommended feature can be the same as that for the fourth recommended feature.

[0128] Furthermore, when determining whether a recommended feature should be assigned to the first feature set or the second feature set, in addition to considering the feature relevance between the recommended feature and existing recommended features in both sets, the number of existing recommended features in both sets can also be considered. For example, the assignment could aim to balance the number of existing recommended features in the first and second feature sets as much as possible. Specifically, if the difference between the maximum feature relevance between a recommended feature and a recommended feature in the first feature set and the maximum feature relevance between the recommended feature and a recommended feature in the second feature set is within a preset range (e.g., -0.5 to +0.5), the recommended feature should be assigned to the feature set with fewer recommended features.

[0129] Therefore, by dividing the more relevant recommendation features into different feature sets—that is, assigning recommendation features more relevant to one feature set to another—the resulting first and second feature sets can be considered more relevant. In other words, the recommendation features in the first feature set are more related (or similar) to those in the second feature set. Understandably, object features and recommendation feature sets within the same recommendation sample set are similar, requiring the learning of these commonalities. The information learned about the commonalities between the first and second feature sets corresponding to the same recommendation feature set can serve as an aid, better learning the commonalities between object features and recommendation feature sets within the same recommendation sample set, thereby improving the training performance of the initial model described below.

[0130] S302. Based on the first recommendation subset and the corresponding second recommendation subset for each recommendation sample set, construct a positive sample feature set and N-1 associated negative sample feature sets associated with each recommendation sample set. The specific implementation of step S302 can be found in the relevant descriptions of the above embodiments, and will not be repeated here.

[0131] S303. Input N recommended sample sets, the positive sample feature set associated with each recommended sample set, and the N-1 negative sample feature sets associated with each recommended sample set into the initial model to obtain the first feature similarity corresponding to each recommended sample set, the second feature similarity corresponding to the positive sample feature set associated with each recommended sample set, and the third feature similarity corresponding to the N-1 negative sample feature sets associated with each recommended sample set.

[0132] In some embodiments, the initial model may include a first sub-model and a second sub-model, and the model structures of the first and second sub-models may be identical. For example, both the first and second sub-models may include a feature processing layer and a feature generation layer. The feature processing layer processes the input data (e.g., object features) to obtain corresponding embedding vectors (e.g., the embedding vector of the object features). The feature generation layer processes the embedding vectors to obtain corresponding feature vectors (e.g., a first vector of the object features and a second vector of the recommended feature set). This feature vector is used to determine the corresponding feature similarity (e.g., determining the first feature similarity between the object features and the recommended feature set based on the first vector of the object features and the second vector of the recommended feature set). Optionally, the initial model may directly output the first and second vectors. Alternatively, the initial model may also include a similarity output layer, which outputs the corresponding feature similarity based on the first and second vectors. The feature generation layer may be a fully connected layer network. The network parameters and the number of network layers in the fully connected layer networks of the first and second sub-models may differ.

[0133] In some embodiments, taking the i-th recommendation sample set in an N recommendation sample set as an example, inputting the N recommendation sample sets into the initial model to obtain the first feature similarity corresponding to each recommendation sample set can specifically involve inputting the object features of the i-th recommendation sample set into the first sub-model, where the feature processing layer in the first sub-model performs feature processing on the object features of the i-th recommendation sample set to obtain the embedding vector corresponding to the object features of the i-th recommendation sample set, and where the feature generation layer in the first sub-model performs feature processing on the embedding vector corresponding to the object features of the i-th recommendation sample set to obtain the first vector corresponding to the object features of the i-th recommendation sample set; inputting the object features of the i-th recommendation sample set into the first sub-model, where the feature processing ... The set of recommended features in the set is input into the second sub-model. The feature processing layer in the second sub-model processes the recommended features in the i-th recommended sample set to obtain the embedding vector corresponding to the recommended features in the i-th recommended sample set. The feature generation layer in the second sub-model processes the embedding vector corresponding to the recommended features in the i-th recommended sample set to obtain the second vector corresponding to the recommended features in the i-th recommended sample set. Based on the first vector corresponding to the object features in the i-th recommended sample set and the second vector corresponding to the recommended features in the i-th recommended sample set, the first feature similarity between the object features in the i-th recommended sample set and its recommended features is determined.

[0134] In some embodiments, the process and principle of feature processing for object features in the i-th recommendation sample set are the same as those for feature processing for the recommendation feature set in the i-th recommendation sample set. The process of feature processing for the recommendation feature set is illustrated as an example. The recommendation feature set includes feature information under multiple recommendation features. The feature processing layer in the second sub-model includes a feature embedding matrix corresponding to each recommendation feature. The embedding vector corresponding to the feature information under each recommendation feature can be determined based on the feature information under each recommendation feature and its corresponding feature embedding matrix. The concatenated vector of the embedding vectors corresponding to the feature information under each recommendation feature is then used as the embedding vector of the recommendation feature set. Alternatively, the concatenated vector of the embedding vectors corresponding to the feature information under each recommendation feature can be mapped to a vector of a specified dimension, and the mapped vector is used as the final embedding vector of the recommendation feature set. The feature embedding matrix corresponding to each recommendation feature serves as the model parameter included in the feature processing layer of the second sub-model.

[0135] It should be noted that the second sub-model may include a first neural network, a second neural network, and a third neural network. The network structures (i.e., all including feature processing layers and feature generation layers) and network parameters of these three neural networks are identical. That is, the first, second, and third neural networks are Siamese networks, sharing model parameters. This maintains consistency in feature processing across different neural networks, allowing the model to better learn different features and improve its representational ability for different features. The recommended feature set mentioned above can be input into the first neural network of the second sub-model.

[0136] In some embodiments, the determination principle for the second feature similarity corresponding to a positive sample feature set and the third feature similarity corresponding to any negative sample feature set is the same. Here, a positive sample feature set is used as an example for illustration. Specifically, the process can be as follows: First recommended subset of the positive sample feature set is input into the second neural network of the second sub-model. The feature processing layer in the second neural network processes the first recommended subset of the positive sample feature set to obtain the embedding vector corresponding to the first recommended subset. Then, the feature generation layer in the first neural network processes the embedding vector corresponding to the first recommended subset of the positive sample feature set to obtain the first vector corresponding to the first recommended subset. Second recommended subset of the positive sample feature set is input into the third neural network of the second sub-model. The feature processing layer in the second sub-model processes the second recommended subset of the positive sample feature set to obtain the embedding vector corresponding to the second recommended subset. Then, the feature generation layer in the third neural network processes the embedding vector corresponding to the second recommended subset of the positive sample feature set to obtain the second vector corresponding to the second recommended subset. Finally, the second feature similarity between the first recommended subset and the second recommended subset of the positive sample feature set is determined based on the first vector and the second vector. The process and principle of feature processing for the first recommended subset and the second recommended subset of the positive sample feature set can be found in the feature processing process of the recommended feature set.

[0137] It should be noted that the feature processing layers in the first and second neural networks have the same structure and parameters. That is, the processing of the recommended feature set in the first neural network is the same as the processing of the first recommended subset in the second neural network. In other words, the vector dimension of the embedding vectors corresponding to the recommended feature set (before mapping) should be the same as the vector dimension of the embedding vectors corresponding to the first recommended subset. Therefore, when the second neural network outputs the embedding vectors corresponding to the first recommended subset, it needs to be padded based on the feature composition of the embedding vectors corresponding to the recommended feature set, and the padded embedding vectors are then input into the feature generation layer of the second neural network. Correspondingly, the embedding vectors corresponding to the second recommended subset obtained in the third neural network should also be padded, and the padded embedding vectors should be input into the feature generation layer of the third neural network. Furthermore, when obtaining the padded embedding vectors, they can be mapped in the same way as the embedding vectors corresponding to the recommended feature set to obtain vectors of a specified dimension, thereby determining the corresponding second feature similarity.

[0138] The first recommendation subset includes feature information under at least one recommendation feature, and the embedding vector corresponding to the first recommendation subset includes the embedding vector corresponding to the feature information under at least one recommendation feature. The padding process for the embedding vector corresponding to the first recommendation subset can be performed by obtaining the default embedding vector corresponding to the missing recommendation feature, and padding the embedding vector corresponding to the first recommendation subset based on the default embedding vector. For example, it can be done by concatenating the embedding vector corresponding to the first recommendation subset and the default embedding vector to obtain the padded embedding vector. Alternatively, the default embedding vector can be inserted into the embedding vector corresponding to the first recommendation subset according to the concatenation order indicated by the embedding vectors corresponding to the recommendation feature set to obtain the padded embedding vector. The principle for padding the embedding vector corresponding to the second recommendation subset is the same.

[0139] For example, the embedding vector corresponding to the first recommended subset includes the embedding vectors corresponding to the feature information under recommended features 1-3, and the concatenation order is recommended features 1-3; the embedding vector corresponding to the first recommended subset includes the embedding vector corresponding to the feature information under recommended feature 2. Let the embedding vector corresponding to the first recommended subset be 123, and the default embedding vectors corresponding to recommended features 1 and 3 are both 111; therefore, concatenating the embedding vector corresponding to the first recommended subset and the default embedding vector yields the padded embedding vector as: 123111111; inserting the default embedding vector into the embedding vector corresponding to the first recommended subset according to the concatenation order yields the padded embedding vector as: 111123111.

[0140] S304. Determine the first loss value for the initial model for each recommended sample set based on the first feature similarity corresponding to each recommended sample set.

[0141] In some embodiments, the first loss value for each recommendation sample set relative to the initial model can be determined based on the idea of ​​contrastive learning. Specifically, this can be achieved by constructing N-1 negative sample recommendation sets associated with each recommendation sample set based on the object features and recommendation feature sets included in each recommendation sample set. These N-1 negative sample recommendation sets are then input into the initial model, yielding the fourth feature similarity corresponding to each of the N-1 negative sample recommendation sets associated with each recommendation sample set. The first loss value for each recommendation sample set relative to the initial model can be determined based on both the first feature similarity and the corresponding fourth feature similarity. One fourth feature similarity is obtained for each negative sample recommendation set.

[0142] In this context, any negative sample recommendation set associated with the i-th recommendation sample set from multiple recommendation sample sets includes the object features included in the i-th recommendation sample set and the recommendation feature sets included in any recommendation sample set from the N recommendation sample sets other than the i-th recommendation sample set. i is a positive integer less than or equal to N. The construction principle of the negative sample recommendation set is the same as that of the negative sample feature set. That is, object features and recommendation feature sets within the same recommendation sample set are considered positive samples, while object features and recommendation feature sets from different recommendation sample sets are considered negative samples.

[0143] For example, multiple recommendation sample sets include recommendation sample sets 1-3. Object feature 1 and recommendation feature set 1 in recommendation sample set 1 can be understood as a positive sample recommendation set associated with recommendation sample 1. Object feature 1 in recommendation sample set 1 and recommendation feature set 2 in recommendation sample set 2 constitute a negative sample recommendation set associated with recommendation sample 1. Object feature 1 in recommendation sample set 1 and recommendation feature set 3 in recommendation sample set 3 constitute a negative sample recommendation set associated with recommendation sample 1.

[0144] In some embodiments, the method for obtaining the fourth feature similarity corresponding to the N-1 negative sample recommendation sets associated with the recommendation sample set can be the same as the method for obtaining the first feature similarity corresponding to the recommendation sample set. For example, it can be as follows: the object features in the negative sample recommendation set are input into the first sub-model, the feature processing layer in the first sub-model processes the object features in the negative sample recommendation set to obtain the embedding vector corresponding to the object features in the negative sample recommendation set, and the feature generation layer in the first sub-model processes the embedding vector corresponding to the object features in the negative sample recommendation set to obtain the first vector corresponding to the object features in the negative sample recommendation set; the recommendation feature set in the negative sample recommendation set is input into the first neural network in the second sub-model, the feature processing layer in the first neural network processes the recommendation feature set in the negative sample recommendation set to obtain the embedding vector corresponding to the recommendation feature set in the negative sample recommendation set, and the feature generation layer in the first neural network processes the embedding vector corresponding to the recommendation feature set in the negative sample recommendation set to obtain the second vector corresponding to the recommendation feature set in the negative sample recommendation set; the fourth feature similarity between the object features in the negative sample recommendation set and its recommendation feature set is determined based on the first vector corresponding to the object features in the negative sample recommendation set and the second vector corresponding to the recommendation feature set in the negative sample recommendation set.

[0145] In some embodiments, the first loss value Loss for the initial model of the i-th recommendation sample set is determined based on the first feature similarity corresponding to the i-th recommendation sample set and the N-1 fourth feature similarities. 1.i It could be:

[0146]

[0147] Wherein, s(k i ,k i ') represents the similarity of the second feature corresponding to the i-th recommendation sample set; z i z represents the object features in the i-th recommendation sample set; i ' represents the recommendation feature set in the i-th recommendation sample set; s(k i ,k' j ) represents the feature similarity corresponding to the j-th sample set among N sample sets (including the i-th recommendation sample set and the N-1 negative sample recommendation sets associated with the i-th recommendation sample set); k j k' represents the object features in the j-th sample set; j Let represent the recommended feature set in the j-th sample set; σ represents the hyperparameters set.

[0148] S305. Determine the second loss value for the initial model for each recommendation sample set based on the second feature similarity and the corresponding third feature similarity. The specific implementation of step S305 can be found in the relevant description of the above embodiments, and will not be repeated here.

[0149] S306. Train the initial model using the first loss value and the second loss value to obtain the target model.

[0150] In some embodiments, N target loss values ​​for the initial model can be determined based on the first loss value of each recommended sample set for the initial model, and N target loss values ​​for the initial model can be determined based on the second loss value of each recommended sample set for the initial model. The initial model is then trained using the first and second target loss values. For example, N training loss values ​​for the initial model can be determined based on the first and second target loss values, and the initial model can be trained using these training loss values ​​to obtain the target model. The specific method for determining the training loss values ​​can be found in the relevant descriptions of the above embodiments.

[0151] In some embodiments, training the initial model using the first loss value and the second loss value can also involve determining a training loss value for each recommendation sample set based on the first and second loss values ​​for the initial model, and then training the initial model using the training loss value for each recommendation sample set. The initial model is trained once per recommendation sample set.

[0152] Wherein, the first loss value Loss of the initial model is based on the i-th recommendation sample set. 1.i Second loss value Loss 2.i The training loss value for the initial model for the i-th recommendation sample set can be determined as follows:

[0153] Loss i =Loss 1.i +βLoss 2.i

[0154] Here, β represents the hyperparameter. It can be understood that positive and negative samples can be constructed for each of the N recommendation sample sets, and the training loss value for each recommendation sample set can be determined based on the prediction results of these positive and negative samples, thus enabling multiple rounds of training of the initial model.

[0155] For example, such as Figure 4 As shown, Figure 4This is a schematic diagram of a scenario for training an initial model according to an embodiment of this application; wherein, the initial model includes a first sub-model and a second sub-model, the first sub-model includes a feature processing layer and a feature generation layer, and the second sub-model includes a first neural network, a second neural network, and a third neural network, all of which include a feature processing layer and a feature generation layer, and share network parameters; the training process of the initial model can be as follows:

[0156] Obtain recommendation sample sets 1-3. Based on the object features and recommendation feature sets in each recommendation sample set, construct negative sample recommendation sets 1-2 associated with each recommendation sample set. Based on the first recommendation subset and the second recommendation subset corresponding to each recommendation sample set, construct positive sample feature sets and negative sample feature sets 1-2 associated with each recommendation sample set.

[0157] Each recommended sample set is input into the initial model. The first sub-model of the initial model outputs the first vector corresponding to the object features in each recommended sample set. The first neural network of the initial model outputs the second vector corresponding to the recommended feature set in each recommended sample set. Thus, the first feature similarity 1-3 corresponding to recommended sample sets 1-3 can be obtained.

[0158] The negative sample recommendation sets 1-2 associated with each recommended sample set are input into the initial model. The first sub-model of the initial model outputs the first vector corresponding to the object features in each negative sample recommendation set, and the first neural network of the initial model outputs the second vector corresponding to the recommendation feature set in each negative sample recommendation set. Thus, the fourth feature similarity 1-3 corresponding to the recommended sample sets 1-3 can be obtained. The fourth feature similarity 1 corresponding to the recommended sample set 1 includes the feature similarity corresponding to the negative sample recommendation sets 1-2 associated with the recommended sample set 1.

[0159] The positive sample feature set associated with each recommended sample set is input into the initial model. The second neural network of the initial model outputs the first vector corresponding to the first recommended subset in the positive sample feature set, and the third neural network of the initial model outputs the second vector corresponding to the second recommended subset in the positive sample feature set. Thus, the second feature similarity 1-3 corresponding to recommended sample sets 1-3 can be obtained. The second feature similarity 1 corresponding to recommended sample set 1 is the feature similarity corresponding to the positive sample feature set associated with recommended sample set 1.

[0160] The negative sample feature sets 1-2 associated with each recommended sample set are input into the initial model. The second neural network of the initial model outputs the first vector corresponding to the first recommended subset in each negative sample feature set, and the third neural network of the initial model outputs the second vector corresponding to the second recommended subset in each negative sample feature set. Thus, the third feature similarity 1-3 corresponding to the recommended sample sets 1-3 can be obtained. The third feature similarity 1 corresponding to the recommended sample set 1 includes the feature similarity corresponding to the negative sample feature sets 1-2 associated with the recommended sample set 1.

[0161] Based on the first and fourth feature similarities of each of the recommended sample sets 1-3, the first loss value for each set is determined, thus yielding the first target loss value for each set. Similarly, based on the second and third feature similarities of each set, the second loss value for each set is determined, thus yielding the second target loss value. The training loss value is then determined based on the first and second target loss values ​​to train the initial model, resulting in the target model. In subsequent online applications, only the first sub-model and the first neural network within the target model are used.

[0162] Based on the above description, feature segmentation (i.e., dividing the recommended feature sets of the recommended samples into a first feature subset and a second feature subset) can enhance feature learning, and a loss function based on the idea of ​​contrastive learning can be constructed to train the target model for recommendation. This can promote the target model to learn well from the recommended samples, that is, to learn more information about the recommended samples.

[0163] Furthermore, recommendation data with low exposure, also known as long-tail data, is difficult for online users to use for recommendation behavior. Consequently, long-tail data is unlikely to appear in the constructed recommendation sample set. During initial model training, this long-tail data is typically not learned, resulting in poor model generalization ability and biases in recommendation data loops and personalized recommendations. This application addresses this issue by learning information from this long-tail data through contrastive learning. Furthermore, by dividing the recommendation feature set based on the feature correlation between any two recommendation features, and learning information from the positive and negative sample feature sets through contrastive learning, the feature distributions of two feature subsets within the same recommendation feature set can be more similar in the vector space.

[0164] It's understandable that for the recommendation feature set of non-long-tail data, there is usually overlapping feature information with the recommendation feature set of long-tail data. Learning this overlapping feature information can indirectly learn about the long-tail data. Since the feature distributions of two feature subsets within the same recommendation feature set are more similar in the vector space, the more overlapping feature information there is, the closer the feature distribution of the long-tail data in the vector space will be to the feature distribution of the non-long-tail data. Therefore, improving the prediction accuracy of recommendation scores for non-long-tail data can also improve the prediction accuracy for long-tail data. Thus, through these two comparative learning processes, the initial model can learn well from the long-tail data, indirectly learning more information about it, thereby improving the generalization ability of the target model. In other words, it can make the prediction of the feature similarity between an object's features and the recommendation sample set of long-tail data more accurate.

[0165] S307. Obtain the target object features of the target object and the target feature set of the recommendation data, determine the target feature similarity between the target object features and the target feature set based on the target model, and determine the recommendation degree of the target object for the recommendation data based on the target feature similarity.

[0166] In some embodiments, target object features of the target object can be obtained and input into a target model. A first sub-model in the target model outputs a first vector corresponding to the target object features. Similarly, a target feature set of the recommendation data can be obtained and input into the target model. A first neural network in a second sub-model of the target model outputs a second vector corresponding to the target feature set. When recommendations are needed for the target object, the target feature similarity between the target object features and the target feature set can be determined based on the first vector corresponding to the target object features and the second vector corresponding to the target feature set. This target feature similarity is then used to determine the recommendation level of the target object for the recommendation data. Subsequently, recommendation data to be recommended can be determined based on this recommendation level, and the recommendation data to be recommended can be pushed to the target object's terminal.

[0167] Optionally, the object features of the target object (such as any online user) can be obtained in advance, and a first vector corresponding to the target object features of the target object can be determined based on the target model and stored. Alternatively, the object features of the online object can be updated every specified time (such as one hour), and the stored corresponding first vector can be updated accordingly.

[0168] Optionally, multiple target feature sets of recommendation data can be pre-acquired, and a second vector corresponding to the target feature set of the recommendation data can be determined based on the target model and stored. Alternatively, the target feature set of the recommendation data can be updated every specified time period, and the corresponding stored second vector can be updated accordingly.

[0169] In some embodiments, when it is necessary to recommend a target object, the recommendation degree between the target object and each piece of recommended data can be determined sequentially to determine the recommended data to be recommended. Alternatively, a nearest neighbor index of the recommended data can be pre-established, L pieces of recommended data can be selected based on the nearest neighbor index, and the recommendation degree between the target object and these L pieces of recommended data can be determined sequentially to determine the recommended data to be recommended, which can improve the efficiency of determining the recommended data to be recommended.

[0170] The establishment of the nearest neighbor index can be achieved by clustering each recommended data point based on its second vector, resulting in multiple categories. Each category contains at least one recommended data point, and each category is associated with a cluster center. Selecting L recommended data points based on the nearest neighbor index can be done by determining the target cluster center based on the distance between the first vector corresponding to the target object and each cluster center. For example, cluster centers with a distance less than a distance threshold can be identified as target cluster centers, and the recommended data points associated with these target cluster centers can be selected as the L recommended data points.

[0171] For example, such as Figure 5 As shown, Figure 5 This application provides a schematic diagram of a recommendation scenario for a target object. The initial model undergoes daily and hourly training. For example, a recommendation sample set can be built every hour, and the target model is trained using the built recommendation sample set at the end of the day to update the model parameters. The updated target model is then deployed online. In the offline phase, multiple stored recommendation data sets can be acquired, and the target feature sets of these multiple recommendation data sets can be input into the target model to obtain a second vector corresponding to each recommendation data set. A nearest neighbor index for multiple recommendation data sets is then constructed based on the second vector corresponding to each recommendation data set. Furthermore, newly stored recommendation data can be acquired and a nearest neighbor index can be built at specified intervals, and the recommendation data with already built nearest neighbor indexes can be updated to update the nearest neighbor index. Indexing; Pre-acquiring the object features of the target object and inputting them into the target model to obtain the first vector corresponding to the target object, which is then stored; Furthermore, the object features of the target object can be updated at specified intervals to update the first vector corresponding to the target object; When a recommendation request for the target object is received, such as when the target object is detected to be in a recommended scenario, or when the target object's terminal displays a recommended page, L recommended data are selected based on the first vector corresponding to the target object and the constructed nearest neighbor retrieval. The feature similarity between the target object and each recommended data is determined according to the first vector corresponding to the target object and the second vectors corresponding to the L recommended data, thereby determining the recommendation degree of the target object for each recommended data, and thus obtaining the recommended data to be recommended.

[0172] Therefore, this application embodiment employs a data processing mechanism for recommendation data. This mechanism not only trains the initial model by combining the first feature similarity of the recommendation sample set (e.g., the feature similarity between object features and recommendation feature sets), but also by combining the second feature correlation of the positive sample feature set associated with each recommendation sample set (e.g., the feature similarity between two features included in the positive sample feature set (i.e., the feature similarity between the first and second recommendation subsets corresponding to the same recommendation sample set)) and the third feature similarity of the negative sample feature set (e.g., the feature similarity between two features included in the negative sample feature set (i.e., the feature similarity between the first and second recommendation subsets corresponding to different recommendation sample sets)). This allows the initial model to learn more information based on the aforementioned multiple feature similarities during training, making the predictions of the trained target model more accurate and thus improving the recommendation effect for recommendation data.

[0173] Please see Figure 6 , Figure 6 This is a schematic diagram of a data processing apparatus provided in an embodiment of this application. It should be noted that... Figure 6 The data processing apparatus shown is used to execute this application. Figure 2 and Figure 3 The methods in the illustrated embodiments are shown only in the parts relevant to the embodiments of this application for ease of explanation; specific technical details are not disclosed. Reference to this application is required. Figure 2 and Figure 3 The illustrated embodiment. The data processing device 600 may include: an acquisition module 601, a processing module 602, and a determination module 603.

[0174] in:

[0175] The acquisition module 601 is used to acquire N recommendation sample sets; a recommendation sample set includes the object features of a sample object and a recommendation feature set of a recommendation sample, and a recommendation feature set includes feature information under multiple recommendation features; multiple recommendation features are divided into a first feature set and a second feature set based on the feature correlation between any two recommendation features; the recommendation feature set included in a recommendation sample set is divided into a first recommendation subset and a second recommendation subset based on the first feature set and the second feature set; N is a positive integer;

[0176] The processing module 602 is used to construct a set of positive sample features and a set of N-1 negative sample features associated with each recommended sample set based on the first recommended subset and the corresponding second recommended subset of each recommended sample set;

[0177] The processing module 602 is also used to input N recommended sample sets, the positive sample feature set associated with each recommended sample set and the associated N-1 negative sample feature sets into the initial model, and respectively obtain the first feature similarity corresponding to each recommended sample set, the second feature similarity corresponding to the positive sample feature set associated with each recommended sample set and the third feature similarity corresponding to the associated N-1 negative sample feature sets;

[0178] The processing module 602 is also used to train an initial model based on the first feature similarity, the second feature similarity, and the third feature similarity corresponding to each recommendation sample set, to obtain the target model;

[0179] The determination module 603 is used to obtain the target object features of the target object and the target feature set of the recommendation data, determine the target feature similarity between the target object features and the target feature set based on the target model, and determine the recommendation degree of the target object for the recommendation data based on the target feature similarity.

[0180] In some embodiments, the multiple recommendation features include a first recommendation feature, a second recommendation feature, and a third recommendation feature, wherein the feature correlation between the first recommendation feature and the second recommendation feature is greater than a correlation threshold.

[0181] The acquisition module 601 is also used for:

[0182] The first recommended feature is assigned to the first feature set, and the second recommended feature is assigned to the second feature set;

[0183] If the feature correlation between the first recommended feature and the third recommended feature is less than the feature correlation between the second recommended feature and the third recommended feature, then the third recommended feature will be assigned to the first feature set.

[0184] If the feature correlation between the first recommended feature and the third recommended feature is greater than the feature correlation between the second recommended feature and the third recommended feature, then the third recommended feature will be assigned to the second feature set.

[0185] In some embodiments, the acquisition module 601 is further configured to:

[0186] If the feature correlation between the first and third recommended features is equal to the feature correlation between the second and third recommended features, then the fourth recommended feature is obtained.

[0187] The partitioning result of the third recommended feature is determined based on the feature correlation between the first recommended feature and the fourth recommended feature, and the feature correlation between the second recommended feature and the fourth recommended feature; the partitioning result is used to indicate whether the third recommended feature is assigned to the first feature set or the second feature set.

[0188] In some embodiments, the multiple recommendation features include a first recommendation feature and a second recommendation feature, wherein the first recommendation feature includes multiple first feature information, and the second recommendation feature includes multiple second feature information; the acquisition module 601 is further configured to:

[0189] Multiple feature information pairs are constructed based on various first feature information and various second feature information; a feature information pair includes one first feature information and one second feature information.

[0190] The feature relevance of each feature information pair is determined based on the feature co-occurrence information corresponding to the first feature information and the second feature information of each feature information pair.

[0191] The feature correlation between the first recommended feature and the second recommended feature is determined based on the feature correlation of each feature information pair.

[0192] In some embodiments, the positive sample feature set associated with the i-th recommendation sample set in the N recommendation sample sets includes: the first recommendation subset and the corresponding second recommendation subset corresponding to the i-th recommendation sample set;

[0193] The negative sample feature set associated with the i-th recommendation sample set includes: the first recommendation subset corresponding to the i-th recommendation sample set and the second recommendation subset corresponding to any recommendation sample set in the N recommendation sample sets other than the i-th recommendation sample set; i is a positive integer less than or equal to N.

[0194] In some embodiments, the first feature similarity corresponding to the i-th recommendation sample set is the feature similarity between the object features included in the i-th recommendation sample set and its recommendation feature set;

[0195] The second feature similarity corresponding to the i-th recommendation sample set is the feature similarity between the first recommendation subset and its second recommendation subset, which are included in the positive sample feature set associated with the i-th recommendation sample set.

[0196] The third feature similarity corresponding to the i-th recommendation sample set is the feature similarity between the first recommendation subset and its second recommendation subset included in each of the N-1 negative sample feature sets associated with the i-th recommendation sample set.

[0197] In some embodiments, when the processing module 602 trains an initial model based on the first feature similarity, the second feature similarity, and the third feature similarity to obtain a target model, it specifically performs the following:

[0198] Based on the first feature similarity corresponding to each recommendation sample set, determine the first loss value for each recommendation sample set for the initial model;

[0199] The second loss value for the initial model is determined based on the second feature similarity and the third feature similarity corresponding to each recommendation sample set.

[0200] The initial model is trained using the first and second loss values ​​to obtain the target model.

[0201] In some embodiments, the processing module 602 is further configured to:

[0202] Based on the object features included in each recommendation sample set and its recommendation feature set, construct N-1 negative sample recommendation sets associated with each recommendation sample set; any negative sample recommendation set associated with the i-th recommendation sample set in multiple recommendation sample sets includes the object features included in the i-th recommendation sample set and the recommendation feature set included in any recommendation sample set in the N recommendation sample sets except the i-th recommendation sample set; i is a positive integer less than or equal to N;

[0203] Input the N-1 negative sample recommendation sets associated with each recommendation sample set into the initial model to obtain the fourth feature similarity corresponding to the N-1 negative sample recommendation sets associated with each recommendation sample set;

[0204] Based on the first feature similarity corresponding to each recommendation sample set, determine the first loss value for each recommendation sample set for the initial model, including:

[0205] The first loss value for the initial model is determined based on the first feature similarity and the corresponding fourth feature similarity for each recommended sample set.

[0206] The specific implementation methods of the acquisition module, processing module, and determination module can be found in the description of the above embodiments, and will not be repeated here. It should be understood that the beneficial effects obtained by using the same method will also not be repeated here.

[0207] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 7 As shown, the electronic device 700 includes at least one processor 701 and a memory 702. Optionally, the electronic device may also include a network interface. The processor 701, memory 702, and network interface can exchange data. The network interface, controlled by the processor 701, is used to send and receive messages. The memory 702 stores computer programs, including program instructions. The processor 701 executes the program instructions stored in the memory 702. The processor 701 is configured to invoke the program instructions to execute the aforementioned method.

[0208] The memory 702 may include volatile memory, such as random-access memory (RAM); the memory 702 may also include non-volatile memory, such as flash memory, solid-state drive (SSD), etc.; the memory 702 may also include a combination of the above types of memory.

[0209] Processor 701 may be a central processing unit (CPU). In one embodiment, processor 701 may also be a graphics processing unit (GPU). Processor 701 may also be a combination of CPU and GPU.

[0210] In one possible implementation, memory 702 is used to store program instructions, which processor 701 can invoke to execute the following steps:

[0211] Obtain N recommendation sample sets; each recommendation sample set includes the object features of a sample object and a recommendation feature set of a recommendation sample, and each recommendation feature set includes feature information under multiple recommendation features; multiple recommendation features are divided into a first feature set and a second feature set based on the feature relevance between any two recommendation features; the recommendation feature set included in a recommendation sample set is divided into a first recommendation subset and a second recommendation subset based on the first feature set and the second feature set; N is a positive integer;

[0212] Based on the first recommendation subset and the corresponding second recommendation subset of each recommendation sample set, construct the positive sample feature set associated with each recommendation sample set and the associated N-1 negative sample feature sets;

[0213] Input N recommendation sample sets, the positive sample feature set associated with each recommendation sample set, and the N-1 negative sample feature sets associated with each recommendation sample set into the initial model to obtain the first feature similarity corresponding to each recommendation sample set, the second feature similarity corresponding to the positive sample feature set associated with each recommendation sample set, and the third feature similarity corresponding to the N-1 negative sample feature sets associated with each recommendation sample set.

[0214] The initial model is trained based on the first feature similarity, the second feature similarity, and the third feature similarity corresponding to each recommendation sample set, and the target model is obtained.

[0215] Obtain the target object features and the target feature set of the recommendation data. Determine the target feature similarity between the target object features and the target feature set based on the target model. Then, determine the recommendation degree of the target object for the recommendation data based on the target feature similarity.

[0216] In some embodiments, the multiple recommendation features include a first recommendation feature, a second recommendation feature, and a third recommendation feature, wherein the feature correlation between the first recommendation feature and the second recommendation feature is greater than a correlation threshold.

[0217] Processor 701 is also used for:

[0218] The first recommended feature is assigned to the first feature set, and the second recommended feature is assigned to the second feature set;

[0219] If the feature correlation between the first recommended feature and the third recommended feature is less than the feature correlation between the second recommended feature and the third recommended feature, then the third recommended feature will be assigned to the first feature set.

[0220] If the feature correlation between the first recommended feature and the third recommended feature is greater than the feature correlation between the second recommended feature and the third recommended feature, then the third recommended feature will be assigned to the second feature set.

[0221] In some embodiments, the processor 701 is further configured to:

[0222] If the feature correlation between the first and third recommended features is equal to the feature correlation between the second and third recommended features, then the fourth recommended feature is obtained.

[0223] The partitioning result of the third recommended feature is determined based on the feature correlation between the first recommended feature and the fourth recommended feature, and the feature correlation between the second recommended feature and the fourth recommended feature; the partitioning result is used to indicate whether the third recommended feature is assigned to the first feature set or the second feature set.

[0224] In some embodiments, the multiple recommendation features include a first recommendation feature and a second recommendation feature, wherein the first recommendation feature includes multiple first feature information and the second recommendation feature includes multiple second feature information; the processor 701 is further configured to:

[0225] Multiple feature information pairs are constructed based on various first feature information and various second feature information; a feature information pair includes one first feature information and one second feature information.

[0226] The feature relevance of each feature information pair is determined based on the feature co-occurrence information corresponding to the first feature information and the second feature information of each feature information pair.

[0227] The feature correlation between the first recommended feature and the second recommended feature is determined based on the feature correlation of each feature information pair.

[0228] In some embodiments, the positive sample feature set associated with the i-th recommendation sample set in the N recommendation sample sets includes: the first recommendation subset and the corresponding second recommendation subset corresponding to the i-th recommendation sample set;

[0229] The negative sample feature set associated with the i-th recommendation sample set includes: the first recommendation subset corresponding to the i-th recommendation sample set and the second recommendation subset corresponding to any recommendation sample set in the N recommendation sample sets other than the i-th recommendation sample set; i is a positive integer less than or equal to N.

[0230] In some embodiments, the first feature similarity corresponding to the i-th recommendation sample set is the feature similarity between the object features included in the i-th recommendation sample set and its recommendation feature set;

[0231] The second feature similarity corresponding to the i-th recommendation sample set is the feature similarity between the first recommendation subset and its second recommendation subset, which are included in the positive sample feature set associated with the i-th recommendation sample set.

[0232] The third feature similarity corresponding to the i-th recommendation sample set is the feature similarity between the first recommendation subset and its second recommendation subset included in each of the N-1 negative sample feature sets associated with the i-th recommendation sample set.

[0233] In some embodiments, when the processor 701 trains an initial model based on a first feature similarity, a second feature similarity, and a third feature similarity to obtain a target model, it specifically performs the following:

[0234] Based on the first feature similarity corresponding to each recommendation sample set, determine the first loss value for each recommendation sample set for the initial model;

[0235] The second loss value for the initial model is determined based on the second feature similarity and the third feature similarity corresponding to each recommendation sample set.

[0236] The initial model is trained using the first and second loss values ​​to obtain the target model.

[0237] In some embodiments, the processor 701 is further configured to:

[0238] Based on the object features included in each recommendation sample set and its recommendation feature set, construct N-1 negative sample recommendation sets associated with each recommendation sample set; any negative sample recommendation set associated with the i-th recommendation sample set in multiple recommendation sample sets includes the object features included in the i-th recommendation sample set and the recommendation feature set included in any recommendation sample set in the N recommendation sample sets except the i-th recommendation sample set; i is a positive integer less than or equal to N;

[0239] Input the N-1 negative sample recommendation sets associated with each recommendation sample set into the initial model to obtain the fourth feature similarity corresponding to the N-1 negative sample recommendation sets associated with each recommendation sample set;

[0240] Based on the first feature similarity corresponding to each recommendation sample set, determine the first loss value for each recommendation sample set for the initial model, including:

[0241] The first loss value for the initial model is determined based on the first feature similarity and the corresponding fourth feature similarity for each recommended sample set.

[0242] In specific implementations, the devices, processors, memory, etc., described in the embodiments of this application can execute the implementation methods described in the above method embodiments, or they can execute the implementation methods described in the embodiments of this application, which will not be repeated here.

[0243] This application also provides a computer-readable storage medium storing a computer program. The computer program includes program instructions, which, when executed by a processor, enable the processor to perform some or all of the steps described in the above method embodiments. Optionally, the computer storage medium can be volatile or non-volatile. The computer-readable storage medium may primarily include a program storage area and a data storage area. The program storage area may store an operating system, at least one application program required for a given function, etc.; the data storage area may store data created based on the use of blockchain nodes, etc.

[0244] This application provides a computer program product, which may include a computer program. When the computer program is executed by a processor, it can implement some or all of the steps in the above method, which will not be elaborated here.

[0245] In this article, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0246] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a computer storage medium, which can be a computer-readable storage medium. When executed, the program can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0247] The above-disclosed embodiments are merely some of the embodiments of this application, and should not be construed as limiting the scope of this application. Those skilled in the art can understand that all or part of the processes for implementing the above embodiments, and equivalent changes made in accordance with the claims of this application, still fall within the scope of this application.

Claims

1. A data processing method, characterized in that, The method includes: Obtain N recommendation sample sets; each recommendation sample set includes the object features of a sample object and a recommendation feature set of a recommendation sample, and each recommendation feature set includes feature information under multiple recommendation features; the multiple recommendation features are divided into a first feature set and a second feature set based on the feature relevance between any two recommendation features; the recommendation feature set included in a recommendation sample set is divided into a first recommendation subset and a second recommendation subset based on the first feature set and the second feature set; N is a positive integer; Based on the first recommendation subset and the corresponding second recommendation subset corresponding to each recommendation sample set, construct the positive sample feature set and N-1 associated negative sample feature sets associated with each recommendation sample set; wherein, the positive sample feature set associated with the i-th recommendation sample set in the N recommendation sample sets includes: the first recommendation subset and the corresponding second recommendation subset corresponding to the i-th recommendation sample set; any negative sample feature set associated with the i-th recommendation sample set includes: the first recommendation subset corresponding to the i-th recommendation sample set and the second recommendation subset corresponding to any recommendation sample set in the N recommendation sample sets other than the i-th recommendation sample set; i is a positive integer less than or equal to N; The N recommendation sample sets, the positive sample feature sets associated with each recommendation sample set, and the N-1 associated negative sample feature sets are input into the initial model to obtain the first feature similarity corresponding to each recommendation sample set, the second feature similarity corresponding to the positive sample feature sets associated with each recommendation sample set, and the third feature similarity corresponding to the N-1 associated negative sample feature sets. Specifically, the first feature similarity corresponding to the i-th recommendation sample set is the feature similarity between the object features included in the i-th recommendation sample set and its recommendation feature sets; the second feature similarity corresponding to the i-th recommendation sample set is the feature similarity between the first recommendation subset and its second recommendation subset included in the positive sample feature sets associated with the i-th recommendation sample set; and the third feature similarity corresponding to the i-th recommendation sample set is the feature similarity between the first recommendation subset and its second recommendation subset included in each of the N-1 associated negative sample feature sets. Based on the first feature similarity corresponding to each recommendation sample set, a first loss value for each recommendation sample set for the initial model is determined. Based on the second feature similarity and the corresponding third feature similarity corresponding to each recommendation sample set, a second loss value for each recommendation sample set for the initial model is determined. The initial model is trained using the first loss value and the second loss value to obtain the target model. Obtain the target object features of the target object and the target feature set of the recommendation data; determine the target feature similarity between the target object features and the target feature set based on the target model; and determine the recommendation degree of the target object for the recommendation data based on the target feature similarity.

2. The method according to claim 1, characterized in that, The multiple recommendation features include a first recommendation feature, a second recommendation feature, and a third recommendation feature, wherein the feature correlation between the first recommendation feature and the second recommendation feature is greater than a correlation threshold; The method further includes: The first recommended feature is assigned to the first feature set, and the second recommended feature is assigned to the second feature set; If the feature correlation between the first recommended feature and the third recommended feature is less than the feature correlation between the second recommended feature and the third recommended feature, then the third recommended feature is assigned to the first feature set. If the feature correlation between the first recommended feature and the third recommended feature is greater than the feature correlation between the second recommended feature and the third recommended feature, then the third recommended feature is assigned to the second feature set.

3. The method according to claim 2, characterized in that, The method further includes: If the feature correlation between the first recommended feature and the third recommended feature is equal to the feature correlation between the second recommended feature and the third recommended feature, then the fourth recommended feature is obtained; The partitioning result of the third recommended feature is determined based on the feature relevance between the first recommended feature and the fourth recommended feature, and the feature relevance between the second recommended feature and the fourth recommended feature; the partitioning result is used to indicate whether the third recommended feature is partitioned into the first feature set or the second feature set.

4. The method according to claim 1, characterized in that, The multiple recommendation features include a first recommendation feature and a second recommendation feature. The first recommendation feature includes multiple first feature information, and the second recommendation feature includes multiple second feature information. The method further includes: Multiple feature information pairs are constructed from the various first feature information and the various second feature information; each feature information pair includes one first feature information and one second feature information. The feature relevance of each feature information pair is determined based on the feature co-occurrence information corresponding to the first feature information and the second feature information included in each feature information pair. The feature relevance between the first recommended feature and the second recommended feature is determined based on the feature relevance of each feature information pair.

5. The method according to claim 1, characterized in that, The method further includes: Based on the object features and recommendation feature sets included in each recommendation sample set, N-1 negative sample recommendation sets are constructed for each recommendation sample set; wherein, any negative sample recommendation set associated with the i-th recommendation sample set includes the object features included in the i-th recommendation sample set and the recommendation feature sets included in any recommendation sample set other than the i-th recommendation sample set in the N recommendation sample sets; Input the N-1 negative sample recommendation sets associated with each recommendation sample set into the initial model to obtain the fourth feature similarity corresponding to the N-1 negative sample recommendation sets associated with each recommendation sample set; The step of determining the first loss value for each recommended sample set for the initial model based on the first feature similarity corresponding to each recommended sample set includes: The first loss value for each recommended sample set for the initial model is determined based on the first feature similarity and the corresponding fourth feature similarity for each recommended sample set.

6. An electronic device, characterized in that, The device includes a processor and a memory, wherein the memory is used to store a computer program, the computer program including program instructions, and the processor is configured to invoke the program instructions to perform the method as described in any one of claims 1-5.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Object recommendation method and device based on artificial intelligence and electronic device

    CN113553514A

  • Target recommendation model training method, recommendation method and device, and electronic equipment

    CN113901327A