Article rearrangement method and device in recommendation system, electronic equipment and storage medium

By calculating the diversity score of items and rearranging it, the problem of difficulty in calculating similarity when the span of item categories is large in the prior art is solved, the diversity adjustment of items and user interest satisfaction is achieved, and the effect of the recommendation system is improved.

CN119293477APending Publication Date: 2025-01-10SHANGHAI KAITUO HUANYU TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311316416.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-11
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In scenarios where the item category span is large, it is difficult to effectively calculate the similarity between items, resulting in unsatisfactory item rearrangement results.

Method used

By obtaining the list of candidate items, calculate the diversity score of items, use sorting scores, multiple sets of item categories and preset parameter values ​​to rearrange items to achieve diversity adjustment of items.

Benefits of technology

In scenarios where the item category span is large, better rearrangement results can be obtained to ensure the diversity of recommended items and user interests, and avoid dependence on item content feature vectors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293477A_ABST
    Figure CN119293477A_ABST
Patent Text Reader

Abstract

The invention relates to an article rearrangement method and device in a recommendation system, electronic equipment and a storage medium, and the method comprises the steps: obtaining a candidate article list, the candidate article list comprises article information corresponding to a plurality of candidate articles in the recommendation system, and the article information comprises sorting scores of the candidate articles and a plurality of groups of article types of the candidate articles; on the basis of the sorting scores of the candidate items, the multiple groups of item categories of the candidate items and preset parameter values, calculating diversity scores of the candidate items in the candidate item list; and according to the diversity score obtained by calculation, rearranging the plurality of candidate items in the recommendation system to obtain a rearrangement result. In this way, the diversity degree of each candidate article can be judged according to the diversity score, so that article rearrangement is achieved, it is not needed to calculate the similarity of the articles based on feature vectors of article content to achieve article rearrangement, and therefore a good rearrangement result can be obtained even in a scene with a large article category span.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent recommendation technology, and in particular to a method, device, electronic device and storage medium for rearranging items in a recommendation system. Background Art

[0002] With the continuous development of intelligent recommendation technology, the application of recommendation systems in various industries is becoming more and more popular. When a recommendation system recommends items to a user, it generally goes through the stages of recall, sorting, and re-ranking. The re-ranking stage can make secondary adjustments to the sorting results generated in the sorting stage to ensure that the items recommended to the user are both in line with the user's interests and diverse, so it is of great significance.

[0003] In the prior art, the maximum marginal relevance algorithm (MMR) and the determinantal point process (DPP) are usually used to achieve item rearrangement. However, this method requires calculating the similarity of items based on the feature vector of the item content. For scenes with a large span of item categories, the similarity between items with a large span of categories cannot be calculated well, resulting in unsatisfactory rearrangement results. Therefore, how to better achieve item rearrangement has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The present application provides a method, device, electronic device and storage medium for rearranging items in a recommendation system to solve the problem that the existing item rearrangement method cannot well calculate the similarity between items with a large category span, resulting in less than ideal rearrangement results.

[0005] In a first aspect, the present application provides a method for rearranging items in a recommendation system, the method comprising:

[0006] Obtaining a candidate item list, wherein the candidate item list includes item information corresponding to a plurality of candidate items in the recommendation system, and the item information includes ranking scores of the candidate items and a plurality of groups of item categories of the candidate items;

[0007] Calculating a diversity score for each candidate item in the candidate item list based on the ranking scores of the candidate items, the multiple groups of item categories of the candidate items, and preset parameter values, wherein the preset parameter values ​​are preset parameter values ​​for calculating the diversity score, and the diversity score is used to characterize the degree of diversity of the candidate items;

[0008] According to the calculated diversity scores, multiple candidate items in the recommendation system are rearranged to obtain a rearrangement result.

[0009] Optionally, the calculating the diversity score of each candidate item in the candidate item list based on the ranking scores of the candidate items, the multiple groups of item categories of the candidate items, and preset parameter values ​​includes:

[0010] Sorting the candidate items in the candidate item list in descending order of the ranking scores of the candidate items;

[0011] Based on the recommended item list, the multiple groups of item categories of the candidate items and the preset parameter values, the diversity score of each candidate item in the sorted candidate item list is calculated, wherein the initial recommended items in the recommended item list are empty, and the recommended item list is used to store item information of added recommended items, and the added recommended items are candidate items corresponding to the highest scores obtained after each diversity score calculation.

[0012] Optionally, the multiple groups of categories of candidate items include a first group of categories and a second group of categories, the first group of categories is used to characterize the type of candidate items, and the second group of categories is used to characterize the type of recall channel to which the candidate items belong; the preset parameter value includes the total amount of items expected to be recommended, a first weight corresponding to the first group of categories, and a second weight corresponding to the second group of categories, and the first weight is greater than the second weight;

[0013] The calculating, based on the recommended item list, the multiple groups of item categories of the candidate items and the preset parameter values, the diversity score of each candidate item in the sorted candidate item list comprises:

[0014] Calculating a first score of the target candidate item based on the recommended item list, a first group of categories corresponding to the target candidate item, and the first weight, wherein the target candidate item is any candidate item in the sorted candidate item list;

[0015] Calculating a second score for the target candidate item based on the recommended item list, a second group of categories corresponding to the target candidate item, and the second weight;

[0016] The sum of the first score and the second score is determined as the diversity score of the target candidate item.

[0017] Optionally, calculating a first score of the target candidate item based on the recommended item list, a first group of categories corresponding to the target candidate item, and the first weight includes:

[0018] Obtaining a first group of categories included in the recommended item list;

[0019] Determining whether the first group of categories corresponding to the target candidate item belongs to the first group of categories included in the recommended item list;

[0020] In a case where the first group of categories corresponding to the target candidate item belongs to the first group of categories included in the recommended item list, calculating a first score for the target candidate item based on a first position index and the first weight, wherein the first position index is determined based on a position where the first group of categories corresponding to the target candidate item first appears in the recommended item list;

[0021] When the first group of categories corresponding to the target candidate item does not belong to the first group of categories included in the recommended item list, a first score of the target candidate item is calculated based on the total amount of items expected to be recommended and the first weight, wherein the total amount of items expected to be recommended is greater than the value corresponding to the first position index.

[0022] Optionally, calculating a second score of the target candidate item based on the recommended item list, a second group of categories corresponding to the target candidate item, and the second weight includes:

[0023] Obtaining a second group of categories included in the recommended item list;

