Training method of resource recommendation model, resource recommendation method and device
By acquiring relevant search terms and resources from sample search records, the sample resource information is enriched. A resource recommendation model is trained using a neural network model, which solves the problem of inaccurate prediction results in existing technologies and improves the accuracy and quality of resource recommendations.
Patent Information
- Application Number
- CN202210863793.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-21
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-07-21
AI Technical Summary
Existing resource recommendation models have low prediction accuracy, resulting in poor resource recommendation quality.
By acquiring sample search records, auxiliary information of sample resources is determined, including relevant search terms and specified information of relevant search resources, to enrich the information of sample resources. Then, a neural network model is used for feature extraction and fusion to train a resource recommendation model.
This improved the accuracy of the resource recommendation model and enhanced the quality of resource recommendations.
Smart Images

Figure CN115329844B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a training method for a resource recommendation model, a resource recommendation method, and an apparatus. Background Technology
[0002] With the continuous development of artificial intelligence technology, the types and functions of applications are also increasing. Some applications can recommend resources to users, enabling them to quickly find resources of interest from the recommendations and improving the user experience.
[0003] In related technologies, a resource recommendation model can be trained first, and then used to recommend resources. During training, basic information about at least one first sample resource and labeled results of at least one second sample resource being recommended can be obtained. The first sample resource is the resource historically selected by the sample object. Based on the basic information of each first sample resource, the predicted recommendation result for each second sample resource is determined. The resource recommendation model is then trained based on the predicted and labeled results of each second sample resource.
[0004] The aforementioned technique determines the prediction results of each second sample resource based on the basic information of each first sample resource. This results in low accuracy of the prediction results, which in turn leads to poor accuracy of the resource recommendation model and affects the quality of resource recommendations. Summary of the Invention
[0005] This application provides a training method for a resource recommendation model, a resource recommendation method, and an apparatus, which can be used to solve problems in related technologies. The technical solution includes the following contents.
[0006] On the one hand, a method for training a resource recommendation model is provided, the method comprising:
[0007] Obtain sample search records, basic information of at least one first sample resource, and annotation results of at least one second sample resource being recommended. The sample search records include historical search records of each first sample resource, and the first sample resource is the resource historically selected by the sample object.
[0008] Based on the sample search records, auxiliary information for each first sample resource is determined. The auxiliary information for the first sample resource includes at least one of related search terms related to the first sample resource and specified information of related search resources related to the related search terms.
[0009] Based on the basic and auxiliary information of each first sample resource, the prediction result for recommending each second sample resource is determined.
[0010] Based on the prediction and annotation results of each second sample resource being recommended, a resource recommendation model is trained.
[0011] On the other hand, a resource recommendation method is provided, the method comprising:
[0012] Acquire basic information about at least one first target resource, including target search records and historical selections of target objects, wherein the target search records include historical search records for each first target resource;
[0013] Based on the target search records, auxiliary information for each first target resource is determined. The auxiliary information for the first target resource includes at least one of the target search terms related to the first target resource and the specified information of the target search resource related to the target search terms.
[0014] Based on the basic and auxiliary information of each first target resource, the prediction result for recommending each second target resource is determined;
[0015] Based on the prediction results of the recommended second target resources, a specified target resource is selected from the recommended second target resources for recommendation.
[0016] On the other hand, a training apparatus for a resource recommendation model is provided, the apparatus comprising:
[0017] The acquisition module is used to acquire sample search records, basic information of at least one first sample resource, and the annotation results of at least one second sample resource being recommended. The sample search records include historical search records of each first sample resource, and the first sample resource is the resource historically selected by the sample object.
[0018] The determining module is used to determine auxiliary information for each of the first sample resources based on the sample search records. The auxiliary information for the first sample resources includes at least one of related search terms related to the first sample resources and specified information of related search resources related to the related search terms.
[0019] The determining module is also used to determine the prediction result of each second sample resource being recommended based on the basic information and auxiliary information of each first sample resource;
[0020] The training module is used to train a resource recommendation model based on the prediction and annotation results of each of the second sample resources.
[0021] In one possible implementation, the sample search record includes multiple search terms and search resources corresponding to each search term, with a first sample resource being a search resource;
[0022] The determining module is configured to, for any given first sample resource, determine the frequency of co-occurrence of the given first sample resource with each of the search terms based on the plurality of search terms and the search resources corresponding to each of the search terms; determine at least one related search term for the given first sample resource from the search terms based on the frequency of co-occurrence of the given first sample resource with each of the search terms; and determine auxiliary information for the given first sample resource based on at least one related search term for the given first sample resource.
[0023] In one possible implementation, the determining module is configured to determine at least one related search term of any first sample resource as auxiliary information of the first sample resource.
[0024] In one possible implementation, the determining module is configured to, for any first sample resource, construct a first graph structure corresponding to the first sample resource based on at least one related search term of the first sample resource, wherein the nodes in the first graph structure corresponding to the first sample resource are related search terms of the first sample resource; and determine the prediction result for recommending each second sample resource based on the basic information of each first sample resource and the corresponding first graph structure.
[0025] In one possible implementation, the determining module is configured to, for any one related search term of any one first sample resource, determine the frequency of co-occurrence of the any one related search term with each search resource based on the plurality of search terms and the search resources corresponding to each search term; determine at least one related search resource of the any one first sample resource from the search resources based on the frequency of co-occurrence of each related search term of the any one first sample resource with each search resource; and determine auxiliary information of the any one first sample resource based on at least one related search resource of the any one first sample resource.
[0026] In one possible implementation, the determining module is configured to determine the frequency of co-occurrence of the first sample resource with each search resource based on the frequency of co-occurrence of the first sample resource with each related search term of the first sample resource and the frequency of co-occurrence of each related search term of the first sample resource with each search resource; and to determine at least one related search resource of the first sample resource from the search resources based on the frequency of co-occurrence of the first sample resource with each search resource.
[0027] In one possible implementation, the determining module is configured to determine the specified information of at least one related search resource of any first sample resource as auxiliary information of the first sample resource.
[0028] In one possible implementation, the determining module is configured to, for any first sample resource, determine a second graph structure corresponding to the first sample resource based on specified information of at least one related search resource of the first sample resource, wherein the nodes in the second graph structure corresponding to the first sample resource are specified information of the related search resources of the first sample resource; and determine the prediction result of each second sample resource being recommended based on the basic information of each first sample resource and the corresponding second graph structure.
[0029] In one possible implementation, the number of the first sample resources is at least two;
[0030] The training module is used to determine the predicted sample resources based on the basic and auxiliary information of other sample resources, wherein the other sample resources are sample resources other than the specified sample resources among at least two first sample resources; and to train a resource recommendation model based on the specified sample resources, the predicted sample resources, the prediction results and annotation results of each of the second sample resources.
[0031] In one possible implementation, the training module is configured to determine a first loss value based on the specified sample resources and the predicted sample resources; determine a second loss value based on the prediction and labeling results of the recommended second sample resources; and train the resource recommendation model based on the first loss value and the second loss value.
[0032] On the other hand, a resource recommendation device is provided, the device comprising:
[0033] The acquisition module is used to acquire basic information of at least one first target resource, including target search records and historical selections of target objects. The target search records include historical search records for each first target resource.
[0034] The determining module is used to determine auxiliary information for each first target resource based on the target search records. The auxiliary information for the first target resource includes at least one of the target search terms related to the first target resource and the specified information of the target search resource related to the target search terms.
[0035] The determining module is further configured to determine the prediction result of the recommendation of each second target resource based on the basic information and auxiliary information of each first target resource;
[0036] The selection module is used to select a specified target resource from the recommended second target resources based on the prediction results of the recommended second target resources.
[0037] In one possible implementation, the determining module is used to input the basic information and auxiliary information of each of the first target resources into the resource recommendation model, and obtain the prediction result of each of the second target resources being recommended based on the resource recommendation model, wherein the resource recommendation model is trained according to the training method of the resource recommendation model described above.
[0038] On the other hand, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one computer program, which is loaded and executed by the processor to enable the electronic device to implement the training method of any of the resource recommendation models described above or any of the resource recommendation methods described above.
[0039] On the other hand, a computer-readable storage medium is also provided, wherein at least one computer program is stored in the computer-readable storage medium, the at least one computer program being loaded and executed by a processor to enable an electronic device to implement the training method of any of the resource recommendation models described above or any of the resource recommendation methods described above.
[0040] On the other hand, a computer program or computer program product is also provided, wherein the computer program or computer program product stores at least one computer program, which is loaded and executed by a processor to enable an electronic device to implement the training method of any of the above-described resource recommendation models or any of the above-described resource recommendation methods.
[0041] The technical solution provided in this application brings at least the following beneficial effects:
[0042] The technical solution provided in this application determines auxiliary information for each first sample resource based on sample search records. The auxiliary information for each first sample resource includes at least one of related search terms and specified information from related search resources related to those search terms. This enriches the information of the first sample resources using at least one of related search terms and related search resources. When determining the predicted recommendation result for each second sample resource based on the basic and auxiliary information of each first sample resource, the prediction result for each second sample resource is higher due to the rich information provided by the first sample resources. This results in a higher accuracy of the resource recommendation model trained based on the predicted and labeled results of each second sample resource, thus improving the quality of resource recommendations. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 This is a schematic diagram of a training method for a resource recommendation model or an implementation environment of a resource recommendation method provided in an embodiment of this application;
[0045] Figure 2 This is a flowchart of a training method for a resource recommendation model provided in an embodiment of this application;
[0046] Figure 3 This is a schematic diagram illustrating the relationship between a first sample resource, related search terms, and search resources, provided in an embodiment of this application.
[0047] Figure 4 This is a schematic diagram of a first-figure structure provided in an embodiment of this application;
[0048] Figure 5 This is a schematic diagram illustrating the extraction of an auxiliary feature provided in an embodiment of this application;
[0049] Figure 6 This is a schematic diagram of a second figure structure provided in an embodiment of this application;
[0050] Figure 7 This is a schematic diagram of a third-figure structure provided in an embodiment of this application;
[0051] Figure 8 This is a schematic diagram of the structure of a neural network model provided in an embodiment of this application;
[0052] Figure 9 This is a schematic diagram of a splicing feature corresponding to a first sample resource provided in an embodiment of this application;
[0053] Figure 10 This is a flowchart of a resource recommendation method provided in an embodiment of this application;
[0054] Figure 11 This is a schematic diagram of the structure of a training device for a resource recommendation model provided in an embodiment of this application;
[0055] Figure 12 This is a schematic diagram of the structure of a resource recommendation device provided in an embodiment of this application;
[0056] Figure 13 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application;
[0057] Figure 14 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0059] Figure 1 This is a schematic diagram of a training method or implementation environment for a resource recommendation model provided in an embodiment of this application. Figure 1 As shown, the implementation environment includes a terminal device 101 and a server 102. The training method or resource recommendation method of the resource recommendation model in this embodiment can be executed by the terminal device 101, by the server 102, or jointly by both the terminal device 101 and the server 102.
[0060] Terminal device 101 can be a smartphone, game console, desktop computer, tablet computer, laptop computer, smart TV, smart in-vehicle device, smart voice interaction device, smart home appliance, etc. Server 102 can be a single server, a server cluster consisting of multiple servers, or any of the following: cloud computing platform and virtualization center. This application embodiment does not limit this. Server 102 can communicate with terminal device 101 via a wired network or wireless network. Server 102 can have functions such as data processing, data storage, and data transmission and reception. This application embodiment does not limit this. The number of terminal devices 101 and servers 102 is not limited and can be one or more.
[0061] Based on the above implementation environment, this application provides a method for training a resource recommendation model, so as to... Figure 2 The flowchart shown in this embodiment of the present application illustrates a training method for a resource recommendation model. This method can be implemented by... Figure 1 The method can be executed by either terminal device 101 or server 102, or jointly by both. For ease of description, the terminal device 101 or server 102 executing the training method of the resource recommendation model in this embodiment is referred to as an electronic device, and this method can be executed by an electronic device. Figure 2 As shown, the method includes steps 201 to 204.
[0062] Step 201: Obtain sample search records, basic information of at least one first sample resource, and annotation results of at least one second sample resource being recommended. The sample search records contain historical search records of each first sample resource, and the first sample resource is the resource historically selected by the sample object.
[0063] Sample search records can be stored in log format on a specified device, which can be a terminal device, a server, or any storage device. Sample search records can be retrieved from the specified device. Sample search records include historical search records for multiple search resources. The historical search records for any one search resource include, but are not limited to, the search resource itself, the search terms corresponding to the search resource, and the historical search time for the search resource.
[0064] In this embodiment, at least one first sample resource can constitute a sequence, referred to as a first sample resource sequence. Basic information about at least one first sample resource in the first sample resource sequence can be obtained; a first sample resource is a search resource. Since a first sample resource is a search resource, the sample search record includes, but is not limited to, the historical search record of the first sample resource. In this embodiment, the first sample resource is the resource historically selected by the sample object, and this embodiment does not limit the basic information of the first sample resource.
[0065] For example, the first sample resource is an object providing an item, and the basic information of the object providing the item includes the object's identification information, the name of at least one item provided by the object, the type of at least one item provided by the object, and the object's location information. As another example, if the first sample resource is a video, the basic information of the video includes the video's title, the video's content category, the object that published the video, and the time the video was published.
[0066] In addition, at least one annotation result indicating that a second sample resource is recommended can be obtained. The second sample resource may or may not be a search resource; similarly, the second sample resource may or may not be a first sample resource. The annotation result indicating that any second sample resource is recommended is used to characterize whether that second sample resource is recommended. For example, if the annotation result for a second sample resource being recommended is 1, it indicates that the second sample resource is recommended; if the annotation result for a second sample resource being recommended is 0, it indicates that the second sample resource is not recommended.
[0067] Step 202: Determine auxiliary information for each first sample resource based on the sample search records.
[0068] The auxiliary information for the first sample resource includes at least one of related search terms related to the first sample resource and specified information about related search resources related to the related search terms. In this embodiment, statistical processing can be performed on the sample search records, and the auxiliary information for each first sample resource can be determined based on the statistical results.
[0069] Optionally, the sample search record includes multiple search terms and search resources corresponding to each search term, with one first sample resource being a search resource; determining auxiliary information for each first sample resource based on the sample search record includes: for any first sample resource, determining the frequency of co-occurrence between the first sample resource and each search term based on the multiple search terms and search resources corresponding to each search term; determining at least one related search term for the first sample resource from the search terms based on the frequency of co-occurrence between the first sample resource and each search term; and determining auxiliary information for the first sample resource based on at least one related search term for the first sample resource.
[0070] Understandably, the higher the relevance between a search term and a search resource, the easier it is to identify and display the search resource based on that search term. This makes it more likely that the search term and the search resource will appear in the sample search records; in other words, the higher the frequency of co-occurrence of the search term and the search resource. Therefore, the frequency of co-occurrence of a search term and a search resource can characterize the relevance between them.
[0071] In this embodiment of the application, based on the frequency of co-occurrence of any first sample resource with each search term, at least one related search term for any first sample resource is determined from each search term. This enables the selection of related search terms that are highly relevant to the first sample resource from each search term, and the determination of auxiliary information of the first sample resource based on the related search terms. This enables the enrichment of the information of the first sample resource based on related search terms that are highly relevant to the first sample resource.
[0072] For any given first sample resource, statistical processing can be performed on multiple search terms and their corresponding search resources to obtain the number of times the first sample resource and each search term co-occur. The sum of these co-occurrences is then calculated to obtain the total frequency corresponding to the first sample resource. For any given search term, the co-occurrence frequency of the first sample resource and the search term is divided by the total frequency corresponding to that first sample resource to obtain the frequency of their co-occurrence. In this way, the frequency of any given first sample resource and its co-occurrence with each search term can be obtained.
[0073] Next, frequencies higher than a first reference frequency are selected from the frequencies of co-occurrence of any first sample resource with various search terms. The search terms corresponding to these frequencies are then used as relevant search terms for any first sample resource, thereby determining auxiliary information for that first sample resource based on these relevant search terms. The number of relevant search terms for any first sample resource is at least one. The first reference frequency can be a predefined frequency value. Alternatively, the frequencies of co-occurrence of any first sample resource with various search terms can be sorted, and the resulting frequency (the nth frequency) can be used as the first reference frequency.
[0074] In one possible implementation, determining auxiliary information for any first sample resource based on at least one related search term of any first sample resource includes: determining at least one related search term of any first sample resource as auxiliary information for any first sample resource.
[0075] At least one related search term for any first sample resource can be directly identified as auxiliary information for that first sample resource. For example, if the related search terms for the first sample resource include "mini skirt" and "summer clothing", then "mini skirt" and "summer clothing" can be used as auxiliary information for the first sample resource.
[0076] In another possible implementation, auxiliary information for any first sample resource is determined based on at least one related search term of any first sample resource, including: for any related search term of any first sample resource, determining the frequency of co-occurrence of any related search term with each search resource based on multiple search terms and the search resources corresponding to each search term; determining at least one related search resource of any first sample resource from the search resources based on the frequency of co-occurrence of each related search term of any first sample resource with each search resource; and determining auxiliary information for any first sample resource based on at least one related search resource of any first sample resource.
[0077] In this embodiment, since the frequency of co-occurrence of search terms and search resources can characterize the relevance between them, at least one related search resource for any first sample resource is determined from among the various search resources based on the frequency of co-occurrence of each related search term with each search resource for any given first sample resource. This achieves the identification of related search resources with high relevance to related search terms from among the various search resources. Furthermore, since related search terms have high relevance to the first sample resource, the related search resources also have high relevance to the first sample resource. Auxiliary information for the first sample resource is determined based on the related search resources, thus enriching the information of the first sample resource based on related search resources with high relevance to it.
[0078] For any relevant search term of any first sample resource, statistical processing can be performed on multiple search terms and their corresponding search resources to obtain the number of times each relevant search term and its corresponding search resources co-occur. The sum of these co-occurrences is then calculated to obtain the total frequency of the relevant search term. For any given search resource, the co-occurrence frequency of the relevant search term and its corresponding search resource is divided by the total frequency of the relevant search term to obtain the co-occurrence frequency of the relevant search term and its corresponding search resource. In this way, the co-occurrence frequencies of each relevant search term and each individual search resource for any first sample resource can be obtained.
[0079] Optionally, frequencies higher than a second reference frequency are selected from the frequencies of co-occurrence of each relevant search term with each search resource of any first sample resource. The search resources corresponding to these frequencies are then used as relevant search resources for any first sample resource, thereby determining auxiliary information for that first sample resource based on these relevant search resources. The number of relevant search resources for any first sample resource is at least one. The second reference frequency can be a predefined frequency value. Alternatively, the frequencies of co-occurrence of each relevant search term with each search resource of any first sample resource can be sorted, and the resulting frequency (the nth frequency) can be used as the second reference frequency.
[0080] Optionally, based on the frequency of co-occurrence of each relevant search term of any first sample resource with each search resource, at least one relevant search resource of any first sample resource is determined from the search resources, including: determining the frequency of co-occurrence of any first sample resource with each search resource based on the frequency of co-occurrence of any first sample resource with each relevant search term of any first sample resource and the frequency of co-occurrence of each relevant search term of any first sample resource with each search resource; and determining at least one relevant search resource of any first sample resource from the search resources based on the frequency of co-occurrence of any first sample resource with each search resource.
[0081] In this embodiment, any first sample resource, any related search term of the first sample resource, and any search resource can be considered as a triple. For any triple, the frequency of co-occurrence of any first sample resource and any related search term of the first sample resource and the frequency of co-occurrence of any related search term of the first sample resource and any search resource are multiplied to obtain the frequency product corresponding to the triple.
[0082] For any search resource, the frequency products of each triple containing that search resource are weighted and summed to obtain the frequency of any first sample resource co-occurring with any search resource.
[0083] Please see Figure 3 , Figure 3 This is a schematic diagram illustrating the relationship between a first sample resource, related search terms, and search resources, provided in an embodiment of this application. Specifically, related search term 'a' is a related search term for the first sample resource A, and related search term 'b' is another related search term for the first sample resource A.
[0084] We can consider the first sample resource A, the related search term a, and search resource 1 as a triple. For this triple, the frequency of co-occurrence of the first sample resource A and the related search term a is Aa, and the frequency of co-occurrence of the related search term a and search resource 1 is a1. Multiplying Aa and a1 gives the frequency product Aa*a1 for this triple. Based on the same principle, we can obtain the frequency products for the other seven triples, namely Aa*a2, Aa*a3, Aa*a4, Ab*b1, Ab*b2, Ab*b3, and Ab*b4.
[0085] For search resource 1, the triple consisting of the first sample resource A, the related search term a, and search resource 1 contains search resource 1, and the triple consisting of the first sample resource A, the related search term b, and search resource 1 also contains search resource 1. Therefore, the frequency products corresponding to these two triples (i.e., Aa*a1 and Ab*b1) can be weighted and summed to obtain the frequency of co-occurrence of the first sample resource A and search resource 1.
[0086] Based on the same principle, for search resource 2, the weighted sum of Aa*a2 and Ab*b2 is used to obtain the frequency of co-occurrence of the first sample resource A and search resource 2. For search resource 3, the weighted sum of Aa*a3 and Ab*b3 is used to obtain the frequency of co-occurrence of the first sample resource A and search resource 3. For search resource 4, the weighted sum of Aa*a4 and Ab*b4 is used to obtain the frequency of co-occurrence of the first sample resource A and search resource 4.
[0087] After obtaining the frequencies of co-occurrence of any first sample resource with all search resources, frequencies greater than a third reference frequency are selected from these frequencies. The search resources corresponding to these frequencies are then used as relevant search resources for any first sample resource, thereby determining auxiliary information for that first sample resource. The number of relevant search resources for any first sample resource is at least one. The third reference frequency can be a predefined frequency value. Alternatively, the frequencies of co-occurrence of any first sample resource with all search resources can be sorted, and the resulting frequency (the nth frequency) can be used as the third reference frequency.
[0088] In one possible implementation, determining auxiliary information for any first sample resource based on at least one related search resource of any first sample resource includes: determining specified information of at least one related search resource of any first sample resource as auxiliary information for any first sample resource.
[0089] For any related search resource of any first sample resource, specified information of that related search resource can be obtained. This application embodiment does not limit the specified information of the related search resource. For example, if the related search resource is an item providing object, the specified information of the item providing object may be the identification information of the item providing object, or the name of at least one item provided by the item providing object, or the type of at least one item provided by the item providing object, or the location information of the item providing object, etc. As another example, if the related search resource is a video, then the specified information of the video may be the title of the video, or the content category of the video, or the object that published the video, or the time when the video was published, etc.
[0090] The specified information of at least one related search resource of any first sample resource can be directly determined as auxiliary information of any first sample resource. For example, if the specified information of the related search resources of the first sample resource includes "youth idol drama" and "campus", then "youth idol drama" and "campus" can be used as auxiliary information of the first sample resource.
[0091] It should be noted that the auxiliary information of any first sample resource may include at least one related search term of the first sample resource, or it may include specified information of at least one related search resource of the first sample resource, or it may include at least one related search term of the first sample resource and specified information of at least one related search resource of the first sample resource, etc.
[0092] Step 203: Based on the basic and auxiliary information of each first sample resource, determine the prediction result recommended for each second sample resource.
[0093] In this embodiment, at least one first sample resource can constitute a sequence of first sample resources. A neural network model can be obtained, and the basic information and auxiliary information of each first sample resource are input into the neural network model. The neural network model extracts features from the basic information of each first sample resource to obtain the basic features of each first sample resource, wherein the basic features of the first sample resource are used to characterize the basic information of the first sample resource. In addition, the neural network model extracts features from the auxiliary information of each first sample resource to obtain the auxiliary features of each first sample resource, wherein the auxiliary features of the first sample resource are used to characterize the auxiliary information of the first sample resource.
[0094] Next, for any first sample resource, the neural network model concatenates its basic and auxiliary features to obtain the concatenated features corresponding to that first sample resource. Then, the neural network model fuses the concatenated features corresponding to each first sample resource to obtain the sequence features of the first sample resource sequence. Based on the sequence features of the first sample resource sequence, the prediction result for recommending each second sample resource is obtained.
[0095] The prediction result of any second sample resource being recommended represents the probability that the second sample resource will be recommended. Specifically, the prediction result of any second sample resource being recommended is greater than or equal to 0 and less than or equal to 1, and the prediction result of any second sample resource being recommended is directly proportional to the probability that the second sample resource will be recommended.
[0096] In one possible implementation, the auxiliary information of any first sample resource includes at least one related search term for the first sample resource. Based on the basic information and auxiliary information of each first sample resource, the prediction result for recommending each second sample resource is determined, including: for any first sample resource, constructing a first graph structure corresponding to the first sample resource based on at least one related search term for the first sample resource, wherein the nodes in the first graph structure corresponding to the first sample resource are the related search terms of the first sample resource; and determining the prediction result for recommending each second sample resource based on the basic information of each first sample resource and the corresponding first graph structure.
[0097] In this embodiment, a related search term for any first sample resource can be used as a node in the first graph structure corresponding to that first sample resource. Based on this method, the first graph structure corresponding to the first sample resource can be obtained. Alternatively, any first sample resource can also be used as a node in the first graph structure corresponding to that first sample resource.
[0098] Please see Figure 4 , Figure 4This is a schematic diagram of a first graph structure provided in an embodiment of this application. The first graph structure is the first graph structure corresponding to a first sample resource A. The first sample resource A is a node in the first graph structure corresponding to the first sample resource A. The relevant search terms for the first sample resource A are relevant search terms a and b. Relevant search terms a and b are respectively two other nodes in the first graph structure corresponding to the first sample resource A, thereby obtaining the first graph structure corresponding to the first sample resource A.
[0099] This application does not limit the model structure or size of the neural network model. Optionally, the neural network model may include deep neural networks, graph neural networks, spliced networks, fused networks, and predictive networks. This application does not limit the network structure or size of any of the deep neural networks, graph neural networks, spliced networks, fused networks, and predictive networks.
[0100] The basic information of each first sample resource can be input into a deep neural network. The deep neural network will then extract features from the basic information of each first sample resource to obtain its basic features. The first graph structure corresponding to each first sample resource can be input into a graph neural network. The graph neural network will then extract features from the first graph structure corresponding to each first sample resource to obtain its auxiliary features. These auxiliary features are used to represent at least one relevant search term for the first sample resource. Please refer to [link to relevant documentation]. Figure 5 , Figure 5 This is a schematic diagram illustrating the extraction of auxiliary features provided in an embodiment of this application. The first graph structure corresponding to the first sample resource A is input into a graph neural network, and the graph neural network extracts features from the first graph structure corresponding to the first sample resource A to obtain the auxiliary features of the first sample resource A.
[0101] Next, for any first sample resource, the concatenation network concatenates its basic and auxiliary features to obtain the concatenated features corresponding to that first sample resource. In this way, the concatenated features corresponding to each first sample resource are obtained. The fusion network then fuses these concatenated features to obtain the sequence features of the first sample resource sequence. Finally, the prediction network maps the sequence features of the first sample resource sequence to obtain the prediction results for recommending each second sample resource.
[0102] In one possible implementation, the auxiliary information of any first sample resource includes specified information of at least one related search resource of the first sample resource. Based on the basic information and auxiliary information of each first sample resource, the prediction result of recommending each second sample resource is determined, including: for any first sample resource, based on the specified information of at least one related search resource of the first sample resource, determining the second graph structure corresponding to the first sample resource, wherein the nodes in the second graph structure corresponding to the first sample resource are the specified information of the related search resources of the first sample resource; and based on the basic information of each first sample resource and the corresponding second graph structure, determining the prediction result of recommending each second sample resource.
[0103] In this embodiment, the specified information of a related search resource for any first sample resource can be used as a node in the second graph structure corresponding to the first sample resource. Based on this method, the second graph structure corresponding to the first sample resource can be obtained. Alternatively, any first sample resource can also be used as a node in the second graph structure corresponding to the first sample resource.
[0104] Please see Figure 6 , Figure 6 This is a schematic diagram of a second graph structure provided in an embodiment of this application. This second graph structure corresponds to the first sample resource A. The first sample resource A is a node in the second graph structure corresponding to the first sample resource A. The relevant search resources for the first sample resource A are relevant search resources 1 to 3. The specified information of relevant search resources 1 to 3 are respectively used as the other three nodes in the second graph structure corresponding to the first sample resource A, thereby obtaining the second graph structure corresponding to the first sample resource A.
[0105] Optionally, the basic information of each first sample resource can be input into a deep neural network, which extracts features from the basic information of each first sample resource to obtain the basic features of each first sample resource. The second graph structure corresponding to each first sample resource is input into a graph neural network, which extracts features from the second graph structure corresponding to each first sample resource to obtain the auxiliary features of each first sample resource. In this case, the auxiliary features of the first sample resource are used to characterize the specified information of at least one related search resource of the first sample resource.
[0106] Next, for any first sample resource, the concatenation network concatenates its basic and auxiliary features to obtain the concatenated features corresponding to that first sample resource. The fusion network then fuses the concatenated features of each first sample resource to obtain the sequence features of the first sample resource sequence. Finally, the prediction network maps the sequence features of the first sample resource sequence to obtain the prediction results for recommending each second sample resource.
[0107] In one possible implementation, the auxiliary information of any first sample resource includes at least one related search term for the first sample resource and specified information of at least one related search resource for the first sample resource. Based on the basic information and auxiliary information of each first sample resource, determining the prediction result for recommending each second sample resource includes: for any first sample resource, determining the third graph structure corresponding to the first sample resource based on at least one related search term and specified information of at least one related search resource for the first sample resource, wherein the nodes in the third graph structure corresponding to the first sample resource are either related search terms of the first sample resource or specified information of related search resources of the first sample resource; and determining the prediction result for recommending each second sample resource based on the basic information of each first sample resource and the corresponding third graph structure.
[0108] In this embodiment, a related search term of any first sample resource can be used as a node in the third graph structure corresponding to that first sample resource, and specified information of a related search resource of any first sample resource can be used as a node in the third graph structure corresponding to that first sample resource. Based on this method, the third graph structure corresponding to the first sample resource can be obtained. Alternatively, any first sample resource can also be used as a node in the third graph structure corresponding to that first sample resource.
[0109] Please see Figure 7 , Figure 7 This is a schematic diagram of a third graph structure provided in an embodiment of this application. This third graph structure corresponds to a first sample resource A. The first sample resource A is a node in the third graph structure corresponding to it. The relevant search terms for the first sample resource A are search terms a and b, which respectively serve as two other nodes in the third graph structure corresponding to the first sample resource A. The relevant search resources for the first sample resource A are search resources 1 to 3, and the specified information of search resources 1 to 3 respectively serves as three other nodes in the third graph structure corresponding to the first sample resource A, thus obtaining the third graph structure corresponding to the first sample resource A.
[0110] Optionally, the basic information of each first sample resource is input into a deep neural network, which extracts features from the basic information of each first sample resource to obtain the basic features of each first sample resource. The third graph structure corresponding to each first sample resource is input into a graph neural network, which extracts features from the third graph structure corresponding to each first sample resource to obtain the auxiliary features of each first sample resource. At this time, the auxiliary features of the first sample resource are used to characterize at least one related search term of the first sample resource and at least one specified information of the related search resource of the first sample resource.
[0111] Next, for any first sample resource, the concatenation network concatenates its basic and auxiliary features to obtain the concatenated features corresponding to that first sample resource. The fusion network then fuses the concatenated features of each first sample resource to obtain the sequence features of the first sample resource sequence. Finally, the prediction network maps the sequence features of the first sample resource sequence to obtain the prediction results for recommending each second sample resource.
[0112] It should be noted that, in this embodiment, other information can also be input into the neural network model, so that the neural network model can determine the prediction result of recommending the second sample resource based on the other information, the basic information of the first sample resource, and the auxiliary information of the first sample resource. This embodiment does not limit the other information; for example, other information includes, but is not limited to, the basic information of the third sample resource, weather information, time information, and the basic information of the second sample resource. The third sample resource is a resource historically selected by the sample object, and the sample search records do not include historical search records for the third sample resource.
[0113] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of a neural network model provided in an embodiment of this application. The neural network model includes a deep neural network, a graph neural network, a (first) splicing network, a fusion network, a (second) splicing network, and a prediction network. This embodiment of the application does not limit the network structure, network size, or other aspects of any of the deep neural network, graph neural network, (first) splicing network, fusion network, (second) splicing network, and prediction network.
[0114] It is possible to obtain basic and auxiliary information of a first sample resource sequence, which includes multiple first sample resources. That is, it is possible to obtain basic and auxiliary information of multiple first sample resources. The auxiliary information of a first sample resource includes at least one of at least one related search term and at least one specified information from at least one related search resource. Based on the auxiliary information of any first sample resource, a third graph structure corresponding to that first sample resource is constructed. In this way, third graph structures corresponding to multiple first sample resources can be obtained. Other information can also be obtained, including but not limited to basic information of the third sample resources, weather information, time information, and basic information of the second sample resources.
[0115] Other information is input into a deep neural network, which extracts features from this information to obtain additional features, which are used to represent the other information. Basic information from multiple first-sample resources is input into a deep neural network, which extracts features from the basic information of each first-sample resource to obtain basic features of each first-sample resource. The third graph structure corresponding to multiple first-sample resources is input into a graph neural network, which extracts features from the third graph structure corresponding to each first-sample resource to obtain auxiliary features of each first-sample resource.
[0116] Next, for any first sample resource, the first concatenation network concatenates the basic features and auxiliary features of the first sample resource to obtain the concatenated features corresponding to that first sample resource. In this way, the concatenated features corresponding to each first sample resource can be obtained. The fusion network then fuses the concatenated features corresponding to each first sample resource to obtain the sequence features of the first sample resource sequence.
[0117] Next, the second concatenation network concatenates other features with the sequence features of the first sample resource sequence to obtain concatenated features. The prediction network then maps the concatenated features to obtain the prediction result that the second sample resource is recommended.
[0118] In this embodiment, the splicing network can splice the basic features and auxiliary features of any first sample resource to obtain the spliced features corresponding to the first sample resource. Please refer to [link to relevant documentation]. Figure 9 , Figure 9 This is a schematic diagram of a splicing feature corresponding to a first sample resource provided in an embodiment of this application. Figure 9It can be clearly seen that the spliced feature corresponding to the first sample resource A is formed by splicing the basic feature and auxiliary feature of the first sample resource A; the spliced feature corresponding to the first sample resource B is formed by splicing the basic feature and auxiliary feature of the first sample resource B; and the spliced feature corresponding to the first sample resource C is formed by splicing the basic feature and auxiliary feature of the first sample resource C.
[0119] It should be noted that the first, second, or third graph structure corresponding to any of the first sample resources mentioned above may also include the basic information of that first sample resource. The following explanation uses the third graph structure corresponding to any first sample resource as an example. The implementation principles of the first and second graph structures corresponding to any first sample resource are similar to those of the third graph structure corresponding to that first sample resource, and will not be elaborated upon here.
[0120] In this embodiment, the basic information of any first sample resource is used as a node in the third graph structure corresponding to that first sample resource. A related search term for that first sample resource is used as a node in the third graph structure corresponding to that first sample resource. Specific information of a related search resource for any first sample resource is used as a node in the third graph structure corresponding to that first sample resource. Based on this method, the third graph structure corresponding to the first sample resource can be obtained.
[0121] In this scenario, the neural network model can include a graph neural network and a prediction network. The third graph structure corresponding to any first sample resource is input into the graph neural network, which extracts features from this structure to obtain the node features of each node. The node features of any node are used to characterize that node. For example, if a node represents a related search term for the first sample resource, then its node features are used to characterize that related search term.
[0122] Since the third graph structure corresponding to the first sample resource includes the basic information and auxiliary information of the first sample resource, the node features of each node in the third graph structure corresponding to the first sample resource include the basic features and auxiliary features of the first sample resource.
[0123] The graph neural network (Graph Neural Network) can concatenate the node features of each node in the third graph structure corresponding to the first sample resource, thereby concatenating the basic and auxiliary features of the first sample resource to obtain the concatenated features corresponding to the first sample resource. Next, the Graph Neural Network can fuse the concatenated features corresponding to each first sample resource to obtain the sequence features of the first sample resource sequence. Then, the prediction network maps the sequence features of the first sample resource sequence to obtain the prediction results for the recommendation of each second sample resource.
[0124] Optionally, the neural network model may also include a deep neural network and a concatenation network. Other information is input into the deep neural network, which extracts features from this information to obtain additional features. The concatenation network concatenates these additional features with the sequence features of the first sample resource sequence obtained from the graph neural network to obtain the concatenated features. The prediction network maps these concatenated features to obtain the prediction results for the recommendation of each second sample resource.
[0125] Step 204: Based on the prediction and annotation results of each second sample resource being recommended, a resource recommendation model is trained.
[0126] In this embodiment, for any second sample resource, the loss value corresponding to that second sample resource can be determined based on the recommended prediction and annotation results. The loss values corresponding to each second sample resource are then weighted and summed to obtain the loss value of the neural network model. The neural network model is then adjusted based on its loss value to obtain the adjusted neural network model.
[0127] If the training termination condition is met, the adjusted neural network model will be used as the resource recommendation model. If the training termination condition is not met, the adjusted neural network model will be used as the neural network model for the next training iteration, and the neural network model will be trained again according to steps 201 to 204 until the training termination condition is met, thus obtaining the resource recommendation model.
[0128] This application does not limit the conditions for meeting the training termination criteria. For example, meeting the training termination criteria means reaching a set number of training iterations (e.g., 500 times), or it means that the gradient of the loss value of the neural network model no longer decreases.
[0129] In one possible implementation, the number of first sample resources is at least two; a resource recommendation model is trained based on the prediction and annotation results of each second sample resource being recommended, including: determining the predicted sample resources based on the basic and auxiliary information of other sample resources, wherein the other sample resources are sample resources other than the specified sample resources among the at least two first sample resources; and training the resource recommendation model based on the specified sample resources, the predicted sample resources, the prediction and annotation results of each second sample resource being recommended.
[0130] In this embodiment, the neural network model can extract features from the basic information of other sample resources to obtain their basic features, and extract features from their auxiliary information to obtain their auxiliary features. Then, the basic and auxiliary features of the other sample resources are concatenated to obtain a second concatenated feature, and the predicted sample resource is determined based on this second concatenated feature. Subsequently, based on the specified sample resource, the predicted sample resource, the prediction results of each second sample resource being recommended, and the annotation results, the loss value of the neural network model is determined. The neural network model is then adjusted based on this loss value to obtain the resource recommendation model.
[0131] Optionally, a resource recommendation model is trained based on specified sample resources, predicted sample resources, and the prediction and annotation results of each second sample resource being recommended. This includes: determining a first loss value based on the specified sample resources and predicted sample resources; determining a second loss value based on the prediction and annotation results of each second sample resource being recommended; and training the resource recommendation model based on the first and second loss values.
[0132] In this embodiment of the application, a first loss value can be determined based on specified sample resources and predicted sample resources. This embodiment of the application does not limit the calculation method of the first loss value. For example, the cross-entropy loss function is used to determine the first loss value based on specified sample resources and predicted sample resources.
[0133] The second loss value can also be determined based on the prediction and annotation results of each second sample resource. This application does not limit the calculation method of the second loss value. For example, the cross-entropy loss function is used to determine the second loss value based on the prediction and annotation results of each second sample resource.
[0134] Next, the first and second loss values are weighted and summed, and the sum is used as the loss value of the neural network model. Based on the loss value of the neural network model, the model is adjusted at least once until the resource recommendation model is obtained.
[0135] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the sample search records and basic information of the first sample resources involved in this application were obtained with full authorization.
[0136] The above method determines auxiliary information for each first sample resource based on sample search records. This auxiliary information includes at least one of the following: related search terms and specified information from related search resources associated with the first sample resource. This enriches the information of the first sample resource using at least one of the related search terms and related search resources. When determining the predicted recommendation result for each second sample resource based on the basic and auxiliary information of each first sample resource, the rich information provided by the first sample resources leads to a higher predicted recommendation result for each second sample resource. This results in a higher accuracy of the resource recommendation model trained based on the predicted and labeled results of each second sample resource, thus improving the quality of resource recommendations.
[0137] Based on the above implementation environment, this application provides a resource recommendation method to... Figure 10 The flowchart shown in this embodiment of the present application illustrates a resource recommendation method. This method can be implemented by... Figure 1 The method can be executed by either terminal device 101 or server 102, or jointly by both. For ease of description, the terminal device 101 or server 102 executing the resource recommendation method in this embodiment is referred to as an electronic device, and the method can be executed by an electronic device. Figure 10 As shown, the method includes steps 1001 to 1004.
[0138] Step 1001: Obtain basic information of at least one first target resource, including target search records and historical selections of target objects. The target search records include historical search records for each first target resource.
[0139] Target search records can be stored in log format on a specified device, which can be a terminal device, a server, or any storage device. Target search records can be retrieved from the specified device. These records include historical search records for multiple search resources. The historical search records for any single search resource include, but are not limited to, the search resource itself, the corresponding search terms, and the historical search time for that resource.
[0140] At least one first target resource can constitute a sequence, referred to as a first target resource sequence. Basic information about at least one first target resource in the first target resource sequence can be obtained; a first target resource is a search resource. Since a first target resource is a search resource, the target search record includes, but is not limited to, the historical search record of the first target resource. In this embodiment, the first target resource is a resource historically selected by the target object, and this embodiment does not limit the basic information of the first target resource.
[0141] It should be noted that the method for obtaining the target search record can be found in the description of the sample search record above; the implementation principles are similar and will not be repeated here. The content of the basic information of the first target resource can be found in the description of the basic information of the first sample resource above; the implementation principles are similar and will not be repeated here.
[0142] Step 1002: Determine auxiliary information for each first target resource based on the target search records.
[0143] The auxiliary information for the first target resource includes at least one of the target search terms related to the first target resource and the specified information of the target search resource related to the target search terms. In this embodiment, the target search records can be statistically processed, and the auxiliary information for each first target resource can be determined based on the statistical results.
[0144] It should be noted that step 202 describes the method for determining the auxiliary information of any first sample resource. The description of step 1002 can be found in the relevant content of step 202, and will not be repeated here. The method for determining the target search term can be found in the description of related search terms above; the implementation principles are similar, and will not be repeated here. The method for determining the specified information of the target search resource can be found in the description of the specified information of related search resources above; the implementation principles are similar, and will not be repeated here.
[0145] Step 1003: Based on the basic and auxiliary information of each first target resource, determine the recommended prediction results for each second target resource.
[0146] In this embodiment of the application, the prediction result of any second target resource being recommended represents the probability that the second target resource is recommended. The prediction result of any second target resource being recommended is greater than or equal to 0 and less than or equal to 1, and the prediction result of any second target resource being recommended is directly proportional to the probability that the second target resource is recommended.
[0147] In one possible implementation, based on the basic and auxiliary information of each first target resource, the prediction result for recommending each second target resource is determined, including: inputting the basic and auxiliary information of each first target resource into a resource recommendation model, and obtaining the prediction result for recommending each second target resource based on the resource recommendation model, wherein the resource recommendation model is based on... Figure 2 The resource recommendation model shown was trained using the training method described.
[0148] A resource recommendation model can be obtained. The basic and auxiliary information of each first target resource is input into the resource recommendation model. The model extracts features from the basic information of each first target resource to obtain its basic features. Additionally, it extracts features from the auxiliary information of each first target resource to obtain its auxiliary features. Then, the model processes the basic and auxiliary features of each first target resource to obtain the prediction results for the recommendation of each second target resource.
[0149] It should be noted that the resource recommendation model is trained from a neural network model. Therefore, the resource recommendation model and the neural network model are similar in model structure and size, differing only in their model parameters. The method for obtaining the prediction results of each second target resource based on the resource recommendation model can be found in the description of step 203 above; their implementation principles are similar and will not be repeated here.
[0150] Step 1004: Based on the prediction results of each second target resource being recommended, select a specified target resource from each second target resource for recommendation.
[0151] From the recommended predictions for each secondary target resource, predictions greater than the reference data can be selected. The secondary target resource corresponding to the prediction that is greater than the reference data is then used as the designated target resource, and recommendations are made for that designated target resource.
[0152] Optionally, the reference data is set data, or the reference data is the sorted prediction results of each second target resource, and the sorted target number number (e.g., the 10th) prediction result is used as the reference data.
[0153] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the target search records and basic information of the first target resource involved in this application were obtained with full authorization.
[0154] The above method determines auxiliary information for each first target resource based on target search records. This auxiliary information includes at least one of the following: target search terms related to the first target resource and specified information about the target search resource related to the target search terms. This enriches the information of the first target resource using at least one of the target search terms and target search resources. When determining the predicted recommendation results for each second target resource based on the basic and auxiliary information of each first target resource, the rich information in the first target resources leads to higher predicted recommendation results for each second target resource. This results in higher accuracy when selecting a specified target resource for recommendation from among the second target resources based on the predicted recommendation results, thereby improving the quality of resource recommendations.
[0155] Figure 11 The diagram shown is a structural schematic of a training device for a resource recommendation model provided in an embodiment of this application. Figure 11 As shown, the device includes:
[0156] The acquisition module 1101 is used to acquire sample search records, basic information of at least one first sample resource, and the annotation results of at least one second sample resource being recommended. The sample search records include the historical search records of each first sample resource, and the first sample resource is the resource historically selected by the sample object.
[0157] The determining module 1102 is used to determine auxiliary information for each first sample resource based on the sample search records. The auxiliary information for the first sample resource includes at least one of the relevant search terms related to the first sample resource and the specified information of the relevant search resources related to the relevant search terms.
[0158] The determination module 1102 is also used to determine the prediction result of each second sample resource being recommended based on the basic information and auxiliary information of each first sample resource;
[0159] Training module 1103 is used to train a resource recommendation model based on the prediction and annotation results of each second sample resource being recommended.
[0160] In one possible implementation, the sample search record includes multiple search terms and search resources corresponding to each search term, with a first sample resource being a search resource;
[0161] The determining module 1102 is used to, for any first sample resource, determine the frequency of co-occurrence of any first sample resource with each search term based on multiple search terms and the search resources corresponding to each search term; determine at least one related search term of any first sample resource from the search terms based on the frequency of co-occurrence of any first sample resource with each search term; and determine auxiliary information of any first sample resource based on at least one related search term of any first sample resource.
[0162] In one possible implementation, the determining module 1102 is used to determine at least one related search term of any first sample resource as auxiliary information of any first sample resource.
[0163] In one possible implementation, the determining module 1102 is used to construct a first graph structure corresponding to any first sample resource based on at least one related search term of any first sample resource, wherein the nodes in the first graph structure corresponding to any first sample resource are related search terms of any first sample resource; and to determine the prediction result of each second sample resource being recommended based on the basic information of each first sample resource and the corresponding first graph structure.
[0164] In one possible implementation, the determining module 1102 is configured to, for any one related search term of any first sample resource, determine the frequency of co-occurrence of any related search term with each search resource based on multiple search terms and the search resources corresponding to each search term; determine at least one related search resource of any first sample resource from the search resources based on the frequency of co-occurrence of each related search term of any first sample resource with each search resource; and determine auxiliary information of any first sample resource based on at least one related search resource of any first sample resource.
[0165] In one possible implementation, the determining module 1102 is used to determine the frequency of co-occurrence of any first sample resource with each search resource based on the frequency of co-occurrence of any first sample resource with each related search term of any first sample resource and the frequency of co-occurrence of each related search term of any first sample resource with each search resource respectively; and to determine at least one related search resource of any first sample resource from the search resources based on the frequency of co-occurrence of any first sample resource with each search resource.
[0166] In one possible implementation, the determining module 1102 is used to determine the specified information of at least one related search resource of any first sample resource as auxiliary information of any first sample resource.
[0167] In one possible implementation, the determining module 1102 is used to determine, for any first sample resource, a second graph structure corresponding to the first sample resource based on specified information of at least one related search resource of the first sample resource, wherein the nodes in the second graph structure corresponding to the first sample resource are specified information of the related search resources of the first sample resource; and to determine the prediction result of each second sample resource being recommended based on the basic information of each first sample resource and the corresponding second graph structure.
[0168] In one possible implementation, the number of first sample resources is at least two;
[0169] Training module 1103 is used to determine the predicted sample resources based on the basic information and auxiliary information of other sample resources. The other sample resources are sample resources other than the specified sample resources among at least two first sample resources. Based on the specified sample resources, the predicted sample resources, the prediction results of each second sample resource being recommended, and the annotation results, a resource recommendation model is trained.
[0170] In one possible implementation, the training module 1103 is used to determine a first loss value based on specified sample resources and predicted sample resources; determine a second loss value based on the prediction results and annotation results of each second sample resource being recommended; and train a resource recommendation model based on the first loss value and the second loss value.
[0171] The aforementioned device determines auxiliary information for each first sample resource based on sample search records. This auxiliary information includes at least one of the following: related search terms and specified information about related search resources associated with the first sample resource. This enriches the information of the first sample resources using at least one of the related search terms and related search resources. When determining the predicted recommendation result for each second sample resource based on the basic and auxiliary information of each first sample resource, the rich information provided by the first sample resources leads to a higher predicted recommendation result for each second sample resource. This results in a higher accuracy of the resource recommendation model trained based on the predicted and labeled results of the second sample resources, thus improving the quality of resource recommendations.
[0172] It should be understood that the above Figure 11The provided device, in implementing its functions, is only illustrated by the division of the above-described functional modules. In practical applications, the functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation processes are detailed in the method embodiments, and will not be repeated here.
[0173] Figure 12 The diagram shown is a structural schematic of a resource recommendation device provided in an embodiment of this application. Figure 12 As shown, the device includes:
[0174] The acquisition module 1201 is used to acquire basic information of at least one first target resource, including target search records and historical selections of target objects. The target search records include historical search records of each first target resource.
[0175] The determining module 1202 is used to determine auxiliary information for each first target resource based on the target search records. The auxiliary information for the first target resource includes at least one of the target search terms related to the first target resource and the specified information of the target search resource related to the target search terms.
[0176] The determination module 1202 is also used to determine the prediction result of each second target resource being recommended based on the basic information and auxiliary information of each first target resource;
[0177] The selection module 1203 is used to select a specified target resource from the various second target resources for recommendation based on the prediction results of the recommendations of each second target resource.
[0178] In one possible implementation, the determining module 1202 is used to input the basic information and auxiliary information of each first target resource into the resource recommendation model, and obtain the prediction result of each second target resource being recommended based on the resource recommendation model. The resource recommendation model is trained according to the training method of the resource recommendation model described above.
[0179] The aforementioned device determines auxiliary information for each first target resource based on target search records. This auxiliary information includes at least one of the following: target search terms related to the first target resource and specified information about the target search resource related to the target search terms. This enriches the information of the first target resource using at least one of the target search terms and target search resources. When determining the predicted recommendation result for each second target resource based on the basic and auxiliary information of each first target resource, the rich information in the first target resources leads to a higher predicted recommendation result for each second target resource. This results in higher accuracy when selecting a specified target resource for recommendation from among the second target resources based on the predicted recommendation results, thereby improving the quality of resource recommendations.
[0180] It should be understood that the above Figure 12 The provided device, in implementing its functions, is only illustrated by the division of the above-described functional modules. In practical applications, the functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation processes are detailed in the method embodiments, and will not be repeated here.
[0181] Figure 13 This diagram illustrates a structural block diagram of a terminal device 1300 provided in an exemplary embodiment of this application. The terminal device 1300 includes a processor 1301 and a memory 1302.
[0182] Processor 1301 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1301 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1301 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1301 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 1301 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0183] The memory 1302 may include one or more computer-readable storage media, which may be non-transitory. The memory 1302 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1302 are used to store at least one computer program, which is executed by the processor 1301 to implement the training method or resource recommendation method of the resource recommendation model provided in the method embodiments of this application.
[0184] In some embodiments, the terminal device 1300 may also optionally include: a peripheral device interface 1303 and at least one peripheral device. The processor 1301, memory 1302, and peripheral device interface 1303 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1303 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of: a radio frequency circuit 1304, a display screen 1305, a camera assembly 1306, an audio circuit 1307, and a power supply 1308.
[0185] Peripheral device interface 1303 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1301 and memory 1302. In some embodiments, processor 1301, memory 1302 and peripheral device interface 1303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1301, memory 1302 and peripheral device interface 1303 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0186] The radio frequency (RF) circuit 1304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1304 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1304 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 1304 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 1304 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1304 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0187] Display screen 1305 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 1305 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1301 for processing. In this case, display screen 1305 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, display screen 1305 may be a single screen, disposed on the front panel of terminal device 1300; in other embodiments, display screen 1305 may be at least two, disposed on different surfaces of terminal device 1300 or in a folded design; in still other embodiments, display screen 1305 may be a flexible display screen, disposed on a curved or folded surface of terminal device 1300. Furthermore, display screen 1305 may also be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen 1305 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0188] The camera assembly 1306 is used to acquire images or videos. Optionally, the camera assembly 1306 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 1306 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.
[0189] The audio circuit 1307 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to the processor 1301 for processing, or input to the radio frequency circuit 1304 to achieve voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each located at a different part of the terminal device 1300. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from the processor 1301 or the radio frequency circuit 1304 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 1307 may also include a headphone jack.
[0190] Power supply 1308 is used to supply power to the various components in terminal device 1300. Power supply 1308 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1308 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, and a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0191] In some embodiments, the terminal device 1300 further includes one or more sensors 1309. The one or more sensors 1309 include, but are not limited to: an acceleration sensor 1311, a gyroscope sensor 1312, a pressure sensor 1313, an optical sensor 1314, and a proximity sensor 1315.
[0192] Accelerometer 1311 can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by terminal device 1300. For example, accelerometer 1311 can be used to detect the components of gravitational acceleration along the three coordinate axes. Processor 1301 can control display screen 1305 to display the user interface in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 1311. Accelerometer 1311 can also be used for games or for acquiring user motion data.
[0193] The gyroscope sensor 1312 can detect the orientation and rotation angle of the terminal device 1300. The gyroscope sensor 1312 can work in conjunction with the accelerometer sensor 1311 to collect 3D motion data from the user on the terminal device 1300. Based on the data collected by the gyroscope sensor 1312, the processor 1301 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.
[0194] The pressure sensor 1313 can be disposed on the side bezel of the terminal device 1300 and / or on the lower layer of the display screen 1305. When the pressure sensor 1313 is disposed on the side bezel of the terminal device 1300, it can detect the user's grip signal on the terminal device 1300, and the processor 1301 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 1313. When the pressure sensor 1313 is disposed on the lower layer of the display screen 1305, the processor 1301 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 1305. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0195] Optical sensor 1314 is used to collect ambient light intensity. In one embodiment, processor 1301 can control the display brightness of display screen 1305 based on the ambient light intensity collected by optical sensor 1314. Specifically, when the ambient light intensity is high, the display brightness of display screen 1305 is increased; when the ambient light intensity is low, the display brightness of display screen 1305 is decreased. In another embodiment, processor 1301 can also dynamically adjust the shooting parameters of camera assembly 1306 based on the ambient light intensity collected by optical sensor 1314.
[0196] The proximity sensor 1315, also known as a distance sensor, is typically located on the front panel of the terminal device 1300. The proximity sensor 1315 is used to detect the distance between the user and the front of the terminal device 1300. In one embodiment, when the proximity sensor 1315 detects that the distance between the user and the front of the terminal device 1300 is gradually decreasing, the processor 1301 controls the display screen 1305 to switch from a screen-on state to a screen-off state; when the proximity sensor 1315 detects that the distance between the user and the front of the terminal device 1300 is gradually increasing, the processor 1301 controls the display screen 1305 to switch from a screen-off state to a screen-on state.
[0197] Those skilled in the art will understand that Figure 13 The structure shown does not constitute a limitation on the terminal device 1300, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0198] Figure 14This is a schematic diagram of the server structure provided in the embodiments of this application. The server 1400 can vary considerably due to different configurations or performance. It may include one or more processors 1401 and one or more memories 1402. The one or more memories 1402 store at least one computer program, which is loaded and executed by the one or more processors 1401 to implement the training method or resource recommendation method of the resource recommendation model provided in the above-described method embodiments. For example, the processor 1401 is a CPU. Of course, the server 1400 may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server 1400 may also include other components for implementing device functions, which will not be elaborated here.
[0199] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores at least one computer program, which is loaded and executed by a processor to enable an electronic device to implement the training method or resource recommendation method of any of the above-described resource recommendation models.
[0200] Optionally, the aforementioned computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.
[0201] In an exemplary embodiment, a computer program or computer program product is also provided, which stores at least one computer program, which is loaded and executed by a processor to enable an electronic device to implement the training method or resource recommendation method of any of the above-described resource recommendation models.
[0202] It should be understood that "multiple" as used in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0203] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0204] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A training method for a resource recommendation model, characterized in that, The method includes: The sample search record is obtained, along with basic information of at least one first sample resource and the annotation results of at least one second sample resource being recommended. The sample search record includes the historical search records of each first sample resource, and also includes multiple search terms and search resources corresponding to each search term. The first sample resource is the resource historically selected by the sample object, and one first sample is one search resource. For any first sample resource, based on the plurality of search terms and the search resources corresponding to each search term, determine the frequency of co-occurrence of the first sample resource with each search term; based on the frequency of co-occurrence of the first sample resource with each search term, determine at least one related search term for the first sample resource from the search terms; and determine at least one related search term for the first sample resource as auxiliary information for the first sample resource. For any related search term of any first sample resource, based on the plurality of search terms and the search resources corresponding to each search term, determine the frequency of co-occurrence of the related search term with each search resource; based on the frequency of co-occurrence of the first sample resource with each related search term of the first sample resource and the frequency of co-occurrence of each related search term of the first sample resource with each search resource, determine the frequency of co-occurrence of the first sample resource with each search resource; based on the frequency of co-occurrence of the first sample resource with each search resource, determine at least one related search resource of the first sample resource from the search resources; determine the specified information of the at least one related search resource of the first sample resource as the auxiliary information of the first sample resource, wherein the auxiliary information of the first sample resource includes at least one of the related search terms related to the first sample resource and the specified information of the related search resources related to the related search terms; For any first sample resource, the neural network model concatenates the basic features obtained by feature extraction of the basic information of the first sample resource and the auxiliary features obtained by feature extraction of the auxiliary information of the first sample resource to obtain the concatenated features corresponding to the first sample resource. The neural network model then fuses the concatenated features corresponding to each first sample resource to obtain the sequence features of the first sample resource sequence. Based on the sequence features of the first sample resource sequence, the prediction result of recommending each second sample resource is determined. Based on the prediction and annotation results of each of the second sample resources, a resource recommendation model is trained.
2. The method according to claim 1, characterized in that, Determining the predicted recommendation outcome for each second-sample resource also includes: For any first sample resource, based on at least one related search term of the first sample resource, construct a first graph structure corresponding to the first sample resource, wherein the nodes in the first graph structure corresponding to the first sample resource are the related search terms of the first sample resource. Based on the basic information of each first sample resource and the corresponding first graph structure, the prediction result for recommending each second sample resource is determined.
3. The method according to claim 1, characterized in that, Determining the predicted recommendation outcome for each second-sample resource also includes: For any first sample resource, based on the specified information of at least one related search resource of the first sample resource, a second graph structure corresponding to the first sample resource is determined, wherein the nodes in the second graph structure corresponding to the first sample resource are the specified information of the related search resource of the first sample resource. Based on the basic information of each first sample resource and the corresponding second graph structure, the prediction result for recommending each second sample resource is determined.
4. A resource recommendation method, characterized in that, The method applies the resource recommendation model described in any one of claims 1-3, and the method includes: Acquire basic information about at least one first target resource, including target search records and historical selections of target objects, wherein the target search records include historical search records for each first target resource; Based on the target search records, auxiliary information for each first target resource is determined. The auxiliary information for the first target resource includes at least one of the target search terms related to the first target resource and the specified information of the target search resource related to the target search terms. Based on the basic and auxiliary information of each first target resource, the prediction result for recommending each second target resource is determined; Based on the prediction results of the recommended second target resources, a specified target resource is selected from the recommended second target resources for recommendation.
5. An electronic device, characterized in that, The electronic device includes a processor and a memory, wherein the memory stores at least one computer program, which is loaded and executed by the processor to enable the electronic device to implement the training method of the resource recommendation model as described in any one of claims 1 to 3 or the resource recommendation method as described in claim 4.
Citation Information
Patent Citations
Recommendation model training method, recommendation method and related equipment
CN113254785A
Multimedia recommendation method and device, electronic equipment, and storage medium
CN113792163A