Resource recommendation method, device, equipment and computer readable storage medium
By measuring the tag richness and distribution balance of a resource set using a target measurement function, the problem that resource similarity is difficult to reflect diversity is solved, and the interaction rate of the resource set is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-03
- Publication Date
- 2026-03-31
AI Technical Summary
In existing technologies, when recommending resource sets based on resource similarity, it is difficult to reliably reflect the diversity of the resource sets, resulting in a low interaction rate.
A target performance evaluation function is used to comprehensively consider tag richness and resource distribution balance to measure the performance of resource sets and recommend target resource sets that meet the recommendation criteria.
It improves the diversity and interaction rate of resource sets, and recommends resource sets with higher diversity by comprehensively considering tag richness and resource distribution balance.
Smart Images

Figure CN116244491B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a resource recommendation method, apparatus, device, and computer-readable storage medium. Background Technology
[0002] With the development of computer technology, the application scenarios for resource recommendation are becoming increasingly diverse, such as recommending various resources like videos, audio, and articles. In some application scenarios, it is necessary to recommend resource sets that include multiple resources.
[0003] In related technologies, resource sets are recommended by considering resource similarity. However, resource similarity is not a reliable indicator of the diversity of resource sets, and resource sets recommended using this method tend to have low interaction rates. Summary of the Invention
[0004] This application provides a resource recommendation method, apparatus, device, and computer-readable storage medium, which can be used to improve the interaction rate of recommended resource sets. The technical solution is as follows:
[0005] On one hand, embodiments of this application provide a resource recommendation method, the method comprising:
[0006] Request resource recommendations;
[0007] In response to the resource recommendation request, based on the target evaluation function, a target resource set whose performance meets the recommendation conditions is determined, and the target resource set is recommended.
[0008] The target measurement function is used to measure the performance of the resource set. The performance of the resource set is characterized by label richness and resource distribution balance. The label richness is used to indicate the number of types of labels that a resource has, and the resource distribution balance is used to indicate the difference in the number of resources distributed on different types of labels.
[0009] On the other hand, a resource recommendation device is provided, the device comprising:
[0010] The acquisition unit is used to acquire resource recommendation requests;
[0011] The determining unit is configured to, in response to the resource recommendation request, determine the target resource set whose performance meets the recommendation conditions based on the target measurement function;
[0012] The recommendation unit is used to recommend the target resource set;
[0013] The target measurement function is used to measure the performance of the resource set. The performance of the resource set is characterized by label richness and resource distribution balance. The label richness is used to indicate the number of types of labels that a resource has, and the resource distribution balance is used to indicate the difference in the number of resources distributed on different types of labels.
[0014] In one possible implementation, the determining unit is configured to convert the target measurement function into a reference function with resource set index information as the independent variable, the resource set index information being used to index resource sets; solve the reference function according to the solution objective to obtain the values of the independent variables that satisfy the solution conditions; and use the resource set indexed according to the values of the independent variables that satisfy the solution conditions as the target resource set whose performance meets the recommendation conditions.
[0015] In one possible implementation, the values of the independent variables that satisfy the solution conditions are used to indicate the states corresponding to each candidate resource, and the state corresponding to any candidate resource is either hit or miss; the determining unit is further used to determine each candidate resource with a hit state based on the values of the independent variables that satisfy the solution conditions, and to use the set of each candidate resource with a hit state as the resource set indexed according to the values of the independent variables that satisfy the solution conditions.
[0016] In one possible implementation, the determining unit is configured to determine at least one first resource set; determine resource set performance measurement indicators corresponding to each first resource set based on the target measurement function; and select the first resource set corresponding to the resource set performance measurement indicators that meet the selection conditions as the target resource set whose resource set performance meets the recommended conditions.
[0017] In one possible implementation, the resource set performance metric corresponding to any first resource set is determined based on the probability corresponding to each candidate label under any first resource set, and the probability corresponding to any candidate label under any first resource set is the probability that at least two resources extracted from any first resource set have the candidate label.
[0018] In one possible implementation, the performance of the resource set is characterized based on the tag richness, the resource distribution balance, and the relevance. The target measurement function is constructed based on a first measurement function and a second measurement function. The first measurement function is used to measure the tag richness and the resource distribution balance, and the second measurement function is used to measure the relevance, which is the relevance of the interactive object corresponding to the resource recommendation request.
[0019] In one possible implementation, the performance of the resource set is characterized based on the tag richness, the resource distribution balance, and the resource similarity. The target measurement function is constructed based on a first measurement function and a third measurement function, wherein the first measurement function is used to measure the tag richness and the resource distribution balance, and the third measurement function is used to measure the resource similarity.
[0020] In one possible implementation, the performance of the resource set is characterized based on the tag richness, the resource distribution balance, relevance, and resource similarity. The target measurement function is constructed based on a first measurement function, a second measurement function, and a third measurement function. The first measurement function is used to measure the tag richness and the resource distribution balance, the second measurement function is used to measure the relevance, and the third measurement function is used to measure the resource similarity. The relevance is the relevance of the interactive object corresponding to the resource recommendation request.
[0021] In one possible implementation, the second measurement function is constructed based on the representational features of the interaction object. The acquisition unit is further configured to acquire a target graph structure with each candidate object and each candidate resource as nodes. The edges between nodes in the target graph structure are determined based on the target interaction information between each candidate object and each candidate resource. The target graph structure is then processed by a target graph neural network to obtain the representational features of the interaction object among the candidate objects.
[0022] In one possible implementation, the acquisition unit is further configured to acquire a sample graph structure with each sample object and each sample resource as nodes, wherein the edges between nodes in the sample graph structure are determined based on the sample interaction information between each sample object and each sample resource; process the sample graph structure by calling an initial graph neural network to obtain the initial features of each sample object and the initial features of each sample resource; based on the initial features of each sample object and the initial features of each sample resource, acquire the sub-loss corresponding to each benchmark pair, wherein each benchmark pair includes a sample object and an interacted sample resource and a non-interacted sample resource corresponding to the sample object; and train the initial graph neural network based on the sub-loss corresponding to each benchmark pair to obtain the target graph neural network.
[0023] In one possible implementation, the sub-loss corresponding to any benchmark pair is determined based on the difference between a first matching degree and a second matching degree, wherein the first matching degree is the matching degree between the initial features of the sample objects in the benchmark pair and the initial features of the interacted sample resources in the benchmark pair, and the second matching degree is the matching degree between the initial features of the sample objects in the benchmark pair and the initial features of the non-interacted sample resources in the benchmark pair.
[0024] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor to enable the computer device to implement any of the resource recommendation methods described above.
[0025] On the other hand, a computer-readable storage medium is also provided, wherein at least one computer program is stored therein, the at least one computer program being loaded and executed by a processor to enable a computer to implement any of the resource recommendation methods described above.
[0026] On the other hand, a computer program product is also provided, the computer program product including a computer program or computer instructions, the computer program or computer instructions being loaded and executed by a processor to enable a computer to implement any of the resource recommendation methods described above.
[0027] The technical solution provided in this application has at least the following beneficial effects:
[0028] The technical solution provided in this application comprehensively considers tag richness and resource distribution balance to recommend resource sets. Tag richness and resource distribution balance can reliably reflect the diversity of resource sets, thereby recommending resource sets with high diversity and improving the interaction rate of the recommended resource sets. Attached Figure Description
[0029] 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.
[0030] Figure 1 This is a schematic diagram of the implementation environment of a resource recommendation method provided in an embodiment of this application;
[0031] Figure 2 This is a flowchart of a resource recommendation method provided in an embodiment of this application;
[0032] Figure 3 This is a flowchart illustrating a method for determining a target resource set according to an embodiment of this application;
[0033] Figure 4 This is a flowchart illustrating a method for determining a target resource set according to an embodiment of this application;
[0034] Figure 5 This is a schematic diagram of a resource recommendation device provided in an embodiment of this application;
[0035] Figure 6 This is a schematic diagram of the structure of a server provided in an embodiment of this application;
[0036] Figure 7 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application. Detailed Implementation
[0037] 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.
[0038] This application provides a resource recommendation method. Please refer to the following embodiments. Figure 1 This diagram illustrates the implementation environment of the resource recommendation method provided in this embodiment. The implementation environment may include: terminal 11 and server 12.
[0039] Terminal 11 has an application or webpage installed that can display resources. Interactive objects can view the displayed resources within this application or webpage and can also interact with the displayed resources. The resources involved in this application embodiment refer to content that can be displayed to the interactive object. This application embodiment does not limit the type of resources; for example, the types of resources include, but are not limited to, videos, audio, and articles. Interaction between the interactive object and the resources can refer to the interactive object playing videos, playing audio, browsing articles, or liking, commenting on, forwarding, or collecting the resources. Terminal 11 can upload the interaction between the interactive object and the resources to server 12.
[0040] Server 12 provides background services for applications or web pages installed on the terminal that can display resources. Server 12 can collect information on the interaction between interactive objects and resources uploaded by terminal 11. In one possible implementation, server 12 undertakes the main computing work, and terminal 11 undertakes the secondary computing work; or, server 12 undertakes the secondary computing work, and terminal 11 undertakes the main computing work; or, server 12 and terminal 11 collaborate on computing using a distributed computing architecture.
[0041] The resource recommendation method provided in this application embodiment can be executed by terminal 11 or server 12, and this application embodiment does not limit it in this way.
[0042] In one possible implementation, terminal 11 can be any electronic product capable of human-computer interaction with an interactive object through one or more methods such as a keyboard, touchpad, touchscreen, remote control, voice interaction, or handwriting device. Examples include PCs (Personal Computers), mobile phones, smartphones, PDAs (Personal Digital Assistants), wearable devices, PPCs (Pocket PCs), tablets, smart car systems, smart TVs, smart speakers, and in-vehicle terminals. Server 12 can be a single server, a server cluster consisting of multiple servers, or a cloud computing service center. Terminal 11 and server 12 establish a communication connection via wired or wireless network.
[0043] Those skilled in the art should understand that the above-described terminal 11 and server 12 are merely examples. Other existing or future terminals or servers that are applicable to this application should also be included within the scope of protection of this application, and are hereby incorporated by reference.
[0044] Based on the above Figure 1 The implementation environment shown in this application embodiment provides a resource recommendation method. This method is applied to a computer device, which can be a server 12 or a terminal 11. This application embodiment uses the application of this method to a server 12 as an example for illustration. Figure 2 As shown, the resource recommendation method provided in this application embodiment includes the following steps 201 and 202.
[0045] In step 201, a resource recommendation request is obtained.
[0046] The resource recommendation method provided in this application recommends a resource set. The process of recommending a resource set is triggered by a resource recommendation request. Therefore, before recommending a resource set, it is necessary to obtain the resource recommendation request first. The resource recommendation request is used to request a recommended resource set. The resource set recommendation request can be obtained by the terminal and sent to the server, or it can be obtained by the server itself. This application does not limit this.
[0047] In one possible implementation, a resource recommendation request refers to a resource recommendation request from an interactive object. That is, a resource recommendation request corresponds to an interactive object, and the request is used to request a set of recommended resources for that interactive object. For example, the resource recommendation request is obtained by the interactive object's terminal and sent to the server. In other words, the server obtains the resource recommendation request by receiving it from the interactive object's terminal.
[0048] This application does not limit the method by which the terminal of the interactive object obtains the resource recommendation request. In an exemplary embodiment, the application or webpage installed on the terminal of the interactive object that can display resources displays an entry point for viewing recommended resources. When the terminal of the interactive object detects a trigger operation by the interactive object on the entry point for viewing recommended resources, it obtains the resource recommendation request. For example, the entry point for viewing recommended resources can be a button or a triggerable icon, etc.
[0049] In an exemplary embodiment, the terminal of the interactive object has an application or webpage that displays resources and displays a resource refresh control. The terminal of the interactive object responds to the interactive object's trigger operation on the resource refresh control and obtains a resource recommendation request.
[0050] In an exemplary embodiment, in response to the interactive object opening an application or webpage capable of displaying resources, the interactive object's terminal obtains a resource recommendation request.
[0051] In another possible implementation, the resource recommendation request can also be obtained by the server itself. For example, the server obtains a resource recommendation request when the time interval between the current time and the last time a resource set was recommended for the interacting object reaches a reference interval. The reference interval is set based on experience or can be flexibly adjusted according to the application scenario; this embodiment does not limit this, for example, the reference interval is 3 minutes.
[0052] In step 202, in response to the resource recommendation request, a target resource set whose performance meets the recommendation conditions is determined based on the target measurement function, and the target resource set is recommended; wherein, the target measurement function is used to measure the performance of the resource set, and the performance of the resource set is characterized based on tag richness and resource distribution balance.
[0053] Among them, tag richness is used to indicate the number of types of tags a resource has, and resource distribution balance is used to indicate the difference in the number of resources distributed on different types of tags.
[0054] Upon receiving a resource recommendation request, in response to the request, a target resource set whose performance meets the recommendation criteria is determined, and then that target resource set is recommended. For example, if the resource recommendation request refers to a resource recommendation request from an interactive object, then recommending that target resource set means recommending that target resource set to the interactive object.
[0055] For example, the target resource set is a subset of the candidate resource set. The candidate resource set refers to a collection of candidate resources, which are currently available for recommendation. This application does not limit the method for determining the candidate resource set; the number of candidate resources in the set may vary depending on the method used. It should be noted that the candidate resources in the set can be of the same type or different types, depending on the functionality of the application or webpage that displays the resources; this application does not limit this aspect.
[0056] In an exemplary embodiment, each resource is generated and published to the server by the publisher, and the time when each resource is published to the server is taken as the publication time of each resource. In one possible implementation, the candidate resource set is determined by selecting the set of resources whose publication times fall within a reference time range. The reference time range is set based on experience or can be flexibly adjusted according to the application scenario; this embodiment does not limit this. For example, the reference time range is the time range from a first time to the current time. The first time can refer to the historical time when a resource set was last recommended to the interactive object, or it can refer to a historical time with a specified interval from the current time, etc.
[0057] In another possible implementation, the candidate resource set is determined by including resources whose release time falls within a reference time range and that meet quality screening criteria. The quality screening criteria are used to filter out resources of poor quality. For example, meeting the quality screening criteria means that the content of the resource is highly credible or conveys a positive attitude. For example, for video resources, meeting the quality screening criteria could mean that the video's clarity is not lower than a clarity threshold. For example, for audio resources, meeting the quality screening criteria could mean that the noise interference level in the audio is not greater than an interference threshold.
[0058] Each candidate resource in the candidate resource set has one or more tags. These tags describe the candidate resource; for example, they might describe the category, source, or theme of its content. For instance, a video tutorial on making food might have tags like "food" and "tutorial," while a video introducing electronic product A might have tags like "electronic product A" and "high-tech." The tags on candidate resources can be self-assigned by the publisher or assigned by the server; this embodiment does not limit this. In an exemplary embodiment, the server can tag resources interacted with by more than a first number of objects as "popular" and resources interacted with by fewer than a second number of objects as "unpopular." The second number is less than the first number. The values of the first and second numbers are set empirically or flexibly adjusted according to the application scenario.
[0059] For example, the unique tags shared by candidate resources in the candidate resource set are used as candidate tags. The number of candidate tags depends on the specific circumstances of the candidate resource set, and this embodiment does not limit this. For example, the set of candidate tags can be denoted as P, and the expression for P is: Where s (where s is an integer not less than 1) represents the number of candidate tags. Each of these represents a candidate label. The label information for each candidate resource can be described using a label vector. For example, the label information for candidate resource g can be represented by label vector Y. g =[Y g1 ,Y g2 ,…,Y gs ] indicates that Y g1 ,Y g2 ,…,Y gs Each element represents a vector element, and the value of each element is determined by whether the candidate resource g has a corresponding label. For example, if the candidate resource g has the label p... l ( l If s is an integer not less than 1 and not greater than s, then vector Y g Vector element Y gl =1, if candidate resource g does not have label p l Then Y gl =0.
[0060] In this embodiment, the process of determining the target resource set whose performance meets the recommended conditions is based on a target measurement function. The target measurement function measures the performance of the resource set based on tag richness and resource distribution balance. Tag richness indicates the number of tag types a resource has; a higher tag richness indicates more tag types, and a lower tag richness indicates fewer tag types.
[0061] Resource distribution balance is used to indicate the difference in the quantity of resources distributed across different labels. It should be noted that resources distributed across a label refer to resources that possess that label. A higher resource distribution balance for a resource set indicates a smaller difference in the quantity of resources distributed across different labels, meaning a more balanced distribution of resources across different labels within that resource set. Conversely, a lower resource distribution balance for a resource set indicates a larger difference in the quantity of resources distributed across different labels, meaning a more uneven distribution of resources across different labels within that resource set.
[0062] Since tag richness and resource distribution balance can reliably reflect the diversity of resource sets, comprehensively considering these two factors helps to recommend resource sets with higher diversity, thereby increasing the interaction rate of the recommended resource sets. This resource recommendation method can be seen as a method determined by considering the meaning of diversity itself. Because maintaining high tag richness and high resource distribution balance is considered a truly reliable form of diversity recommendation, it can effectively improve the diversity of the recommended resource sets. Based on this approach, it is beneficial to provide more equitable and diverse recommendation results.
[0063] For example, in the process of recommending resource sets, only tag richness and resource distribution balance can be considered, or at least one of relevance and resource similarity can be considered in addition to tag richness and resource distribution balance. Relevance refers to the relevance of the interactive object corresponding to the resource recommendation request. That is, the performance of the resource set can be characterized solely based on tag richness and resource distribution balance, or it can be characterized based on at least one of relevance and resource similarity, as well as tag richness and resource distribution balance; this embodiment of the application does not limit this. Resource set performance based on multiple performance characteristics has higher reliability, which is beneficial to improving the quality of the recommended resource set and thus increasing the interaction rate.
[0064] The higher the relevance of a resource set, the more relevant it is to the interactive object; conversely, the lower the relevance, the less relevant it is to the interactive object. By considering relevance, resource sets that are relevant to the interactive object can be recommended, thereby further improving the interaction rate of resource sets.
[0065] The higher the resource similarity of a resource set, the more similar the resources within that set are; conversely, the lower the resource similarity, the less similar the resources within that set are. By considering resource similarity, we can recommend resource sets with greater differences between them, thereby increasing the diversity of resource sets and ultimately improving their interaction rate.
[0066] In an exemplary embodiment, tag richness and resource distribution balance are measured using a first measurement function, relevance is measured using a second measurement function, and resource similarity is measured using a third measurement function. The first, second, and third measurement functions will be described below.
[0067] The first measurement function is used to measure tag richness and resource distribution balance. The first measurement function is a function with resource sets as independent variables and a first measurement metric as dependent variable. Based on the first measurement function, the first measurement metric corresponding to each resource set can be determined. For example, the first measurement function is used to determine the first measurement metric corresponding to a resource set based on the probability corresponding to each candidate tag within that resource set. The probability of a candidate tag within a resource set is the probability that at least two resources extracted from that resource set possess that candidate tag.
[0068] The first metric for a resource set, determined by the probability of each candidate tag in a resource set, can measure the diversity of the resource set from the perspective of tag richness and resource distribution balance. Based on the first metric function, it is helpful to recommend resource sets that meet the expected diversity requirements of large tag richness and large resource distribution balance.
[0069] The first measurement function can be viewed as a function constructed based on the Simpson diversity index, which describes the probability that individuals obtained from two consecutive samplings from a community belong to the same species. The Simpson diversity index takes into account both species richness (the number of species in the community) and relative abundance of species (the number of individuals of each species) to measure the diversity of individuals in the community.
[0070] A first metric corresponding to a resource set is used to measure the overall performance of the tag richness and resource distribution balance of the resource set. This application does not limit the method of using the first metric corresponding to a resource set to measure the overall performance of the tag richness and resource distribution balance of the resource set. For example, the larger the first metric corresponding to a resource set, the better the overall performance of the tag richness and resource distribution balance of the resource set; conversely, the smaller the first metric corresponding to a resource set, the better the overall performance of the tag richness and resource distribution balance of the resource set.
[0071] The embodiments of this application do not limit the method of determining the first metric corresponding to a resource set based on the probability of each candidate tag in a resource set. The expression of the first metric function is different under different methods.
[0072] In one possible implementation, the first metric for a resource set is determined based on the probabilities of each candidate tag within that resource set. This is achieved by using the sum of the probabilities of each candidate tag within the resource set as the first metric. In other words, the first metric for a resource set is the sum of the probabilities of each candidate tag within that resource set. For example, since the probability of a candidate tag within a resource set is the probability that at least two resources extracted from that resource set possess that candidate tag, the sum of the probabilities of each candidate tag within a resource set can be considered as the probability that at least two resources extracted from that resource set have the same tag. It should be noted that the number of resources extracted can be flexibly set. For example, two resources may be extracted, or three resources may be extracted. For example, at least two resources may be extracted randomly. This application embodiment uses the example of randomly extracting two resources for illustration.
[0073] For example, the first measurement function is denoted as When the sum of the probabilities of each candidate tag within a resource set is used as the primary metric for that resource set, The expression is shown in Formula 1:
[0074] (Formula 1)
[0075] in, Represents an unknown set of resources; This represents a known set of candidate resources; This indicates the resource collection It is a candidate resource set A subset of; Indicates in resource set At least two resources extracted from the sample must have candidate tags. The probability of the candidate label In resource collection The corresponding probabilities are as follows, where, That is to say Let be a candidate label in the set P of candidate labels; The value represents the resource set. The corresponding primary metric.
[0076] For example, in the case of randomly selecting two resources, The expression is shown in Formula 2:
[0077] (Formula 2)
[0078] in, Represents resource set The number of resources in the set; i and j represent the resource set The identifier of a resource in the resource set, for example. The resource identifier in the code is the resource label. Different resources have different labels of different sizes. The relationship between the sizes of i and j is as follows: ; Used to indicate resource sets Does the resource labeled i have a candidate label p? Used to indicate resource sets Does the resource labeled j have candidate label p? The value is determined based on the resource set. Whether resources labeled i and j in the resource set both have candidate labels p is determined. If both resource i and resource j have candidate label p, then... The value of is 1, if the resource set If neither resource labeled i nor resource j has a candidate label p, then... The value of is 0.
[0079] According to Formula 2 above, the calculation can be performed from the resource set. The probability that two randomly selected resources in the set both have candidate label p, that is, Formula 2 above can reflect the probability that the resource set has candidate label p. The size of the proportion of resources with candidate tag p.
[0080] In one possible implementation, the first metric for a resource set is determined based on the probabilities of each candidate label within that resource set. This is achieved by using the weights associated with each candidate label and summing the probabilities of each candidate label within the resource set. In other words, the first metric for a resource set is obtained by summing the probabilities of each candidate label within the resource set using the weights associated with each candidate label. In this case, the expression for the first metric function is shown in Equation 3.
[0081] (Formula 3)
[0082] in, Indicates candidate tags The corresponding weights; see Formula 1 for the meaning of other parameters.
[0083] The weight corresponding to a candidate label reflects its importance to the overall performance of measuring the label richness and resource distribution balance of the resource set. It can also represent the proportion of label richness and resource distribution balance provided by the candidate label. Different candidate labels may have different levels of importance to the overall performance of measuring the label richness and resource distribution balance of the resource set. The first metric obtained by weighted summation provides a more reliable measure of the overall performance of label richness and resource distribution balance.
[0084] The weights corresponding to candidate labels can be set based on experience or adjusted flexibly according to the application scenario; this application embodiment does not limit this. For example, different candidate labels have different weights.
[0085] In an exemplary embodiment, the weight corresponding to a candidate label is the ratio of the first parameter and the second parameter corresponding to that candidate label. For example, the first parameter corresponding to a candidate label is set empirically or flexibly adjusted according to the application scenario. For example, the second parameter corresponding to a candidate label is the probability that at least two resources extracted from the candidate resource set possess that candidate label. The second parameter corresponding to a candidate label can be calculated by substituting the value of the candidate resource set as the independent variable into Formula 2. In this case, the expression of the first measurement function is as shown in Formula 4:
[0086] (Formula 4)
[0087] in, Indicates candidate tags The corresponding first parameter; Indicates candidate tags The corresponding second parameter, Able to pass candidate resource sets The values of the independent variables are substituted into Formula 2 for calculation. The meanings of other parameters are given in Formulas 1 and 3.
[0088] For example, the first parameter corresponding to a candidate label is determined based on the number of resources in the reference resource set and the number of resources distributed on the reference label within the reference resource set. The reference label is the label with the most distributed resources in the reference resource set. The reference resource set is set empirically; for example, it is a subset selected empirically from various subsets of the candidate resource set. For example, the reference resource set refers to the subset of the candidate resource set with the highest relevance to the interactive object. The reference resource set does not change with the resource set to be measured. In this case, since the process of calculating the first parameter corresponding to a candidate label is independent of the candidate label itself, the first parameter corresponding to different candidate labels is the same.
[0089] The method for determining the first parameter corresponding to a candidate label based on the number of resources in the reference resource set and the number of resources distributed on the reference label can be set empirically or flexibly adjusted according to the application scenario. For example, the method for determining the first parameter corresponding to a candidate label based on the number of resources in the reference resource set and the number of resources distributed on the reference label is determined based on Formula 5:
[0090] (Formula 5)
[0091] in, This represents the first parameter corresponding to the candidate label p; Indicates reference resource set The quantity of resources in; Indicates reference resource set The number of resources distributed on the reference label.
[0092] It should be noted that the method of determining the first parameter corresponding to a candidate label based on Formula 5 is only an exemplary description. The embodiments of this application are not limited to this, and the first parameter corresponding to a candidate label can also be determined based on other forms.
[0093] It should be noted that, for cases where the expression of the first measurement function is Formula 1, Formula 3, or Formula 4, the smaller the first measurement index corresponding to the resource set calculated according to the first measurement function, the better the overall performance of the resource set in terms of tag richness and resource distribution balance.
[0094] The second measurement function is used to measure relevance. The second measurement function is a function with the resource set as the independent variable and the second measurement index as the dependent variable. Based on the second measurement function, a second measurement index corresponding to a resource set can be calculated, so that the relevance of that resource set can be measured using the second measurement index corresponding to that resource set. It should be noted that the relevance involved in the embodiments of this application refers to the relevance to the interactive object corresponding to the resource recommendation request.
[0095] This application does not limit the method of measuring the relevance of a resource set using a second metric corresponding to the resource set. For example, the larger the second metric corresponding to a resource set, the greater the relevance of the resource set; or, the smaller the second metric corresponding to a resource set, the greater the relevance of the resource set.
[0096] In one possible implementation, the second measurement function is constructed based on the representational features of the interaction object. The representational features of the interaction object are used to represent the interaction object. The embodiments of this application do not limit the representational features of the interaction object. For example, the representational features of the interaction object are represented by a d-dimensional column vector (d is an integer not less than 1), or the representational features of the interaction object are represented by a d-dimensional row vector, etc.
[0097] In an exemplary embodiment, the second measurement function is used to calculate a second measurement metric corresponding to a resource set by calculating the matching degree between the representational features of the interactive object and the representational features of each resource in the resource set. The representational features of the resources are used to characterize the resources. Exemplarily, the second measurement function is denoted as... , The expression is shown in Formula 6:
[0098] (Formula 6)
[0099] in, The representational characteristics of the interactive object u are predetermined known parameters; Represents resource set The characteristic of resource i in the table is an unknown parameter that changes with the resource set; T represents the transpose. The value represents the resource set. The corresponding second metric. When the second metric is expressed using the formula shown in Equation 6, the larger the second metric for a resource set, the greater the relevance of the resource set.
[0100] Before constructing the second measurement function, it is necessary to obtain the representational features of the interactive object. This application does not limit the method for obtaining the representational features of the interactive object. In one possible implementation, the representational features of the interactive object can be determined by analyzing the historical interaction data of the interactive object.
[0101] In another possible implementation, the representational features of the interactive object can also be obtained by invoking the target graph neural network. For example, the interactive object is one of at least one candidate object, where at least one candidate object refers to objects considered together during the process of invoking the target graph neural network to obtain the representational features of the interactive object. For example, at least one candidate object refers to each object that has registered an account in an application or webpage providing services on the server; for example, at least one candidate object refers to each object among those that have registered an account and has interacted with at least one resource displayed in the application or webpage.
[0102] For example, the process of calling the target graph neural network to obtain the representation features of the interactive objects includes: obtaining the target graph structure with each candidate object and each candidate resource as nodes, and the edges between the nodes in the target graph structure are determined according to the target interaction information between each candidate object and each candidate resource; calling the target graph neural network to process the target graph structure to obtain the representation features of the interactive objects in each candidate object.
[0103] Target interaction information is used to indicate the interaction between each candidate object and each candidate resource. For example, the target interaction information is an N×M matrix R, where N (N is an integer not less than 1) is the number of candidate objects, and M (M is an integer not less than 1) is the number of candidate resources. The target interaction information consists of N×M matrix elements, each indicating the interaction between a candidate object and a candidate resource. If there is an interaction between the candidate object and the candidate resource, the matrix element takes a first value; if there is no interaction, the matrix element takes a second value. The first and second values are set empirically or flexibly adjusted according to the application scenario; for example, the first value is 1, and the second value is 0.
[0104] This application does not limit the method for determining whether there is an interaction between a candidate object and a candidate resource. For example, if a candidate object has completely viewed a candidate resource, it is considered that there is an interaction between the candidate object and the candidate resource; or, if a candidate object has performed an interaction operation while viewing a candidate resource, it is considered that there is an interaction between the candidate object and the candidate resource. For example, interaction operations include but are not limited to liking, collecting, sharing, commenting, etc.
[0105] For example, let U be the set of all candidate objects and I be the set of all candidate resources. Then, for the candidate object labeled u in set U (which can be denoted as I), ) and the candidate resource labeled i in set I (which can be denoted as ) The target interaction information contains a matrix element that indicates the interaction between the candidate object labeled u and the candidate resource labeled i. For example, if there is an interaction between the candidate object labeled u and the candidate resource labeled i, then If there is no interaction between the candidate object labeled u and the candidate resource labeled i, then .
[0106] By treating each candidate object and each candidate resource as nodes in the target graph structure, the edges between nodes in the target graph structure can be determined based on the target interaction information. For example, if the target interaction information indicates that there is an interaction between a candidate object and a candidate resource, then there is an edge between the node corresponding to the candidate object and the node corresponding to the candidate resource; if the target interaction information indicates that there is no interaction between a candidate object and a candidate resource, then there is no edge between the node corresponding to the candidate object and the node corresponding to the candidate resource.
[0107] After obtaining the target graph structure, a target graph neural network is invoked to process it. The target graph neural network is used to obtain the representational features of nodes by aggregating information surrounding them. Since the nodes in the target graph structure represent candidate objects and candidate resources, the target graph neural network can obtain the representational features of each candidate object and each candidate resource. For example, the representational features of both candidate objects and candidate resources are represented using an embedding vector of the same dimension; therefore, the representational features of each candidate object and each candidate resource can be denoted as... , Where d represents the dimension of each embedding vector, Each represents a characteristic feature of a candidate object. Each of these represents a characteristic of a candidate resource, and each characteristic is a d-dimensional column vector.
[0108] In an exemplary embodiment, after obtaining the representational features of each candidate object and the representational features of each candidate resource, the representational features of each candidate object and the representational features of each candidate resource are stored, and then when it is necessary to utilize the representational features of the interaction object, the representational features of the interaction object are extracted from the storage.
[0109] The embodiments of this application do not limit the structure of the target graph neural network, as long as it has the function of processing the graph structure composed of nodes and edges to extract the features of the nodes. For example, the structure of the target graph neural network is a graph convolutional network (GCN), a graph attention network, etc.
[0110] The process of calling the target graph neural network to process the target graph structure is an internal processing procedure of the target graph neural network, and this application embodiment does not limit it. Exemplarily, the target graph neural network includes at least one feature extraction layer connected in sequence. Each feature extraction layer is used to update the features of the input node once by aggregating information around the node, and outputs the updated features of the node. The features output by the last feature extraction layer are the representation features of each node. The information around the node is determined by the target graph structure.
[0111] For example, the processing logic inside each feature extraction layer can be denoted as E, and the expression for E is shown in Equation 7:
[0112] (Formula 7)
[0113] Here, AGG() represents the aggregation function, used to update the features of a node by aggregating information about its surroundings; A represents the adjoint matrix, which includes matrix elements indicating the edge relationships between nodes. A is a square matrix of size (N+M)×(N+M). For example, if there is an edge between two nodes, the matrix element indicating the edge relationship between those two nodes has a first value (e.g., 1); if there is no edge between two nodes, the matrix element indicating the edge relationship between those two nodes has a second value (e.g., 0). The adjoint matrix A can be obtained from the matrix R corresponding to the target interaction information. The relationship between A and R is as follows: D represents the degree matrix. D is a diagonal matrix, and the diagonal elements in D indicate the number of edges connected to each node. This represents the adjoint matrix after regularization.
[0114] In an exemplary embodiment, the target graph neural network is obtained by training an initial graph neural network to ensure its feature extraction performance. Before invoking the target graph neural network to process the target graph structure, it needs to be trained first. In one possible implementation, the process of training the target graph neural network includes steps 1 to 3.
[0115] Step 1: Obtain the sample graph structure with each sample object and each sample resource as nodes. The edges between nodes in the sample graph structure are determined based on the sample interaction information between each sample object and each sample resource.
[0116] Each sample object and each sample resource refers to the objects and resources considered during the training of the initial graph neural network. The sample objects and each sample resource can be flexibly defined, as long as the interaction between each sample object and each sample resource is known. For example, each sample object can refer to the aforementioned candidate objects, and each sample resource can refer to the aforementioned candidate resources.
[0117] Sample interaction information is used to indicate the interaction between each sample object and each sample resource. Based on the sample interaction information, the edge situation in the sample graph structure can be determined. For example, each sample object refers to the aforementioned candidate objects, each sample resource refers to the aforementioned candidate resources, the sample interaction information is the aforementioned target interaction information, and the sample graph structure is the aforementioned target graph structure.
[0118] Step 2: Call the initial graph neural network to process the sample graph structure and obtain the initial features of each sample object and the initial features of each sample resource.
[0119] The implementation process of step 2 is described above in the process of obtaining the characterization features of each candidate object and each candidate resource, and will not be repeated here.
[0120] Step 3: Based on the initial features of each sample object and the initial features of each sample resource, obtain the sub-loss corresponding to each benchmark pair, and train the initial graph neural network based on the sub-loss corresponding to each benchmark pair to obtain the target graph neural network.
[0121] Each benchmark pair includes a sample object, an interacted sample resource, and a non-interacted sample resource corresponding to the sample object.
[0122] Each benchmark pair includes one or more benchmark pairs corresponding to each sample object. The setting method of the benchmark pair corresponding to a sample object is based on experience or can be flexibly adjusted according to the application scenario. This application embodiment does not limit this.
[0123] For example, the baseline pair corresponding to a sample object is set as follows: a reference number of baseline pairs is set for a sample object, where the reference number is the minimum of the number of interacted sample resources and the number of non-interacted sample resources corresponding to that sample object. The interacted sample resources corresponding to a sample object refer to those sample resources that have interacted with that sample object, and the non-interacted resources corresponding to a sample object refer to those sample resources that have not interacted with that sample object. The interacted and non-interacted sample resources corresponding to a sample object can be determined based on sample interaction information.
[0124] Taking the reference number as the number of interacted sample resources corresponding to a single sample object as an example, the specific process of setting a reference number of benchmark pairs for a sample object includes: allocating the interacted sample resources corresponding to the single sample object to different benchmark pairs; then selecting a reference number of non-interacted sample resources from the non-interacted sample resources corresponding to the single sample object, allocating these reference number of non-interacted sample resources to different benchmark pairs, and then obtaining the reference number of benchmark pairs corresponding to the single sample object by adding the single sample object to each benchmark pair. The principle of setting a reference number of benchmark pairs for a single sample object when the reference number is the number of non-interacted sample resources corresponding to the single sample object is the same as the principle of setting a reference number of benchmark pairs for a single sample object when the reference number is the number of interacted sample resources corresponding to the single sample object, and will not be elaborated further here.
[0125] The sub-loss corresponding to any benchmark pair represents the difference between the degree of interest of a sample object in that benchmark pair in the interacted sample resources of that benchmark pair and the degree of interest of a sample object in that benchmark pair in the non-interacted sample resources of that benchmark pair. The sub-loss corresponding to any benchmark pair is obtained based on the initial features of the sample objects in that benchmark pair, the initial features of the interacted sample resources in that benchmark pair, and the initial features of the non-interacted sample resources in that benchmark pair. The initial features of the sample objects in that benchmark pair can be extracted from the initial features of each sample object, and the initial features of the interacted and non-interacted sample resources in that benchmark pair can be extracted from the initial features of each sample resource.
[0126] In an exemplary embodiment, the sub-loss corresponding to any benchmark pair is determined based on the difference between a first matching degree and a second matching degree. The first matching degree is the matching degree between the initial features of the sample objects in any benchmark pair and the initial features of the interacting sample resources in any benchmark pair, and the second matching degree is the matching degree between the initial features of the sample objects in any benchmark pair and the initial features of the non-interacting sample resources in any benchmark pair.
[0127] In one possible implementation, the initial features of the sample objects in any benchmark pair and the initial features of the interacted sample resources in that benchmark pair are both represented using vectors of the same dimension. The first matching degree is calculated as the product of the transpose of the initial features of the sample objects in any benchmark pair and the initial features of the interacted sample resources in that benchmark pair. The calculation principle for the second matching degree is the same as that for the first matching degree, and will not be elaborated here.
[0128] After determining the first and second matching degrees, a sub-loss corresponding to any benchmark pair is determined based on the difference between the first and second matching degrees. For example, the difference between the first and second matching degrees is used as the sub-loss corresponding to any benchmark pair. For example, the logarithm of the difference between the first and second matching degrees is taken to obtain the sub-loss corresponding to any benchmark pair.
[0129] After obtaining the sub-losses corresponding to each benchmark pair, the initial graph neural network is trained based on the sub-losses corresponding to each benchmark pair. For example, the process of training the initial graph neural network based on the sub-losses corresponding to each benchmark pair is as follows: based on the sub-losses corresponding to each benchmark pair, obtain the target loss, and use the target loss to train the initial graph neural network.
[0130] For example, the target loss is obtained based on the sub-losses corresponding to each benchmark pair as follows: the sub-losses corresponding to each benchmark pair are summed to obtain the first loss, and the negative of the first loss is taken as the target loss. For example, the target loss is calculated based on Formula 8:
[0131] (Formula 8)
[0132] in, Indicates target loss; This represents a benchmark pair, where u represents a sample object in the benchmark pair, i represents an interacted sample resource in the benchmark pair, and j represents an uninteracted sample resource in the benchmark pair. Represents the set of all reference pairs. It can be represented as , This indicates that the sample object represented by u and the sample resource represented by i have already interacted. This indicates that the sample object represented by u and the sample resource represented by j have not interacted. This represents the degree of matching between the initial features of the sample object represented by u and the initial features of the sample resource represented by i. The calculation formula is: , This represents the initial features of the sample object represented by u. Let i represent the initial characteristics of the sample resource, and T represent the transpose. This represents the degree of matching between the initial features of the sample object represented by u and the initial features of the sample resource represented by j. The calculation formula is: , This represents the initial characteristics of the sample resource represented by j; Indicates reference pair The corresponding sub-loss.
[0133] For example, It can be used to represent the degree of interest of the sample object represented by u in the sample resource represented by i, that is, how much interest the sample object represented by u has in the sample resource represented by i. The larger the value, the higher the degree of interest of the sample object represented by u in the sample resource represented by i. For example, It can also be used to represent the correlation between the sample resource represented by i and the sample object represented by u. The larger the value, the higher the correlation between the sample resource represented by i and the sample object represented by u.
[0134] For example, the process of training an initial graph neural network using the target loss is as follows: the parameters of the initial graph neural network are updated backward using the target loss. For example, the method for updating the parameters of the initial graph neural network using the target loss can be gradient descent.
[0135] The process of training the target graph neural network is an iterative training process. Each time the initial graph neural network is trained using the target loss, it is determined whether the trained graph neural network meets the training termination condition. If the trained graph neural network meets the training termination condition, it is used as the target graph neural network. If the trained graph neural network does not meet the training termination condition, the target loss is re-acquired using steps 1 to 3, and the graph neural network is trained again using the re-acquired target loss. This process is repeated until a graph neural network that meets the training termination condition is obtained, and this graph neural network that meets the training termination condition is used as the target graph neural network.
[0136] The training termination conditions can be set based on experience or flexibly adjusted according to the application scenario, and this application embodiment does not limit them. For example, the training termination conditions of the graph neural network include, but are not limited to, any one of the following: the target loss calculated by the graph neural network is less than the loss threshold, the target loss calculated by the graph neural network converges, or the number of training iterations performed when acquiring the graph neural network reaches the threshold.
[0137] The third measurement function is used to measure resource similarity. The third measurement function is a function with resource set as the independent variable and a third measurement index as the dependent variable. The third measurement function is used to measure the resource similarity of a resource set using the third measurement index corresponding to that resource set. For example, the third measurement index corresponding to a resource set is calculated based on the resource similarity of that resource set. The third measurement index corresponding to a resource set can be negatively correlated with the resource similarity of that resource set, or it can be positively correlated with the resource similarity of that resource set. This application embodiment does not limit this. The expression of the third measurement function can be flexibly set according to the relationship between the third measurement index corresponding to a resource set and the resource similarity of that resource set; this application embodiment does not limit this.
[0138] The resource similarity of a resource set is determined based on the similarity between every two resources in the set. For example, the resource similarity of a resource set refers to the average similarity between every two resources in the set. This application does not limit the method of calculating the similarity between two resources. For example, two resources are converted into vector form, and the cosine similarity between the vectors corresponding to the two resources is used as the similarity between the two resources.
[0139] The above content provides an introduction to the first, second, and third performance metrics. The relationship between the target performance metrics and these metrics varies depending on the performance of the resource set.
[0140] In an exemplary embodiment, resource set performance is characterized solely based on tag richness and resource distribution balance. In this case, the objective metric is the first metric. The first metric is used to measure tag richness and resource distribution balance.
[0141] In an exemplary embodiment, resource set performance is characterized based on tag richness, resource distribution balance, and relevance. In this case, the target performance function is constructed based on a first performance function and a second performance function. The second performance function is used to measure relevance.
[0142] In an exemplary embodiment, resource set performance is characterized based on tag richness, resource distribution balance, and resource similarity. In this case, the target performance function is constructed based on a first performance function and a third performance function. The third performance function is used to measure resource similarity.
[0143] In an exemplary embodiment, the performance of the resource set is characterized based on tag richness, resource distribution balance, relevance, and resource similarity. In this case, the target performance function is constructed based on a first performance function, a second performance function, and a third performance function.
[0144] It should be noted that when the target performance indicator is constructed from multiple performance indicators, it is necessary to ensure that the target performance indicator can accurately measure the performance of the resource set. For example, based on the target performance indicator, a performance indicator for a resource set can be calculated, and this indicator can accurately measure the performance of that resource set. For example, a larger performance indicator for a resource set indicates better performance; conversely, a smaller performance indicator indicates better performance.
[0145] For example, consider a target performance function constructed based on the first and second performance functions. Since a better overall performance in terms of tag richness and resource distribution balance, coupled with higher relevance, indicates better resource set performance, the method of constructing the target performance function based on the first and second performance functions is related to the method of using the first performance indicator corresponding to a resource set to measure the overall performance of its tag richness and resource distribution balance, and the method of using the second performance indicator corresponding to a resource set to measure its relevance.
[0146] For example, the target measurement function is denoted as If the smaller the first metric corresponding to a resource set, the better the overall performance of the resource set in terms of tag richness and resource distribution balance; and if the larger the second metric corresponding to a resource set, the greater the relevance of the resource set, then the objective metric function... With the first measurement function and the second measurement function The relationship is shown in Formula 9 or Formula 10:
[0147] (Formula 9)
[0148] (Formula 10)
[0149] in, Indicates resource collection The target measurement function for the independent variable; Indicates resource collection For example, the first measure function of the independent variable is... The expressions are shown in Formula 1, Formula 3 or Formula 4; Indicates resource collection For example, the second measure function of the independent variable, The expression is shown in Formula 6; Represents the balance parameters. The range of values is , The value of can be set based on experience or flexibly adjusted according to the application scenario. The smaller the resource set performance metric calculated using the target metric function shown in Formula 9, the better the resource set performance. The larger the resource set performance metric calculated using the target metric function shown in Formula 10, the better the resource set performance.
[0150] Of course, based on the first and second measurement functions, the target measurement function can be constructed in other ways, as long as it ensures that the resource set performance measurement index calculated according to the determined target measurement function can accurately measure the resource set performance.
[0151] It should be noted that the above explanation uses the example of constructing the target metric function based on the first and second metric functions as an example, and the embodiments of this application are not limited to this. The principle of constructing the target metric function based on the first and third metric functions, as well as the principle of constructing the target metric function based on the first, second, and third metric functions, is the same as that of constructing the target metric function based on the first and second metric functions, and will not be repeated here.
[0152] Next, we will introduce the process of determining the target resource set whose performance meets the recommendation conditions based on the objective measurement function.
[0153] In one possible implementation, see Figure 3 The process of determining the target resource set whose performance meets the recommended conditions based on the target measurement function includes the following steps 2021 and 2022.
[0154] Step 2021: Determine at least one first resource set.
[0155] The first resource set refers to the resource set to be measured, which consists of candidate resources in the candidate resource set. By measuring at least one first resource set, a target resource set whose performance meets the recommendation conditions can be selected from at least one first resource set.
[0156] In an exemplary embodiment, at least one first resource set is determined by selecting at least one subset from each subset of the candidate resource set that satisfies the reference condition as at least one first resource set. If the number of candidate resources in the candidate resource set is M, then the candidate resource set has 2 M A subset. The reference conditions are set based on experience or flexibly adjusted according to the application scenario; this application does not limit this in its embodiments.
[0157] In an exemplary embodiment, the number of resources in the resource set to be recommended is unlimited, and at least one subset satisfying the reference condition refers to at least one non-empty subset. In an exemplary embodiment, if the number of resources in the resource set to be recommended is a third quantity, then at least one subset satisfying the reference condition refers to at least one subset including a third quantity of candidate resources. In an exemplary embodiment, if the number of resources in the resource set to be recommended is required to be at least a fourth quantity, then at least one subset satisfying the reference condition refers to at least one subset including a fourth quantity of candidate resources. The third and fourth quantities are set based on experience or can be flexibly adjusted according to the application scenario; this embodiment does not limit them.
[0158] After identifying at least one subset that satisfies the reference conditions, each subset that satisfies the reference conditions is treated as a first resource set, thereby obtaining at least one first resource set. The number of resources in different first resource sets may be the same or different, depending on how the first resource set is determined, and this application embodiment does not limit this.
[0159] Step 2022: Based on the target measurement function, determine the resource set performance measurement index corresponding to each first resource set, and take the first resource set corresponding to the resource set performance measurement index that meets the selection conditions as the target resource set.
[0160] After determining each first resource set, a resource set performance measurement index corresponding to each first resource set is determined based on the target measurement function. The method for determining the resource set performance measurement index corresponding to each first resource set is the same; this embodiment will be illustrated by taking the determination of the resource set performance measurement index corresponding to any first resource set within each first resource set as an example.
[0161] The target performance measurement function is a function with resource sets as independent variables. In one possible implementation, the resource set performance measurement index corresponding to any first resource set is determined based on the target function by substituting the value of any first resource set as the independent variable into the target performance measurement function to obtain the resource set performance measurement index corresponding to that first resource set.
[0162] A resource set performance metric is used to measure the performance of a resource set. For example, a larger resource set performance metric for any first resource set indicates better resource set performance; conversely, a smaller resource set performance metric for any first resource set indicates better resource set performance.
[0163] For example, since the target measurement function is the first measurement function, or is constructed based on the first measurement function and other measurement functions, the resource set performance measurement index corresponding to any first resource set is determined based on the first measurement index corresponding to any first resource set. As described in the introduction to the first measurement function, the first measurement index corresponding to any first resource set is determined based on the probability corresponding to each candidate label in any first resource set. In other words, the resource set performance measurement index corresponding to any first resource set is determined based on the probability corresponding to each candidate label in any first resource set. The probability corresponding to any candidate label in any first resource set is the probability that at least two resources extracted from any first resource set have any candidate label.
[0164] The method of determining the resource set performance measurement index corresponding to any first resource set based on the probability of each candidate label under any first resource set is related to the relationship between the target measurement function and the first measurement function, which will not be elaborated here.
[0165] By referring to the method of determining the resource set performance measurement index corresponding to any first resource set, it is possible to determine the resource set performance measurement index corresponding to each first resource set. Then, it is possible to determine the resource set performance measurement index that meets the selection conditions, and the first resource set corresponding to the resource set performance measurement index that meets the selection conditions is taken as the target resource set whose resource set performance meets the recommended conditions.
[0166] The first resource set corresponding to the resource set performance metric that meets the selection criteria refers to the first resource set with the best performance among all first resource sets. If the larger the resource set performance metric corresponding to a first resource set, the better the resource set performance, then the resource set performance metric that meets the selection criteria is the maximum value among all resource set performance metrics corresponding to first resource sets; conversely, if the larger the resource set performance metric corresponding to a first resource set, the worse the resource set performance, then the resource set performance metric that meets the selection criteria is the minimum value among all resource set performance metrics corresponding to first resource sets.
[0167] In another possible implementation, see Figure 4 The process of determining the target resource set whose performance meets the recommended conditions based on the target measurement function includes the following steps 202A to 202C.
[0168] Step 202A: Convert all target measurement functions into reference functions with resource set index information as independent variables. The resource set index information is used to index resource sets.
[0169] Resource set index information is used to index resource sets. For example, the resource set index information indicates the status of each candidate resource, where the status of any candidate resource is either "hit" or "miss". For example, the resource set index information is in the form of a vector, and the status of each candidate resource is represented by a vector element. For example, if a vector element has a third value (e.g., 1), the status indicated by that vector element is "hit"; if a vector element has a fourth value (e.g., 0), the status indicated by that vector element is "miss". In the process of indexing a resource set based on the resource set index information, it is possible to determine which candidate resources have a "hit" status based on the resource set index information, and then use the set of candidate resources with a "hit" status as the resource set indexed based on the resource set index information.
[0170] For example, using vectors This represents the resource set index information, which can represent a resource set. The resources possessed, with a vector length equal to the candidate resource set. Number of candidate resources The value of each vector element indicates whether the corresponding candidate resource is in the resource set as a hit or a miss. If the corresponding state is a hit, it means that the candidate resource is in the resource set. If the corresponding status is "missed," it means that the candidate resource is not in the resource set. In other words, the value of a vector element indicates whether the resource corresponding to that vector element exists in the resource set. In the example, using a value of 1 to indicate that the state corresponding to the candidate resource is a hit, and using a value of 0 to indicate that the state corresponding to the candidate resource is a miss, then the vector... It is a 0-1 vector, that is, a vector The vector elements in the vector can take values of 0 or 1.
[0171] Since the objective metrics functions are all functions of the resource set, they are not easy to optimize. Therefore, the objective metrics functions are all transformed into reference functions with the resource set index information as independent variables. This makes it easier to optimize the value of the reference function by continuously optimizing the value of the independent variable.
[0172] The method of converting the target measurement function into a reference function with resource set index information as the independent variable is related to the expression of the target measurement function, and the embodiments of this application do not limit this.
[0173] For example, the target measurement function is constructed based on the first measurement function and the second measurement function. Assume the expression of the target measurement function is as shown in Equation 9, the expression of the first measurement function is as shown in Equation 4, and the expression of the second measurement function is as shown in Equation 6.
[0174] remember Then formula 4 can be expressed as formula 11:
[0175] (Formula 11)
[0176] remember Then formula 11 can be expressed as formula 12:
[0177] (Formula 12)
[0178] Formula 12 It can be converted into resource index information Functions with independent variable: ,in, .
[0179] Similarly, let Then the second measurement function shown in Formula 6 It can be converted into resource index information Functions with independent variable: Where M represents the number of candidate resources in the candidate resource set; (i is not less than 1 and not greater than M) indicates the degree of interest of the interactive object represented by u in the candidate resource set represented by the label i, and also indicates the degree of matching between the representational features of the interactive object represented by u and the representational features of the candidate resource set represented by the label i.
[0180] The target measurement function is shown in Formula 9. It can be converted into a reference function as shown in Formula 13. :
[0181] (Formula 13)
[0182] By transforming the objective metric function into a reference function with resource set index information as the independent variable, the process of determining the resource set can be converted into a quadratic programming problem. This allows the target resource set to be determined by solving the quadratic programming problem. For example, the quadratic programming problem can also be called a quadratic optimization problem.
[0183] Step 202B: Solve the reference function according to the solution objective to obtain the values of the independent variables that satisfy the solution conditions.
[0184] Since the reference function is obtained by transforming the objective metric function, solving the objective is related to the relationship between the resource set performance metric calculated based on the objective metric function and the resource set performance. If the smaller the resource set performance metric calculated based on the objective metric function, the better the resource set performance, then the objective is to minimize the reference function; if the larger the resource set performance metric calculated based on the objective metric function, the better the resource set performance, then the objective is to maximize the reference function.
[0185] Taking the reference function as shown in Equation 13 as an example, the objective of solving the reference function can be expressed as:
[0186]
[0187] The process of solving the reference function according to the objective can be regarded as a bivariate quadratic programming problem, where vectors... Each vector element can only take the value 0 or 1 (i.e., ),vector The number of vector elements in the index is M, and the sum of the M vector elements is the number of resources in the indexed resource set. ,Right now .
[0188] The process of solving the reference function according to the objective is called the iterative solution process, which continues until the values of the independent variables that satisfy the solution conditions are obtained. For example, the values of the independent variables that satisfy the solution conditions refer to the values of the independent variables when the function converges, or the values of the independent variables when the number of iterations reaches a threshold, etc.
[0189] During the iterative solution of the reference function according to the solution objective, the values of the independent variables are continuously updated according to the objective. For example, a value for the independent variable is first randomly assigned, then the gradient is calculated and updated according to the objective. The value of the independent variable is then updated according to the gradient and rounded to the nearest integer, resulting in an updated value. This process is repeated until a value that satisfies the solution conditions is obtained. For example, the vector elements in the updated independent variable values may not be 1 or 0. Rounding ensures that all vector elements in the independent variable values are either 1 or 0. For example, the rounding process involves setting vector elements less than the target threshold to 0 and setting vector elements not less than the target threshold to 1. The target threshold is set empirically or flexibly adjusted according to the application scenario; for example, the target threshold might be 0.5.
[0190] For example, the process of iteratively solving the reference function according to the solution objective is a quadratic programming process, which can be implemented using an optimization algorithm. This application does not limit the optimization algorithm used in the quadratic programming process. For example, the Frank-Wolfe algorithm is used, which involves calculating the gradient of the independent variable, updating the independent variable value with a step size in the gradient direction, and rounding it down to obtain an approximate solution. This approximate solution is the independent variable value obtained after one solution. This process is repeated until the independent variable value that satisfies the solution conditions is obtained.
[0191] Step 202C: The resource set indexed by the values of the independent variables that satisfy the solution conditions is taken as the target resource set whose performance meets the recommended conditions.
[0192] The values of the independent variables that satisfy the solution conditions are obtained by solving the independent variable values according to the solution objective. They are used to index resource sets whose performance meets the recommended conditions. Therefore, the resource sets indexed based on the values of the independent variables that satisfy the solution conditions are used as the target resource sets.
[0193] In one possible implementation, the values of the independent variables that satisfy the solution conditions are used to indicate the states corresponding to each candidate resource, where the state of any candidate resource is either hit or miss. If a candidate resource is hit, it is determined that the candidate resource is in the resource set indexed by the values of the independent variables that satisfy the solution conditions. If a candidate resource is miss, it is determined that the candidate resource is not in the resource set indexed by the values of the independent variables that satisfy the solution conditions.
[0194] For example, the method for determining the resource set indexed based on the values of the independent variables that satisfy the solution conditions is as follows: Based on the values of the independent variables that satisfy the solution conditions, determine each candidate resource whose corresponding state is "hit," and use the set of each candidate resource whose corresponding state is "hit" as the resource set indexed based on the values of the independent variables that satisfy the solution conditions. For example, the values of the independent variables that satisfy the solution conditions are a vector, and the state corresponding to each candidate resource can be determined based on the value of the vector element corresponding to each candidate resource. For example, if the value of the vector element corresponding to a candidate resource is 1, then the state corresponding to that candidate resource is "hit"; if the value of the vector element corresponding to a candidate resource is 0, then the state corresponding to that candidate resource is "missed."
[0195] After determining the target resource set, the target resource set is recommended. For example, recommending the target resource set means recommending it to the interactive object. For example, recommending the target resource set to the interactive object means sending the target resource set to the interactive object's terminal so that the interactive object's terminal can display the resources in the target resource set. For example, the interactive object's terminal can display the resources in the target resource set in a list format, or it can display the resources in the target resource set sequentially, etc., and this application embodiment does not limit this. After displaying the resources in the target resource set, the interactive object's terminal can collect the interactive object's interaction with the resources in the target resource set, and then send the interaction information to the server so that the server can consider the interaction information to implement the subsequent resource set recommendation process.
[0196] It is understood that the embodiments of this application involve data such as the historical interaction data of the interactive object and the interaction status of the interactive object with resources. When the above embodiments of this application are applied to specific products or technologies, it is necessary to obtain the permission or consent of the interactive object, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0197] The resource recommendation method provided in this application can be considered a diversity recommendation method based on the Simpson Diversity Index. This method refers to the Simpson Diversity Index to measure the diversity of a resource set. This index considers diversity from two aspects: one is the richness of the tags in the resource set, i.e., the number of different types of tags in the resource set; the other is the evenness of the resource distribution in the resource set, i.e., the difference in the number of resources distributed across different types of tags. Since maintaining a relatively rich set of tags and a relatively even distribution of resources across different types of tags is considered a true diversity recommendation, the resource recommendation method provided in this application can be seen as a method based on the meaning of diversity itself. This method can provide a fairer diversity recommendation result. Furthermore, this application also transforms the diversity recommendation problem into a quadratic programming problem, and an optimization algorithm for quadratic programming problems can be used to approximate the solution to the diversity recommendation problem, improving the efficiency of determining the resource set.
[0198] In a real-world application or webpage, there will be a large number of resources distributed across certain tags, known as popular tags, and a very small number of resources distributed across certain tags, known as unpopular tags. In other words, most resources are concentrated on a few particularly popular tags. Recommendation methods using related technologies tend to heavily recommend resources with popular tags, while resources with unpopular tags receive almost no recommendation, resulting in an unfair recommendation outcome. When users actually use an application or webpage, they don't necessarily only view resources with popular tags. The recommendation method provided in this application can leverage users' exploration of resources with unpopular tags to uncover their interests and preferences. It also helps to ensure that resources with unpopular tags receive sufficient recommendation, allowing creators of these resources to find suitable user groups, thereby enriching and diversifying the content of the application or webpage.
[0199] The resource recommendation method provided in this application recommends resource sets by comprehensively considering tag richness and resource distribution balance. Tag richness and resource distribution balance can reliably reflect the diversity of resource sets, thereby recommending resource sets with high diversity and improving the interaction rate of the recommended resource sets.
[0200] See Figure 5 This application provides a resource recommendation device, which includes:
[0201] Acquisition unit 501 is used to acquire resource recommendation requests;
[0202] The determining unit 502 is used to determine, in response to a resource recommendation request, a target resource set whose performance meets the recommendation conditions based on a target measurement function;
[0203] Recommendation unit 503 is used to recommend target resource sets;
[0204] The objective metric function is used to measure the performance of the resource set. The performance of the resource set is characterized by label richness and resource distribution balance. Label richness indicates the number of types of labels that a resource has, and resource distribution balance indicates the difference in the number of resources distributed on different types of labels.
[0205] In one possible implementation, the determining unit 502 is used to transform the target measurement function into a reference function with resource set index information as the independent variable, the resource set index information being used to index the resource set; the reference function is solved according to the solution target to obtain the values of the independent variables that satisfy the solution conditions; the resource set indexed according to the values of the independent variables that satisfy the solution conditions is taken as the target resource set whose resource set performance meets the recommended conditions.
[0206] In one possible implementation, the values of the independent variables that satisfy the solution conditions are used to indicate the states corresponding to each candidate resource, and the state corresponding to any candidate resource is hit or miss; the determining unit 502 is also used to determine each candidate resource with a hit state based on the values of the independent variables that satisfy the solution conditions, and to use the set of each candidate resource with a hit state as the resource set indexed by the values of the independent variables that satisfy the solution conditions.
[0207] In one possible implementation, the determining unit 502 is used to determine at least one first resource set; based on the target measurement function, determine the resource set performance measurement index corresponding to each first resource set; and take the first resource set corresponding to the resource set performance measurement index that meets the selection conditions as the target resource set whose resource set performance meets the recommended conditions.
[0208] In one possible implementation, the performance metric for any first resource set is determined based on the probability of each candidate label in any first resource set. The probability of any candidate label in any first resource set is the probability that at least two resources extracted from any first resource set have any candidate label.
[0209] In one possible implementation, the performance of the resource set is characterized by tag richness, resource distribution balance, and relevance. The target measurement function is constructed based on a first measurement function and a second measurement function. The first measurement function is used to measure tag richness and resource distribution balance, and the second measurement function is used to measure relevance, which is the relevance of the interactive object corresponding to the resource recommendation request.
[0210] In one possible implementation, the performance of the resource set is characterized by tag richness, resource distribution balance, and resource similarity. The target measurement function is constructed based on a first measurement function and a third measurement function. The first measurement function is used to measure tag richness and resource distribution balance, and the third measurement function is used to measure resource similarity.
[0211] In one possible implementation, the performance of the resource set is characterized by tag richness, resource distribution balance, relevance, and resource similarity. The target measurement function is constructed based on a first measurement function, a second measurement function, and a third measurement function. The first measurement function is used to measure tag richness and resource distribution balance, the second measurement function is used to measure relevance, and the third measurement function is used to measure resource similarity. The relevance is the relevance of the interactive object corresponding to the resource recommendation request.
[0212] In one possible implementation, the second evaluation function is constructed based on the representational features of the interaction objects. The acquisition unit 501 is also used to acquire the target graph structure with each candidate object and each candidate resource as nodes. The edges between the nodes in the target graph structure are determined according to the target interaction information between each candidate object and each candidate resource. The target graph neural network is called to process the target graph structure to obtain the representational features of the interaction objects in each candidate object.
[0213] In one possible implementation, the acquisition unit 501 is further configured to acquire a sample graph structure with each sample object and each sample resource as nodes, wherein the edges between nodes in the sample graph structure are determined based on the sample interaction information between each sample object and each sample resource; to call an initial graph neural network to process the sample graph structure to obtain the initial features of each sample object and each sample resource; to acquire the sub-loss corresponding to each benchmark pair based on the initial features of each sample object and each sample resource, wherein any benchmark pair includes a sample object and a sample resource that has been interacted with and a sample resource that has not been interacted with; and to train the initial graph neural network based on the sub-loss corresponding to each benchmark pair to obtain the target graph neural network.
[0214] In one possible implementation, the sub-loss corresponding to any benchmark pair is determined based on the difference between a first matching degree and a second matching degree, wherein the first matching degree is the matching degree between the initial features of the sample objects in any benchmark pair and the initial features of the interacting sample resources in any benchmark pair, and the second matching degree is the matching degree between the initial features of the sample objects in any benchmark pair and the initial features of the non-interacting sample resources in any benchmark pair.
[0215] The resource recommendation device provided in this application recommends resource sets by comprehensively considering tag richness and resource distribution balance. Tag richness and resource distribution balance can reliably reflect the diversity of resource sets, thereby recommending resource sets with high diversity and improving the interaction rate of the recommended resource sets.
[0216] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional units. In practical applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the device can be divided into different functional units to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0217] In an exemplary embodiment, a computer device is also provided, comprising a processor and a memory, wherein at least one computer program is stored in the memory. The at least one computer program is loaded and executed by one or more processors to enable the computer device to implement any of the resource recommendation methods described above. The computer device may refer to a server or a terminal; this application embodiment does not limit the definition. The structures of the server and the terminal will be described separately below.
[0218] Figure 6 This is a schematic diagram of a server structure provided in an embodiment of this application. The server can vary significantly due to differences in configuration or performance. It may include one or more Central Processing Units (CPUs) 601 and one or more memories 602. The one or more memories 602 store at least one computer program, which is loaded and executed by the one or more processors 601 to enable the server to implement the resource recommendation methods provided in the various method embodiments described above. Of course, the server may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be elaborated upon here.
[0219] Figure 7 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application. The terminal can be: a PC, mobile phone, smartphone, PDA, wearable device, PPC, tablet computer, smart car infotainment system, smart TV, smart speaker, or in-vehicle terminal. The terminal may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other names.
[0220] Typically, a terminal includes a processor 701 and a memory 702.
[0221] Processor 701 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 701 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 701 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 701 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 701 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0222] The memory 702 may include one or more computer-readable storage media, which may be non-transitory. The memory 702 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 702 are used to store at least one instruction, which is executed by the processor 701 to enable the terminal to implement the resource recommendation method provided in the method embodiments of this application.
[0223] In some embodiments, the terminal may also optionally include: a peripheral device interface 703 and at least one peripheral device. The processor 701, memory 702, and peripheral device interface 703 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 703 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of: a radio frequency circuit 704, a display screen 705, a camera assembly 706, an audio circuit 707, and a power supply 709.
[0224] Peripheral device interface 703 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 701 and memory 702. In some embodiments, processor 701, memory 702 and peripheral device interface 703 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 701, memory 702 and peripheral device interface 703 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0225] The radio frequency (RF) circuit 704 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 704 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 704 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 704 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 704 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: metropolitan area networks (MANs), various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks (WLANs), and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 704 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0226] Display screen 705 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 705 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 701 for processing. In this case, display screen 705 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 705 may be a single screen, disposed on the front panel of the terminal; in other embodiments, display screen 705 may be at least two screens, disposed on different surfaces of the terminal or in a folded design; in still other embodiments, display screen 705 may be a flexible display screen, disposed on a curved or folded surface of the terminal. Furthermore, display screen 705 may be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. Display screen 705 may be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light-Emitting Diode).
[0227] The camera assembly 706 is used to acquire images or videos. Optionally, the camera assembly 706 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 706 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.
[0228] The audio circuit 707 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 701 for processing, or input to the radio frequency circuit 704 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each positioned at a different location on the terminal. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert the electrical signals from the processor 701 or the radio frequency circuit 704 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 707 may also include a headphone jack.
[0229] Power supply 709 is used to power the various components in the terminal. Power supply 709 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 709 includes a rechargeable battery, the rechargeable battery can support wired or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0230] In some embodiments, the terminal further includes one or more sensors 710. The one or more sensors 710 include, but are not limited to: an accelerometer 711, a gyroscope 712, a pressure sensor 713, an optical sensor 715, and a proximity sensor 716.
[0231] Accelerometer 711 can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by the terminal. For example, accelerometer 711 can be used to detect the components of gravitational acceleration along the three coordinate axes. Processor 701 can control display screen 705 to display the user interface in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 711. Accelerometer 711 can also be used for games or for acquiring user motion data.
[0232] The gyroscope sensor 712 can detect the terminal's orientation and rotation angle. The gyroscope sensor 712, in conjunction with the accelerometer sensor 711, can collect the user's 3D movements on the terminal. Based on the data collected by the gyroscope sensor 712, the processor 701 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.
[0233] The pressure sensor 713 can be disposed on the side bezel of the terminal and / or on the lower layer of the display screen 705. When the pressure sensor 713 is disposed on the side bezel of the terminal, it can detect the user's grip signal on the terminal, and the processor 701 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 713. When the pressure sensor 713 is disposed on the lower layer of the display screen 705, the processor 701 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 705. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0234] An optical sensor 715 is used to collect ambient light intensity. In one embodiment, the processor 701 can control the display brightness of the display screen 705 based on the ambient light intensity collected by the optical sensor 715. Specifically, when the ambient light intensity is high, the display brightness of the display screen 705 is increased; when the ambient light intensity is low, the display brightness of the display screen 705 is decreased. In another embodiment, the processor 701 can also dynamically adjust the shooting parameters of the camera assembly 706 based on the ambient light intensity collected by the optical sensor 715.
[0235] The proximity sensor 716, also known as a distance sensor, is typically mounted on the front panel of the terminal. The proximity sensor 716 is used to detect the distance between the user and the front of the terminal. In one embodiment, when the proximity sensor 716 detects that the distance between the user and the front of the terminal is gradually decreasing, the processor 701 controls the display screen 705 to switch from a screen-on state to a screen-off state; when the proximity sensor 716 detects that the distance between the user and the front of the terminal is gradually increasing, the processor 701 controls the display screen 705 to switch from a screen-off state to a screen-on state.
[0236] Those skilled in the art will understand that Figure 7 The structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0237] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores at least one computer program that is loaded and executed by a processor of a computer device to enable the computer to implement any of the resource recommendation methods described above.
[0238] In one possible implementation, 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.
[0239] In an exemplary embodiment, a computer program product is also provided, comprising a computer program or computer instructions that are loaded and executed by a processor to enable a computer to implement any of the resource recommendation methods described above.
[0240] It should be noted that the terms "first," "second," etc., used in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the above exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0241] 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.
[0242] 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 resource recommendation method, characterized by, The method comprises: obtaining a resource recommendation request; in response to the resource recommendation request, determining a target resource set in which resource set performance meets a recommendation condition based on a target measurement function, and recommending the target resource set; wherein the target measurement function is a function with a resource set as an independent variable, the target measurement function is used to measure the resource set performance, the resource set performance is represented based on label richness and resource distribution balance, the target measurement function is a first measurement function, or the target measurement function is constructed based on the first measurement function and other measurement functions; the first measurement function is used to determine a first measurement index corresponding to a resource set, and the first measurement index corresponding to one resource set is used to measure the diversity of the one resource set from the comprehensive perspective of the label richness and the resource distribution balance of the one resource set; the label richness of the one resource set is used to indicate the number of types of labels possessed by the resources in the one resource set, and the resource distribution balance of the one resource set is used to indicate the quantity difference of resources distributed on different types of labels in the one resource set; the determination of the target resource set in which the resource set performance meets the recommendation condition based on the target measurement function comprises: converting the target measurement function into a reference function with resource set index information as an independent variable, the resource set index information being used to index a resource set, the resource set index information comprising vector elements corresponding to respective candidate resources, a value of a vector element corresponding to any candidate resource being used to indicate that a state corresponding to the any candidate resource is hit or missed, and a resource set indexed according to the resource set index information being a set of candidate resources in which the corresponding state is hit and which is determined according to the resource set index information; iterative solving of the reference function is performed according to a solving target until a value of the independent variable meeting a solving condition is solved; in a case where a resource set performance measurement index calculated according to the target measurement function is negatively correlated with the resource set performance, the solving target is to minimize the reference function; in a case where the resource set performance measurement index calculated according to the target measurement function is positively correlated with the resource set performance, the solving target is to maximize the reference function; based on the value of the independent variable meeting the solving condition, determining respective candidate resources in which the corresponding state is hit, and taking the set of candidate resources in which the corresponding state is hit as the target resource set in which the resource set performance meets the recommendation condition.
2. The method of claim 1, wherein, the determination of the target resource set in which the resource set performance meets the recommendation condition based on the target measurement function further comprises: determining at least one first resource set; determining a resource set performance measurement index corresponding to each first resource set based on the target measurement function; and taking a first resource set corresponding to a resource set performance measurement index meeting a selection condition as the target resource set in which the resource set performance meets the recommendation condition.
3. The method of claim 2, wherein, The resource set performance corresponding to any first resource set is determined based on probabilities of each candidate label corresponding to the any first resource set respectively, and the probability of any candidate label corresponding to the any first resource set is a probability that at least two resources extracted from the any first resource set all have the any candidate label.
4. The method according to any of claims 1 to 3, characterized in that, The resource set performance is characterized based on the label richness, the resource distribution balance, and the relevance, the target measurement function is constructed based on the first measurement function and a second measurement function, and the second measurement function is used to measure the relevance of an interactive object corresponding to the resource recommendation request.
5. The method according to any one of claims 1 to 3, characterized in that, The resource set performance is characterized based on the label richness, the resource distribution balance, and the resource similarity, the target measurement function is constructed based on the first measurement function and a third measurement function, and the third measurement function is used to measure the resource similarity.
6. The method according to any one of claims 1 to 3, characterized in that, The resource set performance is characterized based on the label richness, the resource distribution balance, the relevance, and the resource similarity, the target measurement function is constructed based on the first measurement function, the second measurement function, and the third measurement function, the second measurement function is used to measure the relevance, the third measurement function is used to measure the resource similarity, and the relevance is the relevance of an interactive object corresponding to the resource recommendation request.
7. The method of claim 4, wherein, The second measurement function is constructed based on the representation feature of the interactive object, and the method further includes: obtaining a target graph structure with each candidate object and each candidate resource as a node, edges between nodes in the target graph structure being determined according to target interaction information between the candidate objects and the candidate resources; calling a target graph neural network to process the target graph structure to obtain the representation feature of the interactive object in the candidate objects.
8. The method of claim 7, wherein, Before the calling of the target graph neural network to process the target graph structure to obtain the representation feature of the interactive object in the candidate objects, the method further includes: obtaining a sample graph structure with each sample object and each sample resource as a node, edges between nodes in the sample graph structure being determined according to sample interaction information between the sample objects and the sample resources; calling an initial graph neural network to process the sample graph structure to obtain initial features of the sample objects and initial features of the sample resources; based on the initial features of the sample objects and the initial features of the sample resources, obtaining sub-losses respectively corresponding to each reference pair, any reference pair including one sample object, one interacted sample resource corresponding to the sample object, and one non-interacted sample resource; training the initial graph neural network based on the sub-losses respectively corresponding to the reference pairs to obtain the target graph neural network.
9. The method of claim 8, wherein, The first matching degree is a matching degree between the initial feature of the sample object in the any reference pair and the initial feature of the interacted sample resource in the any reference pair, and the second matching degree is a matching degree between the initial feature of the sample object in the any reference pair and the initial feature of the uninteracted sample resource in the any reference pair.
10. A resource recommendation apparatus, characterized by comprising: The device comprises: An acquisition unit is configured to acquire a resource recommendation request. A determination unit is configured to, in response to the resource recommendation request, convert a target measurement function into a reference function with resource set index information as an independent variable, the resource set index information being used to index a resource set, the resource set index information including vector elements corresponding to respective candidate resources, a value of a vector element corresponding to any candidate resource being used to indicate that a state corresponding to the any candidate resource is a hit or a miss, and a resource set indexed according to the resource set index information being a collection of candidate resources whose corresponding states are hits and determined according to the resource set index information; iteratively solve the reference function according to a solving target until a value of the independent variable satisfying a solving condition is obtained; in a case where a performance measurement index of the resource set calculated according to the target measurement function is negatively correlated with the performance of the resource set, the solving target is to minimize the reference function; in a case where the performance measurement index of the resource set calculated according to the target measurement function is positively correlated with the performance of the resource set, the solving target is to maximize the reference function; and determine, based on the value of the independent variable satisfying the solving condition, respective candidate resources whose corresponding states are hits, and take the collection of the respective candidate resources whose corresponding states are hits as a target resource set whose performance satisfies a recommendation condition. A recommendation unit is configured to recommend the target resource set. The target measurement function is a function with a resource set as an independent variable, the target measurement function is used to measure the performance of the resource set, the performance of the resource set is represented based on a label richness and a resource distribution balance degree, the target measurement function is a first measurement function, or the target measurement function is constructed based on the first measurement function and other measurement functions; the first measurement function is used to determine a first measurement index corresponding to a resource set, a first measurement index corresponding to one resource set is used to measure diversity of the one resource set from a comprehensive perspective of a label richness and a resource distribution balance degree of the one resource set, the label richness of the one resource set is used to indicate a number of types of labels possessed by resources in the one resource set, and the resource distribution balance degree of the one resource set is used to indicate a quantity difference of resources distributed on different types of labels in the one resource set.
11. The apparatus of claim 10, wherein, The determination unit is further configured to determine at least one first resource set, determine a resource set performance measurement index corresponding to each first resource set respectively based on the target measurement function, and take a first resource set corresponding to a resource set performance measurement index satisfying a selection condition as the target resource set whose performance satisfies the recommendation condition.
12. The apparatus of claim 11, wherein, The resource set performance corresponding to any first resource set is determined based on probabilities of each candidate label corresponding to the any first resource set respectively, and the probability of any candidate label corresponding to the any first resource set is a probability that at least two resources extracted in the any first resource set all have the any candidate label.
13. The apparatus of any of claims 10-12, wherein, The resource set performance is characterized based on the label richness, the resource distribution balance, and the relevance, the target measurement function is constructed based on the first measurement function and a second measurement function, and the second measurement function is used to measure the relevance of an interactive object corresponding to the resource recommendation request.
14. The apparatus of any of claims 10-12, wherein, The resource set performance is characterized based on the label richness, the resource distribution balance, and the resource similarity, the target measurement function is constructed based on the first measurement function and a third measurement function, and the third measurement function is used to measure the resource similarity.
15. The apparatus of any of claims 10-12, wherein, The resource set performance is characterized based on the label richness, the resource distribution balance, the relevance, and the resource similarity, the target measurement function is constructed based on the first measurement function, the second measurement function, and the third measurement function, the second measurement function is used to measure the relevance, the third measurement function is used to measure the resource similarity, and the relevance is the relevance of an interactive object corresponding to the resource recommendation request.
16. The apparatus of claim 13, wherein, The second measurement function is constructed based on a representation feature of the interactive object, the acquisition unit is further configured to acquire a target graph structure with each candidate object and each candidate resource as a node, edges between nodes in the target graph structure are determined according to target interactive information between the candidate objects and the candidate resources, and a target graph neural network is called to process the target graph structure to obtain the representation feature of the interactive object in the candidate objects.
17. The apparatus of claim 16, wherein, The acquisition unit is further configured to acquire a sample graph structure with each sample object and each sample resource as a node, edges between nodes in the sample graph structure are determined according to sample interactive information between the sample objects and the sample resources, and an initial graph neural network is called to process the sample graph structure to obtain initial features of the sample objects and initial features of the sample resources. Based on the initial features of the sample objects and the initial features of the sample resources, a sub-loss corresponding to each reference pair is acquired, and any reference pair includes one sample object, one interacted sample resource corresponding to the sample object, and one uninteracted sample resource. The initial graph neural network is trained based on the sub-loss corresponding to each reference pair to obtain the target graph neural network.
18. The apparatus of claim 17, wherein, The corresponding sub-loss of any reference pair is determined based on a difference between a first matching degree and a second matching degree, the first matching degree being a matching degree between the initial feature of the sample object in the any reference pair and the initial feature of the interacted sample resource in the any reference pair, and the second matching degree being a matching degree between the initial feature of the sample object in the any reference pair and the initial feature of the non-interacted sample resource in the any reference pair.
19. A computer device, comprising: The computer device comprises a processor and a memory, and the memory stores at least one computer program, which is loaded and executed by the processor, so that the computer device implements the resource recommendation method according to any one of claims 1 to 9.
20. A computer-readable storage medium, characterized in that, The computer readable storage medium stores at least one computer program, which is loaded and executed by the processor, so that the computer implements the resource recommendation method according to any one of claims 1 to 9.
21. A computer program product, characterised in that, The computer program product comprises a computer program or computer instructions, which are loaded and executed by the processor, so that the computer implements the resource recommendation method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Information recommendation method and device, front-end implementation method and device, equipment and storage medium
CN110020156A
Label recommendation method and device and readable medium
CN110209905A
Multimedia resource recommendation method and device, electronic equipment and storage medium
CN110929052A
Multimedia resource recommendation method and device, electronic equipment and storage medium
CN113342998A