[0024] Determining whether the second group of categories corresponding to the target candidate item belongs to the second group of categories included in the recommended item list;

[0025] When the second group of categories corresponding to the target candidate item belongs to the second group of categories included in the recommended item list, calculating a second score for the target candidate item based on a second position index and the second weight, wherein the second position index is determined based on a position where the second group of categories corresponding to the target candidate item first appears in the recommended item list;

[0026] When the second group of categories corresponding to the target candidate item does not belong to the second group of categories included in the recommended item list, a second score of the target candidate item is calculated based on the total amount of items expected to be recommended and the second weight, wherein the total amount of items expected to be recommended is greater than the value corresponding to the second position index.

[0027] Optionally, the multiple candidate items in the recommendation system are rearranged according to the calculated diversity scores to obtain a rearrangement result, including:

[0028] According to the calculated diversity score, adding the candidate item with the highest diversity score as a recommended item to the recommended item list, and deleting the candidate item with the highest diversity score from the candidate item list;

[0029] Recalculate the diversity score of each candidate item in the updated candidate item list based on the updated recommended item list, add the candidate item with the highest recalculated diversity score as the recommended item to the recommended item list, and cycle in sequence until the number of recommended items in the recommended item list reaches a target number, thereby obtaining the rearrangement result, wherein the target number is the minimum value between the total amount of initial candidate items in the candidate item list and the total amount of items expected to be recommended.

[0030] Optionally, adding the candidate item with the highest diversity score as a recommended item to the recommended item list according to the calculated diversity score includes:

[0031] Determining, according to the calculated diversity score, a candidate item with the highest diversity score;

[0032] The candidate item with the highest diversity score is added as a recommended item to the first recommended item position in the recommended item list, and the original recommended items in the recommended item list are moved backward in order according to the original position order.

[0033] In a second aspect, the present application provides an item rearrangement device in a recommendation system, the device comprising:

[0034] An acquisition module, configured to acquire a candidate item list, wherein the candidate item list includes item information corresponding to a plurality of candidate items in the recommendation system, and the item information includes ranking scores of the candidate items and a plurality of groups of item categories of the candidate items;

[0035] a calculation module, configured to calculate a diversity score of each candidate item in the candidate item list based on the ranking scores of the candidate items, the multiple groups of item categories of the candidate items, and preset parameter values, wherein the preset parameter values ​​are preset parameter values ​​for calculating the diversity score, and the diversity score is used to characterize the degree of diversity of the candidate items;

[0036] The rearrangement module is used to rearrange multiple candidate items in the recommendation system according to the calculated diversity scores to obtain a rearrangement result.

[0037] In a third aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0038] Memory, used to store computer programs;

[0039] The processor is used to implement the steps of the item rearrangement method in the recommendation system described in any one of the first aspects when executing the program stored in the memory.

[0040] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method for rearranging items in the recommendation system described in any one of the first aspects are implemented.

[0041] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:

[0042] The method provided by the embodiment of the present application obtains a candidate item list, wherein the candidate item list includes item information corresponding to multiple candidate items in the recommendation system, and the item information includes the ranking score of the candidate item and multiple groups of item categories of the candidate item; based on the ranking score of the candidate item, the multiple groups of item categories of the candidate item and the preset parameter value, the diversity score of each candidate item in the candidate item list is calculated, wherein the preset parameter value is a parameter value pre-set for calculating the diversity score, and the diversity score is used to characterize the degree of diversity of the candidate item; according to the calculated diversity score, the multiple candidate items in the recommendation system are rearranged to obtain a rearrangement result. In the above manner, the ranking score of each candidate item, multiple groups of item categories and preset parameter values ​​can be used to calculate the diversity score of each candidate item, and then the degree of diversity of each candidate item can be judged according to the diversity score, so as to achieve item rearrangement, without calculating the similarity of the items based on the feature vector of the item content to achieve item rearrangement, so that even in the scene with a large span of item categories, a better rearrangement result can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0045] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0046] Figure 1 A schematic diagram of a flow chart of a method for rearranging items in a recommendation system provided in an embodiment of the present application;

[0047] Figure 2 A flowchart of another method for rearranging items in a recommendation system provided in an embodiment of the present application;

[0048] Figure 3 A schematic diagram of the structure of an item rearrangement device in a recommendation system provided by the present application;

[0049] Figure 4 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0051] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0052] See also Figure 1 , Figure 1 The following is a flow chart of a method for rearranging items in a recommendation system provided in an embodiment of the present application. Figure 1 As shown, the item rearrangement method in the recommendation system may specifically include the following steps:

[0053] Step 102: Obtain a candidate item list, wherein the candidate item list includes item information corresponding to multiple candidate items in the recommendation system, and the item information includes ranking scores of the candidate items and multiple groups of item categories of the candidate items.

[0054] Specifically, the candidate item list is a list used to store item information corresponding to the candidate items in the recommendation system. The candidate items here may vary depending on the type of recommendation system. For example, when the recommendation system is a recommendation system in a game application, the candidate items may be fashion, good things, museums, bars and other items required by game players; when the recommendation system is a recommendation system in an e-commerce platform, the recommended items may be all or part of the products launched on the e-commerce platform; when the recommendation system is a recommendation system in a video playback application, the recommended items may be all or part of the videos launched in the video playback application, and so on.

[0055] The above-mentioned item information at least includes the ranking score of the candidate item and multiple groups of item categories of the candidate item. The ranking score of the candidate item here refers to the score obtained by scoring the candidate item according to the ranking model in the ranking stage. The multiple groups of item categories of the candidate item here refer to 2 groups or more than 2 groups of item categories of the candidate item, which may include but are not limited to the type to which the candidate item belongs, the type of recall channel to which the candidate item belongs, etc.

[0056] The method of obtaining the candidate item list can be obtained by artificial presetting, or can be obtained according to the ranking model score in the ranking stage. When the list is obtained according to the ranking model score in the ranking stage, the ranking model scores can be sorted from high to low, and a preset number of items with top scores can be selected as candidate items, thereby combining the item information of the selected candidate items into a list to form a candidate item list.

[0057] Step 104: Calculate the diversity score of each candidate item in the candidate item list based on the ranking scores of the candidate items, multiple groups of item categories of the candidate items, and preset parameter values, wherein the preset parameter values ​​are pre-set parameter values ​​for calculating the diversity score, and the diversity score is used to characterize the degree of diversity of the candidate items.

