Resource recommendation method, device, electronic device, medium and product
By processing resource embedding characteristics through multi-level clustering, primary and secondary resource clusters are determined, which solves the problem of insufficient diversity in existing resource recommendations and improves the diversity and flexibility of resource recommendations.
Patent Information
- Application Number
- CN202311258388.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-26
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2043-09-26
AI Technical Summary
In existing resource recommendation methods, similarity recommendation based on recent interactive resources results in poor resource diversity and serious homogeneity.
Use a multi-level clustering processing method to obtain the resource embedding characteristics of candidate resources, perform clustering processing through the first and second cluster numbers, and determine the first- and second-level resource clusters, thereby providing diversity and flexibility for the target object. Recommended resources.
It improves the diversity and flexibility of resource recommendation, ensures that the recommended resources have different degrees of relevance to the target objects, and meets the diverse needs of users.
Smart Images

Figure CN117725276B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a resource recommendation method, device, and electronic equipment medium. Background Art
[0002] In some resource recommendation scenarios, resources with high similarity to resources that the object has recently interacted with are usually determined as recommended resources for the object based on the similarity between resource data.
[0003] The inventors have found in practice that recommending resources that are highly similar to resources that the object has recently interacted with, although this can satisfy the object's preferences to a certain extent, also leads to serious homogeneity of the recommended resources, that is, the diversity of the recommended resources is poor. Summary of the invention
[0004] The embodiments of the present application provide a resource recommendation method, device, electronic device, medium and product, which help to improve the diversity and flexibility of resource recommendation.
[0005] On the one hand, an embodiment of the present application discloses a resource recommendation method, the method comprising:
[0006] Obtain multiple resource embedding features of multiple candidate resources; one candidate resource corresponds to one resource embedding feature;
[0007] Obtain a first cluster number N, and perform clustering processing on multiple resource embedding features based on the first cluster number N to obtain N first feature clusters and N first cluster center features of the N first feature clusters; one first feature cluster corresponds to one first cluster center feature; N is a positive integer;
[0008] Obtain a second cluster number M, and perform clustering processing on the N first cluster center features based on the second cluster number M to obtain M second feature clusters; M is a positive integer less than N;
[0009] When a reference resource for determining recommended resources for a target object is obtained, a primary resource cluster and a secondary resource cluster associated with the reference resource are determined based on the N first feature clusters and the M second feature clusters, and recommended resources for the target object are determined based on the primary resource cluster and the secondary resource cluster.
[0010] On the one hand, an embodiment of the present application discloses a resource recommendation device, the device comprising:
[0011] A feature acquisition unit, used to acquire multiple resource embedding features of multiple candidate resources; one candidate resource corresponds to one resource embedding feature;
[0012] A clustering unit, used to obtain a first cluster number N, and perform clustering processing on multiple resource embedding features based on the first cluster number N to obtain N first feature clusters and N first cluster center features of the N first feature clusters; one first feature cluster corresponds to one first cluster center feature; N is a positive integer;
[0013] The clustering unit is further used to obtain a second cluster number M, and cluster the N first cluster center features based on the second cluster number M to obtain M second feature clusters; M is a positive integer less than N;
[0014] A processing unit is used to determine, when a reference resource for determining recommended resources for a target object is acquired, a primary resource cluster and a secondary resource cluster associated with the reference resource based on N first feature clusters and M second feature clusters, and determine the recommended resources for the target object based on the primary resource cluster and the secondary resource cluster.
[0015] On the one hand, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to execute the method provided in the above aspect.
[0016] On the one hand, an embodiment of the present application provides a computer-readable storage medium, in which computer program instructions are stored. When the computer program instructions are executed by a processor, they are used to execute the method provided in the above aspect.
[0017] In one aspect, an embodiment of the present application provides a computer program product or a computer program, which includes computer instructions. When the computer instructions are executed by a processor, the method provided in the above aspect can be implemented.
[0018] By adopting the embodiments of the present application, it is possible to perform multi-level clustering processing on the resource embedding features of multiple candidate resources, such as clustering the resource embedding features of multiple candidate resources to determine N first feature clusters and the first cluster center feature of each first feature cluster, and then clustering the N first cluster center features to obtain M second feature clusters, thereby determining the resources corresponding to different clustering levels (such as the first-level resource cluster and the second-level resource cluster) associated with the reference resources of the target object based on the feature clusters obtained by multi-level clustering (such as the determined N first feature clusters and M second feature clusters), and then determining the recommended resources of the target object based on the resources corresponding to different clustering levels. The resources corresponding to different levels may have different degrees of correlation with the reference resources of the target object, thereby determining recommended resources with different degrees of correlation with the reference resources for the target object, which helps to improve the diversity and flexibility of resource recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 It is a structural diagram of a resource recommendation system provided in an embodiment of the present application;
[0021] Figure 2 It is a flowchart of a resource recommendation method provided in an embodiment of the present application;
[0022] Figure 3 It is a structural schematic diagram of a target feature extraction model provided in an embodiment of the present application;
[0023] Figure 4 This is a schematic diagram of the effect of a multi-level clustering process provided in an embodiment of the present application;
[0024] Figure 5 It is a flowchart of a resource recommendation method provided in an embodiment of the present application;
[0025] Figure 6 is a schematic diagram of a process for generating a positive sample data pair provided in an embodiment of the present application;
[0026] Figure 7 is a schematic diagram of a training process of a feature extraction model provided in an embodiment of the present application;
[0027] Figure 8 It is a flowchart of a resource recommendation method provided in an embodiment of the present application;
[0028] Fig. 9 This is a schematic diagram of the effect of a clustering tree structure provided in an embodiment of the present application;
[0029] Fig.10 is a schematic diagram of a resource cluster determination method provided in an embodiment of the present application;
[0030] Fig.11 is a structural diagram of a resource recommendation device provided in an embodiment of the present application;
[0031] Fig.12 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0033] An embodiment of the present application provides a resource recommendation scheme, which is capable of performing multi-level clustering processing on the resource embedding features of multiple candidate resources, such as clustering the resource embedding features of multiple candidate resources to determine N first feature clusters and the first cluster center feature of each first feature cluster, and then clustering the N first cluster center features to obtain M second feature clusters, thereby determining the resources corresponding to different clustering levels (such as the first-level resource cluster and the second-level resource cluster) associated with the reference resources of the target object based on the feature clusters obtained by multi-level clustering (such as the determined N first feature clusters and M second feature clusters), and then determining the recommended resources of the target object based on the resources corresponding to different clustering levels. The resources corresponding to different levels can have different degrees of correlation with the reference resources of the target object, thereby determining recommended resources with different degrees of correlation with the reference resources for the target object, which helps to improve the diversity and flexibility of resource recommendations.
[0034] In a possible implementation, the above resource recommendation solution can be applied to a resource recommendation system. Figure 1 , Figure 1 Schematic diagram of a resource recommendation system provided in an embodiment of the present application. Figure 1 As shown, the resource recommendation system may include a client 11 and a server 12. Among them, the client 11 can run in a terminal device, and the client 11 can be some social information software, audio and video software, community e-commerce platform, etc., which are not limited here. The server 12 is used to provide services to the client, and the content of the service is such as providing resources to the client, saving client data, etc. For example, the server 12 can determine recommended resources for the business object, and then send the recommended resources to the client corresponding to the business object, so that the business object can interact with the recommended resources, such as viewing the recommended resources, liking the recommended resources, collecting them, etc. The resources can be graphic resources, audio and video resources, audio resources, products, etc., which are not limited here. The server 12 can be used to execute the above-mentioned resource recommendation scheme, that is, it can perform multi-level clustering processing on the resource embedding features of multiple candidate resources, and then determine the resources corresponding to different clustering levels associated with the reference resources of the target object based on the feature clusters obtained by the multi-level clustering, and then determine the recommended resources of the target object based on the resources corresponding to different clustering levels, thereby determining recommended resources with different degrees of relevance to the reference resources for the target object, thereby improving the diversity and flexibility of resource recommendations while taking into account the relevance of the determined recommended resources and the reference resources.
[0035] It is understandable that data can be exchanged between the client 11 and the server 12. For example, when a business object opens a page in the client 11 that needs to obtain recommended resources, the client 11 can send a resource recommendation request to the server 12. After receiving the resource recommendation request, the server determines the recommended resources for the business object based on the above resource recommendation scheme, and then sends the resource data of the determined recommended resources (such as the image, title, details, etc. of the resource) to the client 11, so that the client 11 can display the recommended resources, and then the business object can interact with the recommended resources in the client 11. For ease of understanding, the embodiment of the present application may refer to any business object that needs resource recommendation as a target object.
[0036] It should be noted that all object data collected by this application (such as resources on which the target object performs interactive behaviors) are collected with the consent and authorization of the object (such as an individual, enterprise, institution, etc.), and the collection, use and processing of the relevant object data must comply with the relevant laws, regulations and standards of the relevant region. For example, before collecting the relevant data of the object and during the process of collecting the relevant data of the object, this application can display a prompt message to prompt the object that its relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining the relevant data of the object after obtaining the confirmation operation issued by the object for the prompt message, otherwise (that is, the confirmation operation issued by the object for the prompt message is not obtained), the relevant steps of obtaining the relevant data of the object are terminated, that is, the relevant data of the object is not obtained.
[0037] The technical solution of the present application can be used in electronic devices, such as the above-mentioned server 12. Optionally, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The electronic device can also be a terminal, or it can be other devices for data processing, and the terminal includes but is not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, smart speakers, smart home appliances, etc.
[0038] It is understood that the above scenarios are only examples and do not constitute a limitation on the application scenarios of the technical solutions provided in the embodiments of the present application. The technical solutions of the present application can also be applied to other scenarios. For example, it is known to those skilled in the art that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0039] Based on the above description, the present application embodiment proposes a resource recommendation method. Figure 2 , Figure 2 1 is a flow chart of a resource recommendation method provided in an embodiment of the present application. The method can be executed by the above-mentioned electronic device. The resource recommendation method can include the following steps.
[0040] S201. Acquire multiple resource embedding features of multiple candidate resources; one candidate resource corresponds to one resource embedding feature.
[0041] Among them, the candidate resource can be a candidate resource for resource recommendation. The multiple candidate resources can be the full resources corresponding to the client, or partial resources determined from the full resources corresponding to the client. For example, the candidate resource can be a resource whose resource release time is within a certain time range (such as within the first 10 days of obtaining the multiple candidate resources); for example, the candidate resource can be a resource with object interaction behavior (such as business objects liking, commenting, viewing, etc.) within a certain time range, and so on, which is not limited here.
[0042] Among them, the resource embedding feature can be an embedding feature obtained by extracting features from the resource data of the candidate resource. The resource embedding feature can be expressed as a feature vector or a feature matrix, which is not limited here. The resource data of the candidate resource can be the image data and text data of the candidate resource. The image data of the candidate resource can be the cover image of the candidate resource, the image in the resource, etc., and the text data of the candidate resource can be the title, introduction, specific text content, etc. of the candidate resource, which is not limited here. For example, when the candidate resource is a video resource, the image data of the candidate resource can be the cover image of the video resource, the key frame in the video, and the text data of the candidate resource can be the title, introduction, and other text data of the video resource. For another example, when the candidate resource is a graphic resource, the image data of the candidate resource can be the image or cover image in the graphic resource, and the text data of the candidate resource can be the title, introduction, specific content, and other text data of the graphic resource; for another example, when the candidate resource is an audio resource, the image data of the candidate resource can be the cover image of the audio resource, and the text data of the candidate resource can be the text content obtained by converting speech to text of the audio resource, etc. For another example, when the candidate resource is a commodity, the image data of the candidate resource may be a cover image, a detail image, etc. of the commodity, and the text data of the candidate resource may be a text introduction to the commodity, etc.
[0043] It is understandable that obtaining the resource embedding features of any candidate resource may include: calling a pre-trained target feature extraction model to extract features from the resource data of the candidate resource to obtain the resource embedding features of the candidate resource. The target feature extraction model may be a model for determining resource embedding features. The target feature extraction model may be a model for extracting image features from the image data of the resource, or a model for extracting text features from the text data of the resource, or a multimodal model for extracting image features from the image data of the resource and extracting text features from the text data of the resource, which is not limited here.
[0044] Optionally, when the target feature model is a multimodal model that performs image feature extraction on the image data of the resource and text feature extraction on the text data of the candidate resource, obtaining multiple resource embedding features of multiple candidate resources may include: obtaining the text data and image data of each candidate resource, calling the target feature extraction model to perform feature extraction on the text data and image data of each candidate resource, and obtaining the resource embedding features of each candidate resource.
[0045] The target feature model may include an image encoder for extracting image features from image data to obtain image features, a text encoder for extracting text features from text data to obtain text features, and a fusion network for fusing image features and text features to obtain resource embedding features. The image features may be features obtained by extracting image features from image data, and the image encoder may be an encoding network for extracting image features from image data in the target feature model, for example, the image encoder may be a VIT model (a neural network model); the text features may be features obtained by extracting text features from text data, and the text encoder may be an encoding network for extracting text features from text data in the target feature model, for example, the text encoder may be a bert model (a neural network model). The fusion network may be a network for fusing image features and text features, for example, the fusion network may be a Transformer (a neural network model).
[0046] For example, see Figure 3 , Figure 3 Schematic diagram of a target feature extraction model provided in an embodiment of the present application. Figure 3As shown, the target feature extraction model 300a may include a text encoder 301 and an image encoder 302, and a fusion network 303. Based on this, when the image data and text data of the candidate resource are obtained, the text feature extraction is performed on the text data based on the text encoder 301 to obtain the text feature, and the image feature extraction is performed on the image data based on the image encoder 302 to obtain the image feature, and then the image feature and the text feature are input into the fusion network 303 to obtain the resource embedding feature of the candidate resource.
[0047] S202, obtaining a first cluster number N, and clustering multiple resource embedding features based on the first cluster number N to obtain N first feature clusters and N first cluster center features of the N first feature clusters; one first feature cluster corresponds to one first cluster center feature; N is a positive integer.
[0048] The first number of clusters may be the number of cluster centers for clustering multiple resource embedding features. It is understandable that the value of the first number of clusters N is less than the number of candidate resources obtained, and the first number of clusters N may be determined according to actual business needs, for example, the first number of clusters may be 10W.
[0049] The first feature cluster may be a feature cluster obtained by clustering multiple resource embedding features. The first cluster center feature may be a cluster center feature associated with the first feature cluster. A first cluster center feature may be the centroid of the resource embedding features in a feature cluster, that is, the mean of the resource embedding features in a feature cluster.
[0050] It is understandable that clustering of multiple resource embedding features based on the first clustering number N can be performed using the k-means algorithm, which is not limited here. Specifically, clustering of multiple resource embedding features based on the first clustering number N to obtain N first feature clusters can include: randomly selecting N resource embedding features as initial cluster center features, calculating the center distance between each resource embedding feature and the initial cluster center feature, and determining an initial feature cluster for resource embedding features of the same initial cluster center based on the associated minimum center distance; updating the initial cluster center feature based on the resource embedding features in each initial feature cluster; when the iteration termination condition is reached, determining the updated initial cluster center feature as the first cluster center feature, obtaining N first cluster center features, and using the feature clusters corresponding to the N first cluster center features as N first feature clusters.
[0051] It can be understood that the initial cluster center feature can be the cluster center feature when the iteration termination condition is not met. The initial feature cluster can be the feature cluster generated when the iteration termination condition is not met. Based on the resource embedding feature in each initial feature cluster, the initial cluster center feature is updated, and the initial cluster center feature can be updated by the mean of the resource embedding feature in each initial feature cluster, and the updated initial cluster center feature is the mean of the resource embedding feature in the initial feature cluster. Optionally, the center distance can be the distance between the resource embedding feature and the initial cluster center feature, for example, the center distance can be the Euclidean distance between the resource embedding feature and the initial cluster center feature. It can be understood that in the process of clustering processing, the initial cluster center feature can be updated multiple times until the iteration termination condition is reached. The iteration termination condition can be a condition for completing the clustering process, for example, the iteration termination condition can be that the number of iterations reaches the iteration number threshold, or that the distance between the updated initial cluster center feature and the initial cluster center feature before the update is less than or equal to the preset distance, etc., which is not limited here. Among them, the number of iterations can be based on the number of times the initial cluster center feature is updated.
[0052] It is understandable that during the clustering process, the initial cluster center features can be updated multiple times. For example, the iterative termination condition of the clustering process is that the iteration reaches 10 times. First, N initial cluster center features can be selected from multiple resource embedding features: a1, a2, ..., an, and then the center distance between each resource embedding feature and the initial cluster center feature: a1, a2, ..., an is determined, and an initial feature cluster is determined for the resource embedding features of the same initial cluster center based on the associated minimum center distance, and the initial feature clusters are obtained: W1, W2, ..., Wn, and then based on the resource embedding features in each initial feature cluster, the initial cluster center features are updated to obtain the updated initial cluster center features: b1, b2, ..., bn, the number of iterations is 1 at this time (i.e., it does not reach 10 times); further, the center distance between each resource embedding feature and the updated initial clustering feature is determined, and based on the new center distance, a new initial feature cluster is obtained: E1, E2, ..., En, and then based on the resource embedding features in each new initial feature cluster, the initial clustering center feature is updated again to obtain the updated initial clustering center feature: c1, c2, ..., cn, the number of iterations is 2 at this time (i.e., it does not reach 10 times), and so on, until the iteration termination condition is reached, and N first feature clusters and N first clustering center features associated with the N first feature clusters are determined.
[0053] S203, obtaining a second cluster number M, and performing clustering processing on the N first cluster center features based on the second cluster number M to obtain M second feature clusters; M is a positive integer less than N.
[0054] The second number of clusters may be the number of cluster centers for clustering the N first cluster center features. It is understandable that the value of the second number of clusters M is smaller than the first number of clusters N, and the second number of clusters M may be determined according to actual business needs, for example, the first number of clusters may be 10W, and the second number of clusters may be 1W.
[0055] The second feature cluster may be a feature cluster obtained by clustering N first cluster center features. It is understandable that when M second feature clusters are obtained by clustering N first cluster center features based on the second cluster number M, M second cluster center features associated with the M second feature clusters may also be obtained. The second cluster center feature may be a cluster center feature associated with the second feature cluster. A second cluster center feature may be a feature obtained by calculating the mean of the first cluster center features in a second feature cluster.
[0056] It is understandable that the k-means algorithm can be used to cluster the N first cluster center features based on the second cluster number M. For details, please refer to the above description of clustering multiple resource embedding features based on the first cluster number N, which will not be repeated here.
[0057] It is understandable that more levels of clustering can be performed in the embodiments of the present application. For example, a third level of clustering processing can also be performed, and the embodiments of the present application can also include: obtaining M second cluster center features associated with M second feature clusters, clustering the M second cluster center features based on the third cluster number Q, and obtaining Q third feature clusters; Q is a positive integer less than M. It is understandable that the second cluster center feature can be a cluster center feature associated with the second feature cluster. The third cluster number can be the number of cluster centers for clustering the M second cluster center features. The third cluster number Q is less than the second cluster number M, which can be determined based on actual business needs and is not limited here. It is understandable that more levels of clustering can be further performed on the basis of the third cluster layer clustering processing, which can be determined based on actual business needs and is not limited here. For example, during the first-level clustering, multiple resource embedding features can be clustered to obtain 10W first feature clusters and 10W first cluster center features, and then the second-level clustering is performed based on the 10W first cluster center features to obtain 1W second feature clusters and 1W second cluster center features, and then the third-level clustering is performed based on the 1W second cluster center features to obtain 1000 third feature clusters and 1000 third cluster center features, and so on, the fourth-level clustering is performed based on the 1000 third cluster center features to obtain 100 fourth feature clusters and 100 fourth cluster center features, thereby obtaining multiple levels of clustering results.
[0058] For example, see Figure 4 , Figure 4 Schematic diagram of the effect of multi-level clustering processing provided by the embodiment of the present application. Figure 4 As shown, first, resource embedding features of multiple candidate resources can be obtained, for example, Figure 4 The resource embedding features 401 in the example are then clustered (step S41) to obtain a plurality of first feature clusters and a first cluster center feature of each first feature cluster, such as Figure 4 The resource embedding features in each dotted ellipse in compose a first feature cluster, and the triangle box therein represents the first cluster center feature of a second feature cluster, for example, Figure 4 The first feature cluster 402 in the example, and the first cluster center feature 403 of the first feature cluster 402. Then, the plurality of first cluster center features can be clustered (step S42) to obtain a plurality of second feature clusters, such as Figure 4 The first cluster center features in the solid ellipse in compose a second feature cluster, e.g. Figure 4 The second feature cluster 404 in .
[0059] S204: When a reference resource for determining recommended resources for a target object is obtained, a primary resource cluster and a secondary resource cluster associated with the reference resource are determined based on the N first feature clusters and the M second feature clusters, and recommended resources for the target object are determined based on the primary resource cluster and the secondary resource cluster.
[0060] The reference resource may be a resource used to determine a recommended resource for a target object, also known as a seed resource. The recommended resource is a resource recommended to the target object. The target object may be any business object that requires resource recommendation.
[0061] It is understandable that the clustering results (such as multiple first feature clusters and multiple second feature clusters) obtained by performing multi-level clustering based on the above description can be used in the process of determining recommended resources multiple times, that is, it is not necessary to perform multi-level clustering processing every time before obtaining the reference resources of the target object to determine the recommended resources of the target object. Optionally, when a certain clustering condition is reached, the steps of performing multi-level clustering processing on the resource embedding features of multiple candidate resources based on obtaining multiple candidate resources and multiple candidate resources (i.e., the above steps S201-S204) can be re-executed. When the recommended resources need to be determined later, the recommended resources of the target object can be determined based on the latest multi-level clustering results. The clustering condition can be a time node for indicating re-clustering processing, such as performing multi-level clustering processing every 10 days. When the time from the last multi-level clustering reaches 10 days, the steps of performing multi-level clustering processing on the resource embedding features of multiple candidate resources based on obtaining multiple candidate resources and multiple candidate resources are re-executed. The clustering condition may also be other conditions, for example, the clustering condition may be that the number of resources released after the determined multiple candidate resources reaches a certain resource release number threshold, etc., which is not limited here.
[0062] It is understandable that the reference resource may be a resource on which the target object has performed a positive interactive behavior within a reference time range. The reference time range may be a time range for determining the reference resource, for example, the reference time range may be a time period (such as one day) before the time when the reference resource is determined. The positive interactive behavior may be an interactive behavior used to indicate that the target object is interested in the resource, such as the positive interactive behavior may be an act of liking a resource, an act of collecting a resource, an act of commenting on a resource, an act of forwarding a resource, and the like, which is not limited here. In some scenarios, an embodiment of the present application may determine a reference resource associated with a target object based on the object information of the target object when receiving a recommendation request sent by a client corresponding to the target object.
[0063] The primary resource cluster may be a set of candidate resources associated with the same first feature cluster as the reference resource. The first feature cluster associated with a resource may be the first feature cluster to which the resource embedding feature of the resource belongs.
[0064] The secondary resource cluster may be a set of candidate resources other than the secondary resource cluster among the candidate resources associated with the same second feature cluster as the reference resource. The second feature cluster associated with a resource may be the second feature cluster to which the first cluster center feature corresponding to the first feature cluster to which the resource embedding feature of the resource belongs belongs.
[0065] It is understandable that the above-mentioned determination of the primary resource cluster and the secondary resource cluster of the reference resource is only an example. In some scenarios, multi-level clustering can be performed, and more levels of resource clusters associated with the reference resource can be determined. For example, in the implementation of this application, the M second cluster center features can also be clustered to obtain Q third feature clusters, and then the primary resource cluster, the secondary resource cluster, and the tertiary resource cluster associated with the reference resource can be determined based on the N first feature clusters, the M second feature clusters, and the Q third feature clusters. By analogy, when performing more levels of clustering, more levels of resource clusters associated with the reference resource are determined.
[0066] It can be understood that the recommended resources for the target object determined based on the primary resource cluster and the secondary resource cluster can be the recommended resources for the target object selected from the primary resource cluster and the secondary resource cluster respectively based on a certain hierarchical recommendation ratio. In other words, the determined recommended resources can include a part of candidate resources in the primary resource cluster and a part of candidate resources in the secondary resource cluster, and among the determined recommended resources, the number of candidate resources in the primary resource cluster and the number of candidate resources in the secondary resource cluster meet a certain hierarchical recommendation ratio.
[0067] Specifically, determining the recommended resources of the target object based on the primary resource cluster and the secondary resource cluster may include the following steps: obtaining a hierarchical recommendation ratio; the hierarchical recommendation ratio is used to indicate the ratio of the primary recommended resources to the secondary recommended resources; the primary recommended resources refer to the recommended resources determined based on the primary resource cluster, and the secondary recommended resources refer to the recommended resources determined based on the secondary resource cluster; further, based on the hierarchical recommendation ratio, K primary recommended resources are determined from the primary resource cluster, and P secondary recommended resources are determined from the secondary resource cluster; K and P are positive integers, and K and P satisfy the hierarchical recommendation ratio; further, the recommended resources of the target object are determined based on the K primary recommended resources and the P secondary recommended resources.
[0068] Among them, the hierarchical recommendation ratio can be the ratio of recommended resources at different levels, such as the ratio of first-level recommended resources to second-level recommended resources, that is, the ratio of the number of first-level recommended resources to the number of second-level recommended resources to be determined. The first-level recommended resources can be recommended resources determined based on the first-level resource cluster, which is equivalent to recommended resources with a first-level correlation with the reference resources. The second-level recommended resources can be recommended resources determined based on the second-level resource cluster, which is equivalent to recommended resources with a second-level correlation with the reference resources (i.e., the next level of correlation with the first level). It can be understood that the correlation between the recommended resources with a first-level correlation and the reference resources is greater than the correlation between the recommended resources with a second-level correlation and the reference resources. In other words, the correlation between the first-level recommended resources and the reference resources is greater than the correlation between the second-level recommended resources and the reference resources.
[0069] It is understandable that, based on K first-level recommended resources and P second-level recommended resources, the recommended resources of the target object can be determined by directly using the K first-level recommended resources and P second-level recommended resources as the recommended resources of the target object, or by further screening the K first-level recommended resources and P second-level recommended resources to obtain the recommended resources of the target object, which is not limited here. For example, K first-level recommended resources and P second-level recommended resources are screened to obtain the recommended resources of the target object, and the K first-level recommended resources and P second-level recommended resources can be sorted based on the popularity of the resources, and the resources ranked in the top F are determined as the recommended resources of the target object, wherein the popularity of the resource can be calculated based on the number of clicks, the number of likes, the number of comments, the number of favorites, etc. of the resource according to certain calculation rules, and the more the number of clicks, the number of likes, the number of comments, the number of favorites, etc. of the resource, the greater the popularity of the resource. The embodiment of the present application can also screen the K first-level recommended resources and P second-level recommended resources in other ways to obtain the recommended resources of the target object, such as sorting and screening based on the release time of the resource, etc., which is not limited here.
[0070] For example, if the hierarchical recommendation ratio indicates that the ratio of first-level recommended resources to second-level recommended resources is 7:3, and the number of recommended resources that need to be determined for the target object is 100, then the final number of first-level recommended resources is 70, and the number of second-level recommended resources is 30. Then, the recommended resources for the target object can be determined based on 70 first-level recommended resources and 30 second-level recommended resources.
[0071] It can be further understood that the above determination of the first-level recommended resources and the second-level recommended resources is only an example. In some scenarios, multi-level clustering can be performed, and the determined recommended resources also have more levels of recommended resources. The obtained hierarchical recommendation ratio can also include the ratio between more levels of recommended resources. For example, when clustering to obtain the third feature cluster, the obtained hierarchical recommendation ratio includes the ratio used to indicate the first-level recommended resources, the second-level recommended resources and the third-level recommended resources. The third-level recommended resources can be recommended resources determined based on the third-level resource cluster, so that multiple third-level recommended resources can also be determined from the three-level resource cluster based on the hierarchical recommendation ratio, and then the recommended resources of the target object are determined based on K first-level recommended resources, P second-level recommended resources and multiple third-level recommended resources. The specific steps can refer to the above-mentioned description of determining the recommended resources of the target object based on K first-level recommended resources and P second-level recommended resources, which will not be repeated here.
[0072] In one embodiment, the embodiment of the present application can also receive resource feedback information sent by the client for the first-level recommended resources and second-level recommended resources in the recommended resources after sending the recommended resources of the determined target object to the corresponding client; and then adjust the proportion of the first-level recommended resources and second-level recommended resources in the recommended resources of the determined target object based on the resource feedback information.
[0073] Specifically, the recommended resources of the determined target object are sent to the client corresponding to the target object; resource feedback information sent by the client for the first-level recommended resources and the second-level recommended resources in the recommended resources is received; and the proportion of the first-level recommended resources and the proportion of the second-level recommended resources indicated by the hierarchical recommendation ratio are adjusted according to the resource feedback information.
[0074] Among them, the resource feedback information can be used to indicate the feedback information reflected by the target object's interactive behavior (such as likes, comments, collections, views, etc.) on the recommended first-level recommended resources and second-level recommended resources. The resource feedback information can reflect the target object's preference for the first-level recommended resources and the second-level recommended resources. The resource feedback information can be the number of likes, stay time, number of comments, number of collections, etc. corresponding to the recommended first-level recommended resources and second-level recommended resources of the target object, respectively, and is not limited here. It can be understood that the more the target object likes, stay time, number of comments or number of collections, etc. for the recommended multiple first-level recommended resources, the higher the target object's preference for the first-level recommended resources. Similarly, the more the target object likes, stay time, number of comments or number of collections, etc. for the recommended multiple second-level recommended resources, the higher the target object's preference for the second-level recommended resources. It is understandable that if the target object prefers the primary recommended resources more than the secondary recommended resources, the proportion of the primary recommended resources indicated by the hierarchical recommendation ratio can be increased, which is equivalent to reducing the proportion of the secondary recommended resources; conversely, if the target object prefers the secondary recommended resources more than the primary recommended resources, the proportion of the secondary recommended resources indicated by the hierarchical recommendation ratio can be increased, which is equivalent to reducing the proportion of the secondary recommended resources. In this way, the proportion of the primary recommended resources and the secondary recommended resources of the determined recommended resources can be dynamically adjusted, thereby improving the flexibility and diversity of the recommended resources while meeting the needs and preferences of the objects, thereby improving the accuracy of resource recommendations.
[0075] It can be understood that the proportion of the first-level recommended resources and the proportion of the second-level recommended resources indicated by the stratified recommendation ratio are adjusted according to the resource feedback information. The first-level feedback index is determined based on the resource feedback information of the first-level recommended resources, and the second-level feedback index is determined based on the resource feedback information of the second-level recommended resources; based on the comparison result between the first-level feedback index and the second-level feedback index, the proportion of the first-level recommended resources and the proportion of the second-level recommended resources indicated by the stratified recommendation ratio are adjusted.
[0076] Among them, the first-level feedback index can be a value calculated based on one or more information such as the number of likes, stay time, number of comments, number of collections, etc. of the target object for the recommended multiple first-level recommended resources, and the second-level feedback index can be a value calculated based on one or more information such as the number of likes, stay time, number of comments, or number of collections of the target object for the recommended multiple second-level recommended resources. For example, the first-level feedback index can be a weighted sum of one or more information such as the number of likes, stay time, number of comments, or number of collections of the first-level recommended resources, and the result of the weighted sum is divided by the number of the recommended multiple first-level recommended resources to obtain the first-level feedback index. Similarly, the second-level feedback index can be a weighted sum of one or more information such as the number of likes, stay time, number of comments, number of collections, etc. of the second-level recommended resources, and the result of the weighted sum is divided by the number of the recommended multiple second-level recommended resources to obtain the second-level feedback index. Alternatively, the embodiment of the present application can also determine the first-level feedback index and the second-level feedback index based on other methods, which is not limited here. It can be understood that the greater the number of likes, stay time, number of comments, number of collections, etc. of the target object for the recommended multiple first-level recommended resources, the greater the first-level feedback index. Similarly, the greater the number of likes, stay time, number of comments, number of collections, etc. of the target object for the recommended multiple second-level recommended resources, the greater the second-level feedback index.
[0077] The comparison result is used to indicate the result of the comparison between the primary feedback index and the secondary feedback index. If the comparison result indicates that the primary feedback index is greater than the secondary feedback index, and the difference between the primary feedback index and the secondary feedback index is greater than the adjustment threshold, the proportion of the primary recommended resources indicated by the stratified recommendation ratio is increased; if the comparison result indicates that the secondary feedback index is greater than the primary feedback index, and the difference between the secondary feedback index and the primary feedback index is greater than the adjustment threshold, the proportion of the secondary recommended resources indicated by the stratified recommendation ratio is increased; if the comparison result indicates that the difference between the secondary feedback index and the primary feedback index is less than or equal to the adjustment threshold, the stratified recommendation ratio remains unchanged.
[0078] It is understandable that after adjusting the hierarchical recommendation ratio, the next time the recommended resources need to be determined for the target object, the recommended resources for the target object are determined based on the hierarchical recommendation ratio. The specific determination process is described above and will not be repeated here.
[0079] It is understandable that the above determination of the first-level recommended resources and the second-level recommended resources is only an example. In some scenarios, multi-level clustering can be performed. In this case, when adjusting the hierarchical recommendation ratio, the proportion of recommended resources at one or more levels in the hierarchical recommendation ratio can be adjusted. For example, when clustering to obtain the third feature cluster, the hierarchical recommendation ratio includes a ratio for indicating the first-level recommended resources, the second-level recommended resources, and the third-level recommended resources. Based on the above description, the resource feedback information of the third-level recommended resources can also be obtained, and the third-level feedback index can be determined based on the resource feedback information of the third-level recommended resources. Therefore, based on the comparison results between the first-level feedback index, the second-level feedback index, and the third-level feedback index, the proportion of the first-level recommended resources, the proportion of the second-level recommended resources, and the proportion of the third-level recommended resources indicated by the hierarchical recommendation ratio can be adjusted.
[0080] For example, if the comparison result indicates that any level of feedback index (such as the level 1 feedback index) is greater than other feedback indexes (such as the level 2 feedback index and the level 3 feedback index), and the difference between any feedback index (such as the level 1 feedback index) and other feedback indexes (such as the level 2 feedback index and the level 3 feedback index) is greater than the adjustment threshold, then the weight of the recommended resources (such as the level 1 recommended resources) of the level corresponding to any feedback index indicated by the stratified recommendation ratio is increased; similarly, if the comparison result indicates that the difference between any feedback index and other feedback indexes is less than or equal to the adjustment threshold, then the stratified recommendation ratio remains unchanged. Alternatively, the embodiments of the present application may also include other adjustment methods for the stratified recommendation ratio, which are not limited here.
[0081] By adopting the embodiments of the present application, it is possible to perform multi-level clustering processing on the resource embedding features of multiple candidate resources, such as clustering the resource embedding features of multiple candidate resources to determine N first feature clusters and the first cluster center feature of each first feature cluster, and then clustering the N first cluster center features to obtain M second feature clusters, thereby determining the resources corresponding to different clustering levels (such as the first-level resource cluster and the second-level resource cluster) associated with the reference resources of the target object based on the feature clusters obtained by multi-level clustering (such as the determined N first feature clusters and M second feature clusters), and then determining the recommended resources of the target object based on the resources corresponding to different clustering levels. The resources corresponding to different levels may have different degrees of correlation with the reference resources of the target object, thereby determining recommended resources with different degrees of correlation with the reference resources for the target object, which helps to improve the diversity and flexibility of resource recommendations.
[0082] Based on the above description, the present application embodiment proposes a resource recommendation method. Figure 5 , Figure 51 is a flow chart of a resource recommendation method provided in an embodiment of the present application. The method can be executed by the above-mentioned electronic device. The resource recommendation method can include the following steps.
[0083] S501. Acquire multiple resource embedding features of multiple candidate resources; one candidate resource corresponds to one resource embedding feature.
[0084] Optionally, as described above, the resource embedding feature may be a feature obtained by extracting features from resource data based on a pre-trained target feature extraction model. The resource data may be image data and text data of the resource, and the target feature extraction model may be a multimodal model for extracting features from image data and text data of the resource.
[0085] Specifically, obtaining multiple resource embedding features of multiple candidate resources may include: obtaining text data and image data of each candidate resource, calling the target feature extraction model to extract features from the text data and image data of each candidate resource, and obtaining resource embedding features of each candidate resource. The specific description can be found in the relevant description under the above step S201, which will not be repeated here.
[0086] It is understandable that before calling the target feature extraction model to determine the resource embedding features of the candidate resources, the initial feature extraction model needs to be trained to obtain the target feature extraction model.
[0087] Specifically, the embodiment of the present application may also include: obtaining a sample data set, the sample data set includes a positive sample data pair and a negative sample data pair, the positive sample data pair includes resource data of two sample resources that are correlated with each other, and the negative sample data pair includes resource data of two sample resources that are uncorrelated with each other; the two sample resources in the positive sample data pair are any two resources in which the sample object performs interactive behaviors among multiple resources obtained by searching based on the target search keyword; the resource data of the sample resources in the positive sample data pair and the negative sample data pair include text data and image data; further, calling the initial feature extraction model to extract the resource data of the two sample resources in the positive sample data pair Perform feature extraction to obtain a positive sample feature pair, call the initial feature extraction model to perform feature extraction on the resource data of the two sample resources in the negative sample data pair, and obtain a negative sample feature pair; the positive sample feature pair includes two sample embedding features corresponding to the two sample resources in the positive sample data pair; the negative sample feature pair includes two sample embedding features corresponding to the two sample resources in the negative sample data pair; further, based on the feature difference between the two sample embedding features in the positive sample feature pair and the feature difference between the two sample embedding features in the negative sample feature pair, train the initial feature extraction model, and determine the target feature extraction model based on the trained initial feature extraction model.
[0088] Among them, it can be understood that the positive sample data pair can be a sample data pair constructed by two sample resources that are correlated with each other. The negative sample data pair can be a sample data pair constructed by two sample resources that are uncorrelated with each other. It can be understood that two sample resources that are correlated with each other can indicate that the two sample resources are associated with each other to a certain extent. Two sample resources that are uncorrelated with each other can indicate that the two sample resources are not associated with each other to a certain extent. It can be understood that the correlation or uncorrelation of two sample resources is only a form of annotation used for training feature extraction models, and does not mean that they are actually necessarily related or unrelated.
[0089] It can be understood that the target search keyword can be the target search keyword used when determining the sample data pair. It can be understood that the multiple resources obtained by searching based on the same search keyword are obviously resources associated with the target search keyword determined by the search engine. Further, any two resources on which the sample object performs interactive behaviors can be resources associated with the target search keyword recognized by the target object, and then it can be determined that any two resources on which the sample object performs interactive behaviors among the multiple resources obtained by searching based on the target search keyword are two resources with a mutual correlation, and then the entire sample data pair is constructed based on the arbitrary two resources. It can be understood that the negative sample data pair can be a sample data pair consisting of resource data excluding other resources that have constituted the positive sample data. The sample object can be an object used to provide resource search data when determining the sample data pair. It can be understood that the resources on which the sample object performs interactive behaviors are acquired with the consent and authorization of the object.
[0090] For example, see Figure 6 , Figure 6 is a schematic diagram of a process for generating a positive sample data pair provided in an embodiment of the present application. Figure 6 As shown, the sample object searches for multiple resources based on the target search keyword 601. For example, the multiple resources shown in 602 include: resource a, resource b, resource c, resource d, resource e. The target object clicks on some of the resources, such as Figure 6For resources a, b, and d shown in 603, a positive sample data pair can be constructed based on the resources of multiple object clicks. For example, a positive sample data pair can be constructed based on the resource data of resources a and b, or a positive sample data pair can be constructed based on the resource data of resources a and d, or a positive sample data pair can be constructed based on the resource data of resources b and d, and there is no limitation here. Moreover, a negative sample data pair can be constructed based on the resource data of resources a and f, or a negative sample data pair can be constructed based on the resource data of resources b and g, and so on, to obtain multiple negative sample data pairs, thereby constructing a sample data set based on positive sample data pairs and negative sample data pairs.
[0091] It is understandable that the initial feature extraction model can be a feature extraction model that has not been trained. The model structure of the initial feature extraction model is consistent with the model structure of the target feature extraction model mentioned above, that is, the initial feature extraction model can include an image encoder for performing image feature extraction on image data to obtain image features, a text encoder for performing text feature extraction on text data to obtain text features, and a fusion network for performing feature fusion on image features and text features to obtain resource embedding features.
[0092] Among them, the positive sample feature pair is a feature pair composed of sample embedding features corresponding to the two sample resources in the positive sample data pair, and the negative sample feature pair is a feature pair composed of sample embedding features corresponding to the two sample resources in the negative sample data pair. The sample embedding feature can be a feature obtained by extracting features based on the resource data of the sample resource. It can be understood that the relevant description of determining the sample embedding feature can refer to the relevant description of determining the resource embedding feature of the candidate resource above, which will not be repeated here.
[0093] It can be understood that the feature difference between the two sample embedded features can be the distance between the two sample embedded features, such as the Euclidean distance. In the process of training the initial feature extraction model, the distance between the positive sample feature pairs can be gradually reduced, and the distance between the negative sample feature pairs can be gradually increased. In other words, by training the initial feature extraction model, the embedded features of two related resources can be made closer, and the embedded features of two unrelated resources can be made farther apart.
[0094] It can be understood that the initial feature extraction model is trained based on the feature difference between the two sample embedded features in the positive sample feature pair and the feature difference between the two sample embedded features in the negative sample feature pair. The loss feature (also called loss value) can be calculated based on the feature difference between the two sample embedded features in the positive sample feature pair and the feature difference between the two sample embedded features in the negative sample feature pair. Then, the initial feature extraction model can be iteratively trained based on the loss feature. When the iterative training conditions (such as the number of iterations reaches a certain threshold, the loss feature is less than or equal to a certain threshold, etc.) are met, the trained initial feature extraction model is used to determine the target feature extraction model. Optionally, the loss feature can be calculated by using Info-nce loss (a loss function) to calculate the feature difference between the two sample embedded features in the positive sample feature pair and the feature difference between the two sample embedded features in the negative sample feature pair to obtain the loss feature. It can be understood that the target feature extraction model is a multimodal model that can extract features based on a variety of resource data (such as image data and text data), so that the trained target feature extraction model can accurately extract resource embedded features for clustering processing, thereby improving the accuracy of resource recommendation.
[0095] For example, see Figure 7 , Figure 7 Schematic diagram of a training process of a feature extraction model provided in an embodiment of the present application. Figure 7 As shown, here we take the positive sample data pair as an example, which includes the text data 702a and image data 703a of sample resource 1 (i.e., as shown in 701a), and the text data 702b and image data 703b of sample resource 2 (i.e., as shown in 701b). Then, the initial feature extraction model 704 can be used to extract features from the text data 702a and the image data 703a to obtain sample embedding feature 1 (i.e., as shown in 705a), and the initial feature extraction model 704 can be used to extract features from the text data 702b and the image data 703b to obtain sample embedding feature 2 (i.e., as shown in 705b). The model structure of the initial feature extraction model refers to the above Figure 3 The relevant description is not repeated here. The obtained sample embedding feature 1 (i.e., shown in 705a) and the sample embedding feature 2 (i.e., shown in 705b) can form a positive sample feature pair, and then the loss feature 706 can be calculated based on the feature difference between the positive sample feature pair. It can be understood that, synchronously, the feature difference between each positive sample pair and the feature difference between each negative sample pair can also be determined to calculate the loss feature, so as to adjust the parameters of the initial feature extraction model based on the loss feature, and determine the above-mentioned target feature extraction model based on the adjusted initial feature extraction model.
[0096] S502, obtaining a first cluster number N, and clustering multiple resource embedding features based on the first cluster number N to obtain N first feature clusters and N first cluster center features of the N first feature clusters; one first feature cluster corresponds to one first cluster center feature; N is a positive integer.
[0097] S503, obtaining a second cluster number M, and performing clustering processing on the N first cluster center features based on the second cluster number M to obtain M second feature clusters; M is a positive integer less than N.
[0098] Among them, steps S501-S503 can refer to the relevant description of the above steps S201-S203, and will not be repeated here.
[0099] S504. When a reference resource for determining a recommended resource for a target object is obtained, a first feature cluster identifier and a second feature cluster identifier associated with the reference resource are obtained, and the first feature cluster identifier associated with the reference resource is determined as a reference first feature cluster identifier, and the second feature cluster identifier associated with the reference resource is determined as a reference second feature cluster identifier.
[0100] It is understandable that the multiple candidate resources may include the reference resource, and each candidate resource may be associated with a corresponding first feature cluster identifier and a second feature cluster identifier. It is understandable that the first feature cluster identifier associated with a candidate resource may be an identifier of the first feature cluster to which the corresponding resource embedding feature belongs, and the second feature cluster identifier associated with a candidate resource may be an identifier of the second feature cluster to which the first cluster center feature of the first feature cluster to which the corresponding resource embedding feature belongs belongs.
[0101] It can be understood that determining the first feature cluster identifier and the second feature cluster identifier associated with each candidate resource may include: determining the first feature cluster identifier of each first feature cluster and the second feature cluster identifier of each second feature cluster; further, determining the first feature cluster identifier of the first feature cluster to which the resource embedding feature of each candidate resource belongs as the first feature cluster identifier associated with each candidate resource; further, determining the first cluster center feature of the first feature cluster to which the resource embedding feature of each candidate resource belongs as the first-level associated cluster center feature of each candidate resource, and determining the second feature cluster identifier of the second feature cluster to which the first-level associated cluster center feature of each candidate resource belongs as the second feature cluster identifier associated with each candidate resource; the first feature cluster identifier and the second feature cluster identifier associated with each candidate resource are used to determine the first-level resource cluster and the second-level resource cluster associated with the reference resource.
[0102] It is understandable that the first feature cluster identifier may be an identifier of the first feature cluster, and the second feature cluster identifier may be an identifier of the second feature cluster. The first feature cluster identifier and the second feature cluster identifier may be a string consisting of multiple characters (such as numbers, letters, etc.). It is understandable that each first feature cluster identifier and each second feature cluster identifier are different, so as to uniquely identify a feature cluster.
[0103] It can be understood that the first-level associated cluster center feature of a candidate resource can be the first cluster center feature of the first feature cluster to which the resource embedding feature of the candidate resource belongs, that is, the second feature cluster identifier of a candidate resource is the second feature cluster identifier of the candidate resource and the second feature cluster to which the associated cluster center feature belongs.
[0104] It can be understood that the reference first feature cluster identifier may be a first feature cluster identifier associated with a reference resource, and the reference second feature cluster identifier may be a second feature cluster identifier.
[0105] S505: Identify the associated first characteristic cluster as candidate resources other than the reference resource among the candidate resources identified by the reference first characteristic cluster, and determine them as primary resource clusters associated with the reference resource.
[0106] S506: Among other candidate resources except the primary resource cluster, identify the associated second characteristic cluster as a candidate resource with reference to the second characteristic cluster identifier, and determine it as a secondary resource cluster associated with the reference resource.
[0107] It can be understood that the secondary resource cluster can identify the associated second feature cluster as a candidate resource with reference to the second feature cluster identifier among other candidate resources except the primary resource cluster. It can also be described as that the secondary resource cluster can identify the associated second feature cluster as a candidate resource with reference to the second feature cluster identifier among other candidate resources except the primary resource cluster.
[0108] S507: Determine recommended resources for the target object based on the primary resource cluster and the secondary resource cluster.
[0109] Among them, step S507 can refer to the relevant description of the above-mentioned step S204, and will not be repeated here.
[0110] By adopting the embodiments of the present application, it is possible to perform multi-level clustering processing on the resource embedding features of multiple candidate resources, such as clustering the resource embedding features of multiple candidate resources to determine N first feature clusters and the first cluster center feature of each first feature cluster, and then clustering the N first cluster center features to obtain M second feature clusters, thereby determining the resources corresponding to different clustering levels (such as the first-level resource cluster and the second-level resource cluster) associated with the reference resources of the target object based on the feature clusters obtained by multi-level clustering (such as the determined N first feature clusters and M second feature clusters), and then determining the recommended resources of the target object based on the resources corresponding to different clustering levels. The resources corresponding to different levels may have different degrees of correlation with the reference resources of the target object, thereby determining recommended resources with different degrees of correlation with the reference resources for the target object, which helps to improve the diversity and flexibility of resource recommendations.
[0111] Based on the above description, the present application embodiment proposes a resource recommendation method. Figure 8 , Figure 8 1 is a flow chart of a resource recommendation method provided in an embodiment of the present application. The method can be executed by the above-mentioned electronic device. The resource recommendation method can include the following steps.
[0112] S801. Acquire multiple resource embedding features of multiple candidate resources; one candidate resource corresponds to one resource embedding feature.
[0113] S802, obtaining a first cluster number N, and performing clustering processing on multiple resource embedding features based on the first cluster number N to obtain N first feature clusters and N first cluster center features of the N first feature clusters; one first feature cluster corresponds to one first cluster center feature; N is a positive integer.
[0114] S803, obtaining a second cluster number M, and performing clustering processing on the N first cluster center features based on the second cluster number M to obtain M second feature clusters; M is a positive integer less than N.
[0115] Among them, steps S801-S803 can refer to the relevant description of the above steps S201-S203, and will not be repeated here.
[0116] S804. When reference resources for determining recommended resources for a target object are obtained, M clustering tree structures are obtained; the M clustering tree structures include a leaf node corresponding to each candidate resource, N first-level parent nodes associated with the leaf nodes corresponding to multiple candidate resources, and M second-level parent nodes associated with the N first-level parent nodes.
[0117] It is understood that the clustering tree structure can be a tree structure constructed based on the result of multi-level clustering to characterize the multi-level clustering relationship between each candidate resource. It is understood that the number of the clustering tree structure is the same as the number of the second feature clusters, both of which are M. It can be understood that the M clustering tree structures constructed based on the results of two-level clustering processing can include leaf nodes corresponding to each candidate resource, N first-level parent nodes associated with leaf nodes corresponding to multiple candidate resources, and M second-level parent nodes associated with N first-level parent nodes. If the multiple clustering tree structures constructed based on the results of more levels of clustering processing can also include parent nodes of higher levels, for example, Q clustering tree structures can be constructed based on the results of three-level clustering processing. The Q clustering tree structures can include leaf nodes corresponding to each candidate resource, N first-level parent nodes associated with leaf nodes corresponding to multiple candidate resources, M second-level parent nodes associated with N first-level parent nodes, and Q third-level parent nodes associated with M second-level parent nodes. By analogy, clustering tree structures corresponding to clustering processing structures with more levels can be obtained.
[0118] It can be understood that, among the M clustering tree structures, each clustering tree structure may include a second-level parent node, that is, a second-level parent node is equivalent to a root node of a clustering tree structure.
[0119] It can be understood that, in the M tree structures, a leaf node may correspond to a candidate resource, a first-level parent node may correspond to a first center clustering feature, and a second-level parent node may correspond to a second center clustering feature.
[0120] Specifically, obtaining M clustering tree structures may include: determining a corresponding leaf node based on each candidate resource, and determining N first-level parent nodes based on the leaf node corresponding to each candidate resource; the leaf nodes corresponding to the candidate resources whose resource embedded features belong to the same first feature cluster are associated with the same first-level parent node; one first-level parent node corresponds to one first cluster center feature; determining M second-level parent nodes based on N first-level parent nodes; the first-level parent nodes whose corresponding first cluster center features belong to the same second feature cluster are associated with the same second-level parent node; based on multiple leaf nodes, N first-level parent nodes and M second-level parent nodes, determine M clustering tree structures corresponding to multiple candidate resources.
[0121] Among them, it can be understood that, based on the leaf nodes corresponding to each candidate resource, N first-level parent nodes can be determined, and the leaf nodes corresponding to the candidate resources whose resource embedding features belong to the same first feature cluster can be associated with the same first-level parent node, thereby obtaining N first-level parent nodes. Based on the N first-level parent nodes, M second-level parent nodes can be determined, and the first-level parent nodes whose corresponding first cluster center features belong to the same second feature cluster can be associated with the same second-level parent node, thereby obtaining M second-level parent nodes.
[0122] For example, see Fig. 9 , Fig. 9 Schematic diagram of the effect of a clustering tree structure provided by an embodiment of the present application. Fig. 9 As shown, based on the above multi-layer clustering processing, M clustering tree structures can be obtained, for example, a clustering data structure with a secondary parent node 1 (i.e., 901) as a root node, a clustering data structure with a secondary parent node 2 (i.e., 902) as a root node, ..., M clustering tree structures with a secondary parent node m (i.e., 903) as a root node, etc. Here, taking the clustering data structure with the secondary parent node 1 (i.e., 901) as a root node as an example, a clustering tree structure is introduced. In the clustering tree structure, leaf nodes corresponding to multiple candidate resources are included, such as Fig. 9 The leaf nodes shown in 901 are: leaf node 1, leaf node 2, leaf node 3, leaf node 4, leaf node 5. Among them, the resource embedding features of the candidate resources corresponding to leaf node 1 and leaf node 2 belong to the first feature cluster of the first cluster center features corresponding to the first-level parent node 1 (i.e., shown in 904), then leaf node 1 and leaf node 2 are both associated with the first-level parent node 1 (i.e., shown in 904). Similarly, the first-level parent node 2 (i.e., shown in 905) also includes leaf node 3, leaf node 4 and leaf node 5. Furthermore, the first cluster center features corresponding to the first-level parent node 1 and the first-level parent node 2 belong to the second feature cluster of the second cluster center features corresponding to the second-level parent node 1, then the first-level parent node 1 and the first-level parent node 2 are both associated with the second-level parent node 1.
[0123] S805: Determine the leaf nodes corresponding to the reference resources in the M clustering tree structures as reference leaf nodes.
[0124] The reference leaf node may be a leaf node corresponding to the reference resource. It is understandable that in the M clustering tree structures, each leaf node may be associated with a resource identifier of a corresponding candidate resource, and the reference leaf node may be determined in the M clustering tree structures based on the resource identifier of the reference resource.
[0125] S806. Determine the first-level parent node associated with the reference leaf node as the reference first-level parent node, and determine the other leaf nodes under the reference first-level parent node except the reference leaf node as the first leaf nodes, and determine the first-level resource cluster based on the candidate resources corresponding to the first leaf node.
[0126] Among them, the reference first-level parent node can be a first-level parent node associated with the reference leaf node. The first leaf node can be a leaf node associated with the same reference first-level parent node as the reference leaf node, and the candidate resources corresponding to each first leaf node are also candidate resources in the first-level resource cluster. It can be understood that the first-level resource cluster is determined based on the candidate resources corresponding to the first leaf node, that is, the set of candidate resources corresponding to the first leaf node is used as the first-level resource cluster.
[0127] S807. Determine the second-level parent node associated with the reference first-level parent node as the reference second-level parent node, determine the leaf nodes under the reference second-level parent node except the reference first-level parent node as second leaf nodes, and determine the second-level resource cluster based on the candidate resources corresponding to the second leaf node.
[0128] Among them, it can be understood that the reference secondary parent node can be a secondary parent node associated with the reference primary parent node. The second leaf node can be a leaf node under other reference parent nodes except the reference primary parent node under the reference secondary parent node, and the candidate resources corresponding to each second leaf node are also candidate resources in the secondary resource cluster. It can be understood that the secondary resource cluster is determined based on the candidate resources corresponding to the second leaf node, that is, the set of candidate resources corresponding to the second leaf node is used as the secondary resource cluster.
[0129] For example, see Fig.10 , Fig.10 FIG. 1 is a schematic diagram of a resource cluster determination method provided in an embodiment of the present application. Fig.10As shown, after obtaining the reference resource, if it is determined that the leaf node corresponding to the reference resource is leaf node 1 (i.e., as shown in 1001), then leaf node 1 (i.e., 1001) can be determined as the reference leaf node, the first-level parent node (i.e., first-level parent node 1) associated with the reference leaf node can be determined as the reference first-level parent node, and the other leaf nodes under the reference first-level parent node except the reference leaf node can be determined as the first leaf node, i.e., leaf node 2 (i.e., as shown in 1002), and then the first-level resource cluster can be determined based on the candidate resources corresponding to leaf node 2 (i.e., as shown in 1004). Further, the second-level parent node associated with the reference first-level parent node (i.e., first-level parent node 1) is determined as the reference second-level parent node (i.e., second-level parent node 1), and the leaf nodes under the reference second-level parent node except the reference first-level parent node can be determined as the second leaf nodes, i.e., leaf node 3, leaf node 4, and leaf node 5 (as shown in 1003), so as to determine the second-level resource cluster based on the candidate resources corresponding to leaf nodes 3, leaf nodes 4, and leaf nodes 5, respectively (i.e., as shown in 1005).
[0130] S808: Determine recommended resources for the target object based on the primary resource cluster and the secondary resource cluster.
[0131] Among them, step S808 can refer to the relevant description of the above-mentioned step S204, and will not be repeated here.
[0132] By adopting the embodiments of the present application, it is possible to perform multi-level clustering processing on the resource embedding features of multiple candidate resources, such as clustering the resource embedding features of multiple candidate resources to determine N first feature clusters and the first cluster center feature of each first feature cluster, and then clustering the N first cluster center features to obtain M second feature clusters, thereby determining the resources corresponding to different clustering levels (such as the first-level resource cluster and the second-level resource cluster) associated with the reference resources of the target object based on the feature clusters obtained by multi-level clustering (such as the determined N first feature clusters and M second feature clusters), and then determining the recommended resources of the target object based on the resources corresponding to different clustering levels. The resources corresponding to different levels may have different degrees of correlation with the reference resources of the target object, thereby determining recommended resources with different degrees of correlation with the reference resources for the target object, which helps to improve the diversity and flexibility of resource recommendations.
[0133] See also Fig.11 , Fig.11 is a schematic diagram of the structure of a resource recommendation device provided in an embodiment of the present application. Optionally, the resource recommendation device may be provided in the above-mentioned electronic device. Fig.11 As shown, the resource recommendation device described in this embodiment may include:
[0134] The feature acquisition unit 1101 is used to acquire multiple resource embedding features of multiple candidate resources; one candidate resource corresponds to one resource embedding feature;
[0135] The clustering unit 1102 is used to obtain a first cluster number N, and perform clustering processing on multiple resource embedding features based on the first cluster number N to obtain N first feature clusters and N first cluster center features of the N first feature clusters; one first feature cluster corresponds to one first cluster center feature; N is a positive integer;
[0136] The clustering unit 1102 is further used to obtain a second cluster number M, and perform clustering processing on the N first cluster center features based on the second cluster number M to obtain M second feature clusters; M is a positive integer less than N;
[0137] Processing unit 1103 is used to determine the primary resource cluster and the secondary resource cluster associated with the reference resource based on N first feature clusters and M second feature clusters when a reference resource for determining recommended resources for a target object is acquired, and determine the recommended resources for the target object based on the primary resource cluster and the secondary resource cluster.
[0138] In one implementation, each candidate resource is associated with a corresponding first feature cluster identifier and a second feature cluster identifier; the multiple candidate resources include a reference resource; the processing unit 1103 is specifically configured to:
[0139] Acquire a first feature cluster identifier and a second feature cluster identifier associated with a reference resource, and determine the first feature cluster identifier associated with the reference resource as a reference first feature cluster identifier, and determine the second feature cluster identifier associated with the reference resource as a reference second feature cluster identifier;
[0140] Identifying the associated first characteristic cluster as candidate resources other than the reference resource among the candidate resources identified by the reference first characteristic cluster, and determining the candidate resources as the primary resource cluster associated with the reference resource;
[0141] Among other candidate resources except the primary resource cluster, the associated second characteristic cluster is identified as a candidate resource with reference to the second characteristic cluster identification, and is determined as a secondary resource cluster associated with the reference resource.
[0142] In one implementation, the processing unit 1103 is further configured to:
[0143] Determine a first feature cluster identifier for each first feature cluster and a second feature cluster identifier for each second feature cluster;
[0144] Determine the first feature cluster identifier of the first feature cluster to which the resource embedding feature of each candidate resource belongs as the first feature cluster identifier associated with each candidate resource;
[0145] The first cluster center feature of the first feature cluster to which the resource embedding feature of each candidate resource belongs is determined as the first-level associated cluster center feature of each candidate resource, and the second feature cluster identifier of the second feature cluster to which the first-level associated cluster center feature of each candidate resource belongs is determined as the second feature cluster identifier associated with each candidate resource; the first feature cluster identifier and the second feature cluster identifier associated with each candidate resource are used to determine the first-level resource cluster and the second-level resource cluster associated with the reference resource.
[0146] In one implementation, the processing unit 1103 is specifically configured to:
[0147] Get the hierarchical recommendation ratio; the hierarchical recommendation ratio is used to indicate the ratio of primary recommended resources to secondary recommended resources; primary recommended resources refer to recommended resources determined based on primary resource clusters, and secondary recommended resources refer to recommended resources determined based on secondary resource clusters;
[0148] Based on the hierarchical recommendation ratio, K first-level recommended resources are determined from the first-level resource cluster, and P second-level recommended resources are determined from the second-level resource cluster; K and P are positive integers, and K and P satisfy the hierarchical recommendation ratio;
[0149] Determine the recommended resources for the target object based on K first-level recommended resources and P second-level recommended resources.
[0150] In one implementation, the processing unit 1103 is further configured to:
[0151] Sending the recommended resources of the determined target object to the client corresponding to the target object;
[0152] Receiving resource feedback information sent by the client for the first-level recommended resources and the second-level recommended resources in the recommended resources;
[0153] The proportion of the first-level recommended resources and the proportion of the second-level recommended resources indicated by the hierarchical recommendation ratio are adjusted according to the resource feedback information.
[0154] In one implementation, the processing unit 1103 is specifically configured to:
[0155] Obtain M clustering tree structures; the M clustering tree structures include a leaf node corresponding to each candidate resource, N first-level parent nodes associated with the leaf nodes corresponding to multiple candidate resources, and M second-level parent nodes associated with the N first-level parent nodes;
[0156] Determine the leaf nodes corresponding to the reference resources in the M clustering tree structures as reference leaf nodes;
[0157] Determine the first-level parent node associated with the reference leaf node as the reference first-level parent node, determine the other leaf nodes under the reference first-level parent node except the reference leaf node as the first leaf nodes, and determine the first-level resource cluster based on the candidate resources corresponding to the first leaf node;
[0158] The second-level parent node associated with the reference first-level parent node is determined as the reference second-level parent node, and the leaf nodes under the reference second-level parent node except the reference first-level parent node are determined as second leaf nodes, and the second-level resource cluster is determined based on the candidate resources corresponding to the second leaf node.
[0159] In one implementation, the processing unit 1103 is specifically configured to:
[0160] Determine the corresponding leaf node based on each candidate resource, and determine N first-level parent nodes based on the leaf node corresponding to each candidate resource; the leaf nodes corresponding to the candidate resources whose resource embedding features belong to the same first feature cluster are associated with the same first-level parent node; one first-level parent node corresponds to one first cluster center feature;
[0161] Determine M second-level parent nodes based on N first-level parent nodes; the first-level parent nodes whose corresponding first cluster center features belong to the same second feature cluster are associated with the same second-level parent node;
[0162] Based on the multiple leaf nodes, N first-level parent nodes and M second-level parent nodes, M clustering tree structures corresponding to the multiple candidate resources are determined.
[0163] In one implementation, the processing unit 1103 is further configured to:
[0164] Acquire a sample data set, the sample data set includes a positive sample data pair and a negative sample data pair, the positive sample data pair includes resource data of two sample resources that are correlated with each other, and the negative sample data pair includes resource data of two sample resources that are uncorrelated with each other; the two sample resources in the positive sample data pair are any two resources in which the sample object performs interactive behaviors among multiple resources obtained by searching based on a target search keyword; the resource data of the sample resources in the positive sample data pair and the negative sample data pair include text data and image data;
[0165] Calling the initial feature extraction model to perform feature extraction on the resource data of the two sample resources in the positive sample data pair to obtain a positive sample feature pair, calling the initial feature extraction model to perform feature extraction on the resource data of the two sample resources in the negative sample data pair to obtain a negative sample feature pair; the positive sample feature pair includes two sample embedding features corresponding to the two sample resources in the positive sample data pair; the negative sample feature pair includes two sample embedding features corresponding to the two sample resources in the negative sample data pair;
[0166] Based on the feature difference between two sample embedded features in the positive sample feature pair and the feature difference between two sample embedded features in the negative sample feature pair, an initial feature extraction model is trained, and a target feature extraction model is determined based on the trained initial feature extraction model;
[0167] The feature acquisition unit 1101 is specifically used for:
[0168] The text data and image data of each candidate resource are obtained, and the target feature extraction model is called to perform feature extraction on the text data and image data of each candidate resource to obtain the resource embedding feature of each candidate resource.
[0169] See also Fig.12 , Fig.12 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device described in this embodiment includes: a processor 1201 and a memory 1202. Optionally, the electronic device may also include a network interface or a power supply module. The processor 1201 and the memory 1202 may exchange data.
[0170] The processor 1201 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0171] The above-mentioned network interface may include an input device and / or an output device. For example, the input device may be a control panel, a microphone, a receiver, etc., and the output device may be a display screen, a transmitter, etc., which are not listed here one by one.
[0172] The memory 1202 may include a read-only memory and a random access memory, and provide program instructions and data to the processor 1201. A portion of the memory 1202 may also include a non-volatile random access memory. When the processor 1201 calls a program instruction, it is used to execute:
[0173] Obtain multiple resource embedding features of multiple candidate resources; one candidate resource corresponds to one resource embedding feature;
[0174] Obtain a first cluster number N, and perform clustering processing on multiple resource embedding features based on the first cluster number N to obtain N first feature clusters and N first cluster center features of the N first feature clusters; one first feature cluster corresponds to one first cluster center feature; N is a positive integer;
[0175] Obtain a second cluster number M, and perform clustering processing on the N first cluster center features based on the second cluster number M to obtain M second feature clusters; M is a positive integer less than N;
[0176] When a reference resource for determining recommended resources for a target object is obtained, a primary resource cluster and a secondary resource cluster associated with the reference resource are determined based on the N first feature clusters and the M second feature clusters, and recommended resources for the target object are determined based on the primary resource cluster and the secondary resource cluster.
[0177] In one implementation, each candidate resource is associated with a corresponding first feature cluster identifier and a second feature cluster identifier; the multiple candidate resources include a reference resource; the processor 1201 is specifically configured to:
[0178] Acquire a first feature cluster identifier and a second feature cluster identifier associated with a reference resource, and determine the first feature cluster identifier associated with the reference resource as a reference first feature cluster identifier, and determine the second feature cluster identifier associated with the reference resource as a reference second feature cluster identifier;
[0179] Identifying the associated first characteristic cluster as candidate resources other than the reference resource among the candidate resources identified by the reference first characteristic cluster, and determining the candidate resources as the primary resource cluster associated with the reference resource;
[0180] Among other candidate resources except the primary resource cluster, the associated second characteristic cluster is identified as a candidate resource with reference to the second characteristic cluster identification, and is determined as a secondary resource cluster associated with the reference resource.
[0181] In one implementation, the processor 1201 is further configured to:
[0182] Determine a first feature cluster identifier for each first feature cluster and a second feature cluster identifier for each second feature cluster;
[0183] Determine the first feature cluster identifier of the first feature cluster to which the resource embedding feature of each candidate resource belongs as the first feature cluster identifier associated with each candidate resource;
[0184] The first cluster center feature of the first feature cluster to which the resource embedding feature of each candidate resource belongs is determined as the first-level associated cluster center feature of each candidate resource, and the second feature cluster identifier of the second feature cluster to which the first-level associated cluster center feature of each candidate resource belongs is determined as the second feature cluster identifier associated with each candidate resource; the first feature cluster identifier and the second feature cluster identifier associated with each candidate resource are used to determine the first-level resource cluster and the second-level resource cluster associated with the reference resource.
[0185] In one implementation, the processor 1201 is specifically configured to:
[0186] Get the hierarchical recommendation ratio; the hierarchical recommendation ratio is used to indicate the ratio of primary recommended resources to secondary recommended resources; primary recommended resources refer to recommended resources determined based on primary resource clusters, and secondary recommended resources refer to recommended resources determined based on secondary resource clusters;
[0187] Based on the hierarchical recommendation ratio, K first-level recommended resources are determined from the first-level resource cluster, and P second-level recommended resources are determined from the second-level resource cluster; K and P are positive integers, and K and P satisfy the hierarchical recommendation ratio;
[0188] Determine the recommended resources for the target object based on K first-level recommended resources and P second-level recommended resources.
[0189] In one implementation, the processor 1201 is further configured to:
[0190] Sending the recommended resources of the determined target object to the client corresponding to the target object;
[0191] Receiving resource feedback information sent by the client for the first-level recommended resources and the second-level recommended resources in the recommended resources;
[0192] The proportion of the first-level recommended resources and the proportion of the second-level recommended resources indicated by the hierarchical recommendation ratio are adjusted according to the resource feedback information.
[0193] In one implementation, the processor 1201 is specifically configured to:
[0194] Obtain M clustering tree structures; the M clustering tree structures include a leaf node corresponding to each candidate resource, N first-level parent nodes associated with the leaf nodes corresponding to multiple candidate resources, and M second-level parent nodes associated with the N first-level parent nodes;
[0195] Determine the leaf nodes corresponding to the reference resources in the M clustering tree structures as reference leaf nodes;
[0196] Determine the first-level parent node associated with the reference leaf node as the reference first-level parent node, determine the other leaf nodes under the reference first-level parent node except the reference leaf node as the first leaf nodes, and determine the first-level resource cluster based on the candidate resources corresponding to the first leaf node;
[0197] The second-level parent node associated with the reference first-level parent node is determined as the reference second-level parent node, and the leaf nodes under the reference second-level parent node except the reference first-level parent node are determined as second leaf nodes, and the second-level resource cluster is determined based on the candidate resources corresponding to the second leaf node.
[0198] In one implementation, the processor 1201 is specifically configured to:
[0199] Determine the corresponding leaf node based on each candidate resource, and determine N first-level parent nodes based on the leaf node corresponding to each candidate resource; the leaf nodes corresponding to the candidate resources whose resource embedding features belong to the same first feature cluster are associated with the same first-level parent node; one first-level parent node corresponds to one first cluster center feature;
[0200] Determine M second-level parent nodes based on N first-level parent nodes; the first-level parent nodes whose corresponding first cluster center features belong to the same second feature cluster are associated with the same second-level parent node;
[0201] Based on the multiple leaf nodes, N first-level parent nodes and M second-level parent nodes, M clustering tree structures corresponding to the multiple candidate resources are determined.
[0202] In one implementation, the processor 1201 is further configured to:
[0203] Acquire a sample data set, the sample data set includes a positive sample data pair and a negative sample data pair, the positive sample data pair includes resource data of two sample resources that are correlated with each other, and the negative sample data pair includes resource data of two sample resources that are uncorrelated with each other; the two sample resources in the positive sample data pair are any two resources in which the sample object performs interactive behaviors among multiple resources obtained by searching based on a target search keyword; the resource data of the sample resources in the positive sample data pair and the negative sample data pair include text data and image data;
[0204] Calling the initial feature extraction model to perform feature extraction on the resource data of the two sample resources in the positive sample data pair to obtain a positive sample feature pair, calling the initial feature extraction model to perform feature extraction on the resource data of the two sample resources in the negative sample data pair to obtain a negative sample feature pair; the positive sample feature pair includes two sample embedding features corresponding to the two sample resources in the positive sample data pair; the negative sample feature pair includes two sample embedding features corresponding to the two sample resources in the negative sample data pair;
[0205] Based on the feature difference between two sample embedded features in the positive sample feature pair and the feature difference between two sample embedded features in the negative sample feature pair, an initial feature extraction model is trained, and a target feature extraction model is determined based on the trained initial feature extraction model;
[0206] The processor 1201 is specifically configured to:
[0207] The text data and image data of each candidate resource are obtained, and the target feature extraction model is called to perform feature extraction on the text data and image data of each candidate resource to obtain the resource embedding feature of each candidate resource.
[0208] Optionally, when the program instructions are executed by the processor, other steps of the method in the above embodiment may also be implemented, which will not be repeated here.
[0209] The present application also provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the above method, such as executing the method executed by the above electronic device, which is not repeated here.
[0210] Optionally, the storage medium involved in the present application, such as computer-readable storage medium, may be non-volatile or volatile.
[0211] It should be noted that, for the above-mentioned various method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0212] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0213] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction, and when the computer instruction is executed by a processor, some or all of the steps in the above method can be implemented. For example, the computer instruction is stored in a computer-readable storage medium. The processor of the computer device (i.e., the above-mentioned electronic device) reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction so that the computer device executes the steps performed in the embodiments of the above-mentioned methods. For example, the computer device can be a terminal, or it can be a server.
[0214] The above is a detailed introduction to a resource recommendation method, device, electronic device, medium and product provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A resource recommendation method, characterized in that: The method comprises: Obtain multiple resource embedding features of multiple candidate resources; one candidate resource corresponds to one resource embedding feature; Obtain a first cluster number N, and perform clustering processing on the multiple resource embedding features based on the first cluster number N to obtain N first feature clusters and N first cluster center features of the N first feature clusters; one first feature cluster corresponds to one first cluster center feature; N is a positive integer; Obtain a second cluster number M, and perform clustering processing on the N first cluster center features based on the second cluster number M to obtain M second feature clusters; M is a positive integer less than N; When a reference resource for determining recommended resources for a target object is obtained, a primary resource cluster and a secondary resource cluster associated with the reference resource are determined based on the N first feature clusters and the M second feature clusters, and the recommended resources for the target object are determined based on the primary resource cluster and the secondary resource cluster; the primary resource cluster is a set of candidate resources associated with the same first feature cluster as the reference resource, a first feature cluster associated with a resource is a first feature cluster to which a resource embedding feature of the resource belongs; the secondary resource cluster is a set of candidate resources other than the primary resource cluster among the candidate resources associated with the same second feature cluster as the reference resource; a second feature cluster associated with a resource is a second feature cluster to which a first cluster center feature corresponding to a first feature cluster to which a resource embedding feature of the resource belongs; the degree of correlation between the resources in the primary resource cluster and the reference resource is greater than the degree of correlation between the resources in the secondary resource cluster and the reference resource.
2. The method according to claim 1, characterized in that: Each candidate resource is associated with a corresponding first feature cluster identifier and a second feature cluster identifier; the plurality of candidate resources include the reference resource; The determining, based on the N first feature clusters and the M second feature clusters, a primary resource cluster and a secondary resource cluster associated with the reference resource comprises: Acquire a first feature cluster identifier and a second feature cluster identifier associated with the reference resource, and determine the first feature cluster identifier associated with the reference resource as a reference first feature cluster identifier, and determine the second feature cluster identifier associated with the reference resource as a reference second feature cluster identifier; Identify the associated first characteristic cluster as candidate resources identified by the reference first characteristic cluster, and determine other candidate resources except the reference resource as the primary resource cluster associated with the reference resource; Among other candidate resources except the primary resource cluster, the associated second characteristic cluster is identified as a candidate resource identified by the reference second characteristic cluster, and is determined as a secondary resource cluster associated with the reference resource.
3. The method according to claim 1, characterized in that The method further comprises: Determine a first feature cluster identifier for each first feature cluster and a second feature cluster identifier for each second feature cluster; Determine the first feature cluster identifier of the first feature cluster to which the resource embedding feature of each candidate resource belongs as the first feature cluster identifier associated with each candidate resource; The first cluster center feature of the first feature cluster to which the resource embedded feature of each candidate resource belongs is determined as the first-level associated cluster center feature of each candidate resource, and the second feature cluster identifier of the second feature cluster to which the first-level associated cluster center feature of each candidate resource belongs is determined as the second feature cluster identifier associated with each candidate resource; the first feature cluster identifier and the second feature cluster identifier associated with each candidate resource are used to determine the first-level resource cluster and the second-level resource cluster associated with the reference resource.
4. The method according to claim 1, characterized in that: The determining the recommended resource of the target object based on the primary resource cluster and the secondary resource cluster includes: Obtaining a hierarchical recommendation ratio; the hierarchical recommendation ratio is used to indicate a ratio of primary recommended resources to secondary recommended resources; the primary recommended resources refer to recommended resources determined based on the primary resource cluster, and the secondary recommended resources refer to recommended resources determined based on the secondary resource cluster; Based on the hierarchical recommendation ratio, K first-level recommended resources are determined from the first-level resource cluster, and P second-level recommended resources are determined from the second-level resource cluster; K and P are positive integers, and K and P satisfy the hierarchical recommendation ratio; Determine the recommended resource for the target object based on the K first-level recommended resources and the P second-level recommended resources.
5. The method according to claim 4, characterized in that The method further comprises: Sending the determined recommended resources of the target object to a client corresponding to the target object; receiving resource feedback information sent by the client for the primary recommended resources and the secondary recommended resources in the recommended resources; The proportion of the first-level recommended resources and the proportion of the second-level recommended resources indicated by the hierarchical recommendation ratio are adjusted according to the resource feedback information.
6. The method according to claim 1, characterized in that The determining, based on the N first feature clusters and the M second feature clusters, a primary resource cluster and a secondary resource cluster associated with the reference resource comprises: Acquire M clustering tree structures; the M clustering tree structures include a leaf node corresponding to each candidate resource, N first-level parent nodes associated with the leaf nodes corresponding to the multiple candidate resources, and M second-level parent nodes associated with the N first-level parent nodes; Determine the leaf nodes corresponding to the reference resources in the M clustering tree structures as reference leaf nodes; Determine the first-level parent node associated with the reference leaf node as the reference first-level parent node, determine the other leaf nodes under the reference first-level parent node except the reference leaf node as the first leaf nodes, and determine the first-level resource cluster based on the candidate resources corresponding to the first leaf node; The second-level parent node associated with the reference first-level parent node is determined as the reference second-level parent node, and the leaf nodes under other reference parent nodes under the reference second-level parent node except the reference first-level parent node are determined as second leaf nodes, and the second-level resource cluster is determined based on the candidate resources corresponding to the second leaf node.
7. The method according to claim 6, characterized in that The obtaining of M clustering tree structures comprises: Determine a corresponding leaf node based on each candidate resource, and determine the N first-level parent nodes based on the leaf nodes corresponding to each candidate resource; the leaf nodes corresponding to the candidate resources whose resource embedding features belong to the same first feature cluster are associated with the same first-level parent node; one first-level parent node corresponds to one first cluster center feature; The M second-level parent nodes are determined based on the N first-level parent nodes; the first-level parent nodes whose corresponding first cluster center features belong to the same second feature cluster are associated with the same second-level parent node; Based on the multiple leaf nodes, the N first-level parent nodes and the M second-level parent nodes, M clustering tree structures corresponding to the multiple candidate resources are determined.
8. The method according to claim 1, characterized in that The method further comprises: Acquire a sample data set, wherein the sample data set includes a positive sample data pair and a negative sample data pair, wherein the positive sample data pair includes resource data of two sample resources that are correlated with each other, and the negative sample data pair includes resource data of two sample resources that are uncorrelated with each other; the two sample resources in the positive sample data pair are any two resources in which a sample object has performed interactive behaviors among a plurality of resources obtained by searching based on a target search keyword; the resource data of the sample resources in the positive sample data pair and the negative sample data pair include text data and image data; Calling the initial feature extraction model to perform feature extraction on the resource data of the two sample resources in the positive sample data pair to obtain a positive sample feature pair, calling the initial feature extraction model to perform feature extraction on the resource data of the two sample resources in the negative sample data pair to obtain a negative sample feature pair; the positive sample feature pair includes two sample embedding features corresponding to the two sample resources in the positive sample data pair; the negative sample feature pair includes two sample embedding features corresponding to the two sample resources in the negative sample data pair; Based on the feature difference between the two sample embedded features in the positive sample feature pair and the feature difference between the two sample embedded features in the negative sample feature pair, the initial feature extraction model is trained, and the target feature extraction model is determined based on the trained initial feature extraction model; The obtaining of multiple resource embedding features of multiple candidate resources includes: The text data and image data of each candidate resource are obtained, and the target feature extraction model is called to perform feature extraction on the text data and image data of each candidate resource to obtain the resource embedding feature of each candidate resource.
9. A resource recommendation device, characterized in that: The device comprises: A feature acquisition unit, used to acquire multiple resource embedding features of multiple candidate resources; one candidate resource corresponds to one resource embedding feature; A clustering unit, used to obtain a first cluster number N, and cluster the multiple resource embedding features based on the first cluster number N to obtain N first feature clusters and N first cluster center features of the N first feature clusters; one first feature cluster corresponds to one first cluster center feature; N is a positive integer; The clustering unit is further used to obtain a second cluster number M, and perform clustering processing on the N first cluster center features based on the second cluster number M to obtain M second feature clusters; M is a positive integer less than N; A processing unit is used to determine, when a reference resource for determining recommended resources for a target object is acquired, a primary resource cluster and a secondary resource cluster associated with the reference resource based on the N first feature clusters and the M second feature clusters, and determine the recommended resources for the target object based on the primary resource cluster and the secondary resource cluster; the primary resource cluster is a set of candidate resources associated with the same first feature cluster as the reference resource, a first feature cluster associated with a resource is a first feature cluster to which a resource embedding feature of the resource belongs; the secondary resource cluster is a set of candidate resources other than the primary resource cluster among the candidate resources associated with the same second feature cluster as the reference resource; a second feature cluster associated with a resource is a second feature cluster to which a first cluster center feature corresponding to the first feature cluster to which a resource embedding feature of the resource belongs; the degree of correlation between the resources in the primary resource cluster and the reference resource is greater than the degree of correlation between the resources in the secondary resource cluster and the reference resource.
10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Multimedia resource recommendation method and device, electronic equipment and storage medium
CN113342998A
Resource recommendation method and device, computer equipment and storage medium
CN114218499A
Resource clustering intelligent analysis method and device, electronic equipment and storage medium
CN114897070A
Cluster-based assessment of user interests
US20080243815A1
Tag selection and recommendation to a user of a content hosting service
US20190243838A1