[0058] Specifically, the preset parameter values ​​are pre-set parameter values ​​for calculating the diversity score, which may include but are not limited to the total amount of items expected to be recommended, the weight corresponding to each category in multiple groups of item categories, etc. The diversity score is used to characterize the diversity of the candidate items, that is, the higher the diversity score, the higher the diversity between the candidate items and the items to be recommended; the lower the diversity score, the lower the diversity between the candidate items and the items to be recommended.

[0059] Step 106: Rearrange multiple candidate items in the recommendation system according to the calculated diversity scores to obtain a rearrangement result.

[0060] Specifically, the above rearrangement results can be used to characterize the recommended items and the recommendation order that are finally recommended to the user.

[0061] In this step, after calculating the diversity score of each candidate item in the candidate item list, the order of each candidate item can be rearranged according to the diversity score of each candidate item to obtain a rearrangement result. In this way, it can be ensured that the recommended items finally recommended to the user are items that the user is interested in and have diversity.

[0062] In this embodiment, the diversity score of each candidate item can be calculated using the ranking score of each candidate item, multiple groups of item categories and preset parameter values, and then the diversity degree of each candidate item can be judged according to the diversity score to achieve item rearrangement, without having to calculate the similarity of the items based on the feature vectors of the item contents to achieve item rearrangement. Therefore, even in scenarios with a large span of item categories, better rearrangement results can be obtained.

[0063] Furthermore, the above step 104, based on the ranking scores of the candidate items, the multiple groups of item categories of the candidate items and the preset parameter values, calculates the diversity score of each candidate item in the candidate item list, specifically including:

[0064] Sort the candidate items in the candidate item list in descending order of their ranking scores;

[0065] Based on the recommended item list, multiple groups of item categories of candidate items and preset parameter values, the diversity score of each candidate item in the sorted candidate item list is calculated, wherein the initial recommended items in the recommended item list are empty, and the recommended item list is used to store the item information of the added recommended items, and the added recommended items are the candidate items corresponding to the highest scores obtained after each diversity score calculation.

[0066] Specifically, the recommended item list may be used to store the item information of the recommended items added after each diversity scoring, and finally the item information of the recommended items in the list is output as the rearrangement result.

[0067] In one embodiment, when calculating the diversity score of each candidate item in the candidate item list, it is necessary to first sort the candidate items in the candidate item list in order of their ranking scores from high to low, that is, sort each candidate item from high to low according to the user's interest level, and then calculate the diversity score of each candidate item in the sorted candidate item list based on the recommended item list, multiple groups of item categories of the candidate items and preset parameter values. The reason for doing so is that the ranking of each candidate item in the candidate item list will affect the subsequent calculation results of the diversity score. Only in this way can it be ensured that the items recommended to the user first are diverse and are also the items that the user is most interested in. This will be specifically explained in the subsequent embodiments and will not be repeated here.

[0068] Furthermore, the multiple groups of item categories of the candidate items include a first group of categories and a second group of categories, the first group of categories is used to characterize the type to which the candidate items belong, and the second group of categories is used to characterize the type of recall channel to which the candidate items belong; the preset parameter values ​​include the total amount of items expected to be recommended, a first weight corresponding to the first group of categories, and a second weight corresponding to the second group of categories, the first weight being greater than the second weight;

[0069] The above steps, based on the recommended item list, multiple groups of item categories of candidate items and preset parameter values, calculate the diversity score of each candidate item in the sorted candidate item list, specifically including:

[0070] Calculate a first score of the target candidate item based on the recommended item list, a first group of categories corresponding to the target candidate item, and a first weight, wherein the target candidate item is any candidate item in the sorted candidate item list;

[0071] Calculating a second score for the target candidate item based on the recommended item list, the second group of categories corresponding to the target candidate item, and the second weight;

[0072] The sum of the first score and the second score is determined as the diversity score of the target candidate item.

[0073] Specifically, the type of candidate items refers to the attribute type of candidate items. For example, in a recommendation system in a game application, the type of candidate items can be any one of fashion, good stuff, museum, bar, etc. The recall channel type to which the candidate items belong refers to the type of recall algorithm used when recalling the candidate items in the recall phase, such as content-based recall, collaborative filtering recall (such as ItemCF algorithm, UserCF algorithm, etc.), embedding-based recall (such as the twin tower model recall algorithm, etc.), rule-based recall (such as geographic location-based recall algorithm, author-based recall algorithm, etc.).

[0074] The total amount of items expected to be recommended refers to the number of recommended items expected to be obtained in the rearrangement result. The first weight and the second weight can be set according to actual needs and are not limited here. In an optional embodiment, in order to make the first group of categories play a leading role in diversity and the second group of categories play a secondary role in diversity, the value of the first weight can be set much larger than the value of the second weight, such as the value of the first weight is 100, the value of the second weight is 1, etc.

[0075] In one embodiment, the multiple groups of item categories of the candidate items include a first group of categories and a second group of categories, and thus scores can be calculated respectively according to the first group of categories and the second group of categories, thereby obtaining a diversity score for each candidate item. Specifically, the first score of the target candidate item can be calculated based on the recommended item list, the first group of categories corresponding to the target candidate item, and the first weight, and the second score of the target candidate item can be calculated based on the recommended item list, the second group of categories corresponding to the target candidate item, and the second weight, and then the sum of the first score and the second score can be determined as the diversity score of the target candidate item. In the above manner, the diversity score of each candidate item can be accurately calculated according to the first group of categories and the second group of categories of each candidate item, so that the candidate items can be accurately rearranged.

[0076] Furthermore, the above step of calculating the first score of the target candidate item based on the recommended item list, the first group of categories corresponding to the target candidate item, and the first weight specifically includes:

[0077] Get the first set of categories included in the recommended items list;

[0078] Determine whether the first group of categories corresponding to the target candidate item belongs to the first group of categories included in the recommended item list;

[0079] In a case where the first group of categories corresponding to the target candidate item belongs to the first group of categories included in the recommended item list, calculating a first score of the target candidate item based on a first position index and a first weight, wherein the first position index is determined based on a position where the first group of categories corresponding to the target candidate item first appears in the recommended item list;

[0080] When the first group of categories corresponding to the target candidate item does not belong to the first group of categories included in the recommended item list, a first score of the target candidate item is calculated based on a total amount of items expected to be recommended and a first weight, wherein the total amount of items expected to be recommended is greater than a value corresponding to the first position index.

[0081] In one embodiment, when calculating the first score of the target candidate item, the first group of categories included in the recommended item list can be first obtained, and then a determination can be made as to whether the first group of categories corresponding to the target candidate item belongs to the first group of categories included in the recommended item list; if the first group of categories corresponding to the target candidate item belongs to the first group of categories included in the recommended item list, the first score of the target candidate item is calculated based on the first position index and the first weight; if the first group of categories corresponding to the target candidate item does not belong to the first group of categories included in the recommended item list, the first score of the target candidate item is calculated based on the total amount of items expected to be recommended and the first weight.

[0082] It should be noted that, since the total amount of items expected to be recommended is greater than the value corresponding to the first position index, the first score calculated in the scenario where the first group of categories corresponding to the target candidate item does not belong to the first group of categories included in the recommended item list is greater than the first score calculated in the scenario where the first group of categories corresponding to the target candidate item belongs to the first group of categories included in the recommended item list. In other words, if the first group of categories corresponding to the target candidate item already exists in the recommended item list, the calculated first score is low; if it does not yet exist in the recommended item list, the calculated first score is high, so that the first group of categories corresponding to the target candidate item can be minimized from appearing repeatedly in the recommended item list. Furthermore, when the first group of categories corresponding to the target candidate item belongs to the first group of categories included in the recommended item list, the first score of the target candidate item is calculated based on the first position index and the first weight, rather than using the position index where the first group of categories corresponding to the target candidate item appears for the second, third, etc. time in the recommended item list for calculation. This is because the first position index is smaller than the values ​​of other position indexes, and the first score calculated therefrom is also smaller. In this way, the first score calculated in the scenario where the first group of categories corresponding to the target candidate item belongs to the first group of categories included in the recommended item list can be further reduced, thereby further preventing the first group of categories corresponding to the target candidate item from appearing repeatedly in the recommended item list.

[0083] In this embodiment, the first score is calculated by determining whether the first group of categories corresponding to the target candidate item belongs to the first group of categories included in the recommended item list. The first score can be used to prevent the first group of categories corresponding to the target candidate item from appearing repeatedly in the recommended item list as much as possible, thereby ensuring the diversity of the first group of categories.

[0084] Furthermore, the above step of calculating the second score of the target candidate item based on the recommended item list, the second group of categories corresponding to the target candidate item and the second weight specifically includes:

[0085] Get the second set of categories included in the recommended item list;

[0086] Determine whether the second group of categories corresponding to the target candidate item belongs to the second group of categories included in the recommended item list;

[0087] In a case where the second group of categories corresponding to the target candidate item belongs to the second group of categories included in the recommended item list, calculating a second score for the target candidate item based on a second position index and a second weight, wherein the second position index is determined based on a position where the second group of categories corresponding to the target candidate item first appears in the recommended item list;

[0088] When the second group of categories corresponding to the target candidate item does not belong to the second group of categories included in the recommended item list, a second score of the target candidate item is calculated based on the total amount of items expected to be recommended and the second weight, wherein the total amount of items expected to be recommended is greater than the value corresponding to the second position index.

[0089] In one embodiment, when calculating the second score of the target candidate item, the second group of categories included in the recommended item list can be first obtained, and then a determination can be made as to whether the second group of categories corresponding to the target candidate item belongs to the second group of categories included in the recommended item list; if the second group of categories corresponding to the target candidate item belongs to the second group of categories included in the recommended item list, the second score of the target candidate item is calculated based on the second position index and the second weight; if the second group of categories corresponding to the target candidate item does not belong to the second group of categories included in the recommended item list, the second score of the target candidate item is calculated based on the total amount of items expected to be recommended and the second weight.

[0090] It should be noted that, since the total amount of items expected to be recommended is greater than the value corresponding to the second position index, the second score calculated in the scenario where the second group of categories corresponding to the target candidate item does not belong to the second group of categories included in the recommended item list is greater than the second score calculated in the scenario where the second group of categories corresponding to the target candidate item belongs to the second group of categories included in the recommended item list. In other words, if the second group of categories corresponding to the target candidate item already exists in the recommended item list, the calculated second score is low; if it does not yet exist in the recommended item list, the calculated second score is high, so that the second group of categories corresponding to the target candidate item can be minimized from appearing repeatedly in the recommended item list. Furthermore, when the second group of categories corresponding to the target candidate item belongs to the second group of categories included in the recommended item list, the second score of the target candidate item is calculated based on the second position index and the second weight, rather than using the position index where the second group of categories corresponding to the target candidate item appears for the second, third, etc. time in the recommended item list for calculation. This is because the second position index is smaller than other position indexes, and the second score calculated therefrom is also smaller. In this way, the second score calculated in the scenario where the second group of categories corresponding to the target candidate item belongs to the second group of categories included in the recommended item list can be further reduced, thereby further preventing the second group of categories corresponding to the target candidate item from appearing repeatedly in the recommended item list.

[0091] In this embodiment, the second score is calculated by judging whether the second group of categories corresponding to the target candidate item belongs to the second group of categories included in the recommended item list. The second score can be used to avoid duplication of the second group of categories corresponding to the target candidate item in the recommended item list, thereby ensuring the diversity of the second group of categories.

[0092] Furthermore, the above step 106, according to the calculated diversity scores, re-ranks the multiple candidate items in the recommendation system to obtain a re-ranking result, specifically including:

[0093] According to the calculated diversity scores, the candidate items with the highest diversity scores are added as recommended items to the recommended item list, and the candidate items with the highest diversity scores are deleted from the candidate item list;

[0094] The diversity score of each candidate item in the updated candidate item list is recalculated based on the updated recommended item list, and the candidate item with the highest recalculated diversity score is added as the recommended item to the recommended item list. The process is repeated until the number of recommended items in the recommended item list reaches the target number, thereby obtaining the rearrangement result, where the target number is the minimum value between the total number of initial candidate items in the candidate item list and the total number of items expected to be recommended.

[0095] In one embodiment, when multiple candidate items in the recommendation system are rearranged, the candidate item with the highest diversity score can be added to the recommended item list as a recommended item based on the diversity score calculated for each candidate item, and the candidate item with the highest diversity score can be deleted from the candidate item list, and then the diversity score of each candidate item in the updated candidate item list can be recalculated based on the updated recommended item list, and the candidate item with the highest diversity score recalculated can be added to the recommended item list as a recommended item, and the process can be repeated until the number of recommended items in the recommended item list reaches the target number, thereby obtaining a rearrangement result. In this way, the candidate item with the highest diversity score obtained by each diversity score calculation can be added to the recommended item list, and finally a rearrangement result is formed.

[0096] For example, suppose the list of candidate items is sorted in descending order of their ranking scores as follows:

[0097] [{'score':0.99,'category':'A','call_from':'p','index':0},

[0098] {'score':0.92,'category':'B','call_from':'P','index':1},

[0099] {'score':0.89,'category':'C','call_from':'Q','index':2},

[0100] {'score':0.81,'category':'D','call_from':'M','index':3},

[0101] {'score':0.79,'category':'D','call_from':'M','index':4},

[0102] {'score':0.75,'category':'B','call_from':'M','index':5},

[0103] {'score':0.69,'category':'D','call_from':'M','index':6},

[0104] {'score':0.65,'category':'A','call_from':'M','index':7},

[0105] {'score':0.64,'category':'A','call_from':'N','index':8},

[0106] {'score':0.59,'category':'D','call_from':'M','index':9},

[0107] {'score':0.59,'category':'D','call_from':'N','index':10},

[0108] {'score':0.51,'category':'B','call_from':'Q','index':11},

[0109] {'score':0.46,'category':'B','call_from':'M','index':12},

[0110] {'score':0.44,'category':'A','call_from':'N','index':13},

[0111] {'score':0.31,'category':'A','call_from':'P','index':14},

[0112] {'score':0.19,'category':'C','call_from':'M','index':15},

[0113] {'score':0.14,'category':'C','call_from':'P','index':16},

[0114] {'score':0.14,'category':'B','call_from':'M','index':17},

[0115] {'score':0.13,'category':'A','call_from':'Q','index':18},

[0116] {'score':0.0,'category':'C','call_from':'N','index':19}]

[0117] Each row represents the item information corresponding to a candidate item, score represents the ranking score of the candidate item, category represents the type of the candidate item, and call_from represents the recall channel type to which the candidate item belongs.

[0118] When performing the first round of diversity score calculation, since the recommended item list is empty at this time, the first score of each candidate item in the candidate item list is calculated based on the total number of items expected to be recommended and the first weight, and the second score is calculated based on the total number of items expected to be recommended and the second weight. Assuming that the item information of the candidate item with the highest diversity score calculated is {'score':0.0,'category':'C','call_from':'N','index':19} in the candidate item list, it will be added to the recommended item list and deleted from the candidate item list.

[0119] When performing the second round of diversity score calculation, since there is already a recommended item in the recommended item list, when calculating the diversity scores of the remaining candidate items in the candidate item list, it is necessary to compare the category of each candidate item with the category field in the recommended item list. If the category of the candidate item is C, the first score of the candidate item is calculated based on the first position index and the first weight; if the category of the candidate item is not C, the first score of the candidate item is calculated based on the total amount of items expected to be recommended and the first weight. Similarly, compare the call_from of each candidate item with the call_from field in the recommended item list. If the call_from of the candidate item is N, the second score of the candidate item is calculated based on the second position index and the second weight; if the call_from of the candidate item is not N, the second score of the candidate item is calculated based on the total amount of items expected to be recommended and the second weight, thereby obtaining the diversity score of each candidate item. Assuming that the item information of the candidate item with the highest diversity score calculated in this round is {'score':0.31,'category':'A','call_from':'P','index':14} in the candidate item list, add it to the recommended item list and delete it from the candidate item list.

[0120] When performing the third round of diversity score calculation, since there are already two recommended items in the recommended item list, when calculating the diversity scores of the remaining candidate items in the candidate item list, it is necessary to compare the category of each candidate item with the category field in the recommended item list. If the category of the candidate item is C or A, the first score of the candidate item is calculated based on the first position index and the first weight; if the category of the candidate item is not C or A, the first score of the candidate item is calculated based on the total number of items expected to be recommended and the first weight. Similarly, compare the call_from of each candidate item with the call_from field in the recommended item list. If the call_from of the candidate item is N or P, the second score of the candidate item is calculated based on the second position index and the second weight; if the call_from of the candidate item is not N or P, the second score of the candidate item is calculated based on the total number of items expected to be recommended and the second weight, thereby obtaining the diversity score of each candidate item. Assuming that the item information of the candidate item with the highest diversity score calculated in this round is {'score':0.51,'category':'B','call_from':'Q','index':11} in the candidate item list, add it to the recommended item list and delete it from the candidate item list.

[0121] The same method as above is used to loop until the number of recommended items in the recommended item list reaches the target number. Assuming the target number in this example is 10, the 10 candidate items with the highest diversity scores can be selected in turn and added to the recommended item list as the rearrangement result, as shown below:

[0122] [{'score':0.99,'category':'A','call_from':'p','index':0},

[0123] {'score':0.89,'category':'C','call_from':'Q','index':2},

[0124] {'score':0.81,'category':'D','call_from':'M','index':3},

[0125] {'score':0.92,'category':'B','call_from':'P','index':1},

[0126] {'score':0.64,'category':'A','call_from':'N','index':8},

[0127] {'score':0.19,'category':'C','call_from':'M','index':15},

[0128] {'score':0.59,'category':'D','call_from':'N','index':10},

[0129] {'score':0.51,'category':'B','call_from':'Q','index':11},

[0130] {'score':0.31,'category':'A','call_from':'P','index':14},

[0131] {'score':0.0,'category':'C','call_from':'N','index':19}]

[0132] It should be noted that the target number here is the minimum value between the total number of initial candidate items in the candidate item list and the total number of items expected to be recommended. For example, when the total number of initial candidate items is 20 and the total number of items expected to be recommended is 100, the target number is 20; when the total number of initial candidate items is 20 and the total number of items expected to be recommended is 10, the target number is 10. In the process of cyclically calculating the diversity score, it is necessary to determine whether the number of recommended items in the recommended item list has reached the target number. If the number of recommended items in the recommended item list has not reached the target number, the diversity score will continue to be calculated, and the candidate item with the highest recalculated diversity score will be added as a recommended item to the recommended item list; if the number of recommended items in the recommended item list has reached the target number, the diversity score calculation will stop.

[0133] In this embodiment, the recommended item list and the candidate item list can be updated after each diversity score calculation, and then the diversity score calculation is re-performed based on the updated recommended item list and candidate item list, thereby selecting the candidate item with the highest diversity score each time to obtain a rearrangement result, thereby ensuring the diversity of items in the rearrangement result.

[0134] Furthermore, the above steps, based on the calculated diversity scores, add the candidate items with the highest diversity scores as recommended items to the recommended item list, specifically include:

[0135] According to the calculated diversity scores, the candidate items with the highest diversity scores are determined;

[0136] The candidate item with the highest diversity score is added as the recommended item to the first recommended item in the recommended item list, and the original recommended items in the recommended item list are moved back in order according to the original position order.

[0137] It should be noted that when determining the first position index and the second position index, the first group of categories of the target candidate item is compared with the first group of categories of each recommended item in the recommended item list in turn, and the list is traversed from front to back to find the first position of the first group of categories corresponding to the target candidate item in the recommended item list, thereby obtaining the first position index; the second group of categories of the target candidate item is compared with the second group of categories of each recommended item in the recommended item list in turn, and the list is traversed from front to back to find the first position of the second group of categories corresponding to the target candidate item in the recommended item list, thereby obtaining the second position index. It can be seen that the closer the first appearance position is, the smaller the values ​​of the first position index and the second position index are; the closer the first appearance position is, the larger the values ​​of the first position index and the second position index are.

[0138] In one embodiment, each time a candidate item with the highest diversity score is added as a recommended item to a recommended item list, the candidate item with the highest diversity score can be added as a recommended item to the position of the first recommended item in the recommended item list, and the original recommended items in the recommended item list are moved backward in sequence according to the original position order. The advantage of this is that each newly added recommended item will be at the front of the recommended item list, so that when the first position index and the second position index are determined in the subsequent diversity calculation, the first position index and the second position index corresponding to the candidate item of the same category as the newly added recommended item will be low, and its diversity score will also be low; the first position index and the second position index corresponding to the candidate item of a different category from the newly added recommended item will be high, and its diversity score will also be high, thereby further avoiding the repetition of items of the same category in the recommended item list and improving the diversity of the recommended items in the recommended item list.

[0139] In one embodiment, the following preset parameter values ​​may be preset:

[0140] Col_score: The data type is string str, which means the key of the dictionary corresponding to score. The default value is "score". In practical applications, it means the score calculated by the ranking model (equivalent to the ranking score of the candidate items mentioned above).

[0141] Col_main_cat: The data type is string str, meaning the main category used for diversity. The default value is "category". In practical applications, it means the category to which the item belongs (equivalent to the first group of categories mentioned above).

[0142] Col_second_cat: The data type is string str, which means the subcategory used for diversity. The default value is "channel". In practical applications, it means which recall channel the item comes from (equivalent to the second group of categories mentioned above).

[0143] Weight_main: The data type is a floating point number, which means the weight of the main category in the diversity score. The default value is 100 (equivalent to the first weight mentioned above).

[0144] Weight_second: The data type is a floating point number, which means the weight of the sub-category in the diversity score. The default value is 1 (equivalent to the second weight mentioned above).

[0145] Topk: The data type is an integer int, which means the number of items that are finally retained. The default value is 1000 (equivalent to the total number of items expected to be recommended as mentioned above).

[0146] The specific process of the item rearrangement method in the recommendation system is as follows Figure 2 As shown, the following steps may be included:

[0147] Step 201: sort the samples list (equivalent to the candidate item list) from high to low according to their Col_score.

[0148] The function called during sorting is samples = sorted(samples, key = lambda x:x[Col_score], reverse = True). The data type of samples is a list list, each sample is an element, each element is a dictionary, and each dictionary contains at least information such as score, main category main_cat(egory), and subcategory second_cat(egory).

[0149] Step 202: Calculate the length of the final sorting result. The length of the final sorting result, expected_length, is the smaller value between the length of Topk and the length of the samples list. The function called is expected_length = min (self.topk, len (samples)).

[0150] Step 203: Initialize the gallery list (equivalent to the above-mentioned recommended item list) to an empty list, that is, gallery = [].

[0151] Step 204: Calculate the diversity score scores of each element in the samples list and the elements in the gallery list, scores = diverse_score (gallery, samples). Diverse_score is a function whose input is the gallery list and the sorted samples list, and whose output is the diversity score of each element in the samples list and the elements in the gallery list. Specifically, the calculation process of the function diverse_score (gallery, samples) is as follows:

[0152] 1) Extract the main category list from the gallery list and call the function gallery_main_reversed = [each [Col_main_cat] for each in gallery][::-1].

[0153] 2) Extract the sub-category list from the gallery list and call the function gallery_second_reversed = [each[Col_second_cat]for each in gallery][::-1].

[0154] 3) Initialize scores to an empty list, that is, scores = [].

[0155] 4) For each element query in the samples list (equivalent to the candidate items mentioned above), perform the following operations:

[0156] Get the query main category: query_main = query[Col_main_cat];

[0157] Get query subcategory: query_second = query[Col_second_cat];

[0158] Calculate the diversity score of the main category: if query_main is in gallery_main_reversed, then score_main = gallery_main_reversed.index(query_main)*Weight_main, that is, the index of the position where query_main first appears in gallery_main_reversed multiplied by the weight Weight_main of the main category in the diversity score; if query_main is not in gallery_main_reversed, score_main = Topk*Weight_main, that is, the number of items finally retained Topk multiplied by the weight Weight_main of the main category in the diversity score.

[0159] Calculate the subcategory diversity score: if query_second is in gallery_second_reversed, then score_second = gallery_second_reversed.index(query_second)*Weight_second, that is, the index of the position where query_second first appears in gallery_second_reversed multiplied by the weight Weight_second of the subcategory in the diversity score; if query_second is not in gallery_second_reversed, score_second = Topk*Weight_second, that is, the number of items finally retained Topk multiplied by the weight Weight_second of the subcategory in the diversity score.

[0160] Calculate the total diversity score: score = score_main + score_second.

[0161] 5) Add the diversity score score to the list scores.

[0162] 6) Return the list scores.

[0163] Step 205: Calculate the maximum score in the list scores. The function called is max_score = max(scores).

[0164] Step 206: Calculate the first index subscript corresponding to the maximum score. The function called is the_index = scores.index(max_score).

[0165] Step 207: Get the element corresponding to the maximum score. The function called is the_one=samples[the_index].

[0166] Step 208: Add the element corresponding to the maximum score to the result gallery list. The function called is gallery.append(the_one).

[0167] Step 209: Delete the element corresponding to the maximum score from the samples list. The function called is delsamples[the_index].

[0168] Step 210: Determine whether the number of elements in the gallery list reaches expected_length.

[0169] If the number of elements in the gallery list is less than expected_length, return to step 204; otherwise, execute step 211.

[0170] Step 211: Return the gallery list as the final rearrangement result output.

[0171] It should be noted that the above steps 201 to 203 can be performed simultaneously or sequentially. When performed sequentially, they can be performed in any order, which is not limited in the embodiment of the present application.

[0172] In this way, the diversity can be effectively scattered and rearranged based on item categories and their recall channels, thereby increasing the diversity of items and thus improving user experience.

[0173] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of an item rearrangement device in a recommendation system provided by this application. Figure 3 As shown, the device 300 includes:

[0174] An acquisition module 302 is used to acquire a candidate item list, wherein the candidate item list includes item information corresponding to multiple candidate items in the recommendation system, and the item information includes ranking scores of the candidate items and multiple groups of item categories of the candidate items;

[0175] A calculation module 304, configured to calculate a diversity score of each candidate item in the candidate item list based on the ranking scores of the candidate items, multiple groups of item categories of the candidate items, and preset parameter values, wherein the preset parameter values ​​are pre-set parameter values ​​for calculating the diversity score, and the diversity score is used to characterize the degree of diversity of the candidate items;

[0176] The rearrangement module 306 is used to rearrange multiple candidate items in the recommendation system according to the calculated diversity scores to obtain a rearrangement result.

[0177] Furthermore, the calculation module 304 includes:

[0178] A sorting submodule, for sorting the candidate items in the candidate item list in descending order of their ranking scores;

[0179] The calculation submodule is used to calculate the diversity score of each candidate item in the sorted candidate item list based on the recommended item list, multiple groups of item categories of the candidate items and preset parameter values, wherein the initial recommended items in the recommended item list are empty, and the recommended item list is used to store the item information of the added recommended items, and the added recommended items are the candidate items corresponding to the highest scores obtained after each diversity score calculation.

[0180] Furthermore, the multiple groups of categories of candidate items include a first group of categories and a second group of categories, the first group of categories is used to characterize the type of candidate items, and the second group of categories is used to characterize the type of recall channel to which the candidate items belong; the preset parameter values ​​include the total amount of items expected to be recommended, a first weight corresponding to the first group of categories, and a second weight corresponding to the second group of categories, the first weight being greater than the second weight; the calculation submodule includes:

[0181] A first calculation unit, configured to calculate a first score of a target candidate item based on the recommended item list, a first group of categories corresponding to the target candidate item, and a first weight, wherein the target candidate item is any candidate item in the sorted candidate item list;

[0182] a second calculation unit, configured to calculate a second score of the target candidate item based on the recommended item list, a second group of categories corresponding to the target candidate item, and a second weight;

[0183] The first determining unit is configured to determine the sum of the first score and the second score as the diversity score of the target candidate item.

[0184] Furthermore, the first computing unit is specifically configured to:

[0185] Get the first set of categories included in the recommended items list;

[0186] Determine whether the first group of categories corresponding to the target candidate item belongs to the first group of categories included in the recommended item list;

[0187] In a case where the first group of categories corresponding to the target candidate item belongs to the first group of categories included in the recommended item list, calculating a first score of the target candidate item based on a first position index and a first weight, wherein the first position index is determined based on a position where the first group of categories corresponding to the target candidate item first appears in the recommended item list;

[0188] When the first group of categories corresponding to the target candidate item does not belong to the first group of categories included in the recommended item list, a first score of the target candidate item is calculated based on a total amount of items expected to be recommended and a first weight, wherein the total amount of items expected to be recommended is greater than a value corresponding to the first position index.

[0189] Furthermore, the second computing unit is specifically configured to:

[0190] Get the second set of categories included in the recommended item list;

[0191] Determine whether the second group of categories corresponding to the target candidate item belongs to the second group of categories included in the recommended item list;

[0192] In a case where the second group of categories corresponding to the target candidate item belongs to the second group of categories included in the recommended item list, calculating a second score for the target candidate item based on a second position index and a second weight, wherein the second position index is determined based on a position where the second group of categories corresponding to the target candidate item first appears in the recommended item list;

[0193] When the second group of categories corresponding to the target candidate item does not belong to the second group of categories included in the recommended item list, a second score of the target candidate item is calculated based on the total amount of items expected to be recommended and the second weight, wherein the total amount of items expected to be recommended is greater than the value corresponding to the second position index.

[0194] Further, the rearrangement module 306 includes:

[0195] a processing submodule, for adding the candidate item with the highest diversity score as a recommended item to the recommended item list according to the calculated diversity score, and deleting the candidate item with the highest diversity score from the candidate item list;

[0196] The loop submodule is used to recalculate the diversity score of each candidate item in the updated candidate item list based on the updated recommended item list, add the candidate item with the highest recalculated diversity score as the recommended item to the recommended item list, and loop in sequence until the number of recommended items in the recommended item list reaches the target number, so as to obtain the rearrangement result, wherein the target number is the minimum value between the total number of initial candidate items in the candidate item list and the total number of items expected to be recommended.

[0197] Furthermore, the processing submodule includes:

[0198] A second determination unit, configured to determine a candidate item with a highest diversity score according to the calculated diversity score;

[0199] The adding unit is used to add the candidate item with the highest diversity score as a recommended item to the first recommended item in the recommended item list, and to sequentially move the original recommended items in the recommended item list backward according to the original position order.

[0200] It should be noted that the device 300 can implement the steps of the item rearrangement method in the recommendation system provided by any of the aforementioned method embodiments, and can achieve the same technical effects, which will not be described one by one here.

[0201] like Figure 4 As shown, the embodiment of the present application further provides an electronic device, including a processor 411, a communication interface 412, a memory 413 and a communication bus 414, wherein the processor 411, the communication interface 412, and the memory 413 communicate with each other through the communication bus 414;

[0202] Memory 413, used for storing computer programs;

[0203] In one embodiment of the present application, the processor 411 is configured to execute the program stored in the memory 413 to implement the method for rearranging items in the recommendation system provided by any one of the aforementioned method embodiments, including:

[0204] Obtaining a candidate item list, wherein the candidate item list includes item information corresponding to multiple candidate items in the recommendation system, and the item information includes ranking scores of the candidate items and multiple groups of item categories of the candidate items;

[0205] Calculating a diversity score for each candidate item in the candidate item list based on the ranking scores of the candidate items, multiple groups of item categories of the candidate items, and preset parameter values, wherein the preset parameter values ​​are pre-set parameter values ​​for calculating the diversity score, and the diversity score is used to characterize the degree of diversity of the candidate items;

[0206] According to the calculated diversity scores, multiple candidate items in the recommendation system are rearranged to obtain a rearrangement result.

[0207] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for rearranging items in a recommendation system provided in any of the aforementioned method embodiments are implemented.

[0208] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0209] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0210] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0211] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.

Claims

1. A method for rearranging items in a recommendation system, characterized in that: The method comprises: Obtaining a candidate item list, wherein the candidate item list includes item information corresponding to a plurality of candidate items in the recommendation system, and the item information includes ranking scores of the candidate items and a plurality of groups of item categories of the candidate items; Calculating a diversity score for each candidate item in the candidate item list based on the ranking scores of the candidate items, the multiple groups of item categories of the candidate items, and preset parameter values, wherein the preset parameter values ​​are preset parameter values ​​for calculating the diversity score, and the diversity score is used to characterize the degree of diversity of the candidate items; According to the calculated diversity scores, multiple candidate items in the recommendation system are rearranged to obtain a rearrangement result.

2. The method according to claim 1, characterized in that The calculating the diversity score of each candidate item in the candidate item list based on the ranking score of the candidate items, the multiple groups of item categories of the candidate items and the preset parameter values ​​includes: Sorting the candidate items in the candidate item list in descending order of the ranking scores of the candidate items; Based on the recommended item list, the multiple groups of item categories of the candidate items and the preset parameter values, the diversity score of each candidate item in the sorted candidate item list is calculated, wherein the initial recommended items in the recommended item list are empty, and the recommended item list is used to store item information of added recommended items, and the added recommended items are candidate items corresponding to the highest scores obtained after each diversity score calculation.

3. The method according to claim 2, characterized in that The multiple groups of categories of candidate items include a first group of categories and a second group of categories, the first group of categories is used to characterize the type of candidate items, and the second group of categories is used to characterize the type of recall channel to which the candidate items belong; the preset parameter values ​​include the total amount of items expected to be recommended, a first weight corresponding to the first group of categories, and a second weight corresponding to the second group of categories, wherein the first weight is greater than the second weight; The calculating, based on the recommended item list, the multiple groups of item categories of the candidate items and the preset parameter values, the diversity score of each candidate item in the sorted candidate item list comprises: Calculating a first score of the target candidate item based on the recommended item list, a first group of categories corresponding to the target candidate item, and the first weight, wherein the target candidate item is any candidate item in the sorted candidate item list; Calculating a second score for the target candidate item based on the recommended item list, a second group of categories corresponding to the target candidate item, and the second weight; The sum of the first score and the second score is determined as the diversity score of the target candidate item.

4. The method according to claim 3, characterized in that The calculating a first score of the target candidate item based on the recommended item list, a first group of categories corresponding to the target candidate item, and the first weight includes: Obtaining a first group of categories included in the recommended item list; Determining whether the first group of categories corresponding to the target candidate item belongs to the first group of categories included in the recommended item list; In a case where the first group of categories corresponding to the target candidate item belongs to the first group of categories included in the recommended item list, calculating a first score of the target candidate item based on a first position index and the first weight, wherein the first position index is determined based on a position where the first group of categories corresponding to the target candidate item first appears in the recommended item list; When the first group of categories corresponding to the target candidate item does not belong to the first group of categories included in the recommended item list, a first score of the target candidate item is calculated based on the total amount of items expected to be recommended and the first weight, wherein the total amount of items expected to be recommended is greater than the value corresponding to the first position index.

5. The method according to claim 3, characterized in that: The calculating a second score of the target candidate item based on the recommended item list, a second group of categories corresponding to the target candidate item, and the second weight includes: Obtaining a second group of categories included in the recommended item list; Determining whether the second group of categories corresponding to the target candidate item belongs to the second group of categories included in the recommended item list; When the second group of categories corresponding to the target candidate item belongs to the second group of categories included in the recommended item list, calculating a second score for the target candidate item based on a second position index and the second weight, wherein the second position index is determined based on a position where the second group of categories corresponding to the target candidate item first appears in the recommended item list; When the second group of categories corresponding to the target candidate item does not belong to the second group of categories included in the recommended item list, a second score of the target candidate item is calculated based on the total amount of items expected to be recommended and the second weight, wherein the total amount of items expected to be recommended is greater than the value corresponding to the second position index.

6. The method according to claim 3, characterized in that The step of rearranging the plurality of candidate items in the recommendation system according to the calculated diversity scores to obtain a rearrangement result includes: According to the calculated diversity score, adding the candidate item with the highest diversity score as a recommended item to the recommended item list, and deleting the candidate item with the highest diversity score from the candidate item list; The diversity score of each candidate item in the updated candidate item list is recalculated based on the updated recommended item list, and the candidate item with the highest recalculated diversity score is added as the recommended item to the recommended item list, and the process is repeated until the number of recommended items in the recommended item list reaches a target number, thereby obtaining the rearrangement result, wherein the target number is the minimum value between the total number of initial candidate items in the candidate item list and the total number of items expected to be recommended.

7. The method according to claim 6, characterized in that The step of adding the candidate item with the highest diversity score as a recommended item to the recommended item list according to the calculated diversity score includes: Determining, according to the calculated diversity score, a candidate item with the highest diversity score; The candidate item with the highest diversity score is added as a recommended item to the first recommended item position in the recommended item list, and the original recommended items in the recommended item list are moved backward in order according to the original position order.

8. An item rearrangement device in a recommendation system, characterized in that: The device comprises: An acquisition module, configured to acquire a candidate item list, wherein the candidate item list includes item information corresponding to a plurality of candidate items in the recommendation system, and the item information includes ranking scores of the candidate items and a plurality of groups of item categories of the candidate items; a calculation module, configured to calculate a diversity score of each candidate item in the candidate item list based on the ranking scores of the candidate items, the multiple groups of item categories of the candidate items, and preset parameter values, wherein the preset parameter values ​​are preset parameter values ​​for calculating the diversity score, and the diversity score is used to characterize the degree of diversity of the candidate items; The rearrangement module is used to rearrange multiple candidate items in the recommendation system according to the calculated diversity scores to obtain a rearrangement result.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the steps of the item rearrangement method in the recommendation system according to any one of claims 1 to 7 when executing the program stored in the memory.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the item rearrangement method in the recommendation system according to any one of claims 1 to 7 are implemented.