Sorting model training method, device, equipment and storage medium

By constructing the second ranking model as a classification model and using the ranking results of the first ranking model to guide training, the problem of low training efficiency is solved, and a more efficient training process is achieved.

CN114444724BActive Publication Date: 2025-10-28BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210119045.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-08
Publication Date
2025-10-28
Estimated Expiration
2042-02-08

AI Technical Summary

Technical Problem

In existing technologies, training the second ranking model is time-consuming and inefficient.

Method used

The second ranking model is constructed as a classification model. Different ranking orders are constructed as different categories. The ranking results of the first ranking model are used to guide the training, reducing the model complexity. Only the consistency of the ranking results needs to be guaranteed.

Benefits of technology

This improves the training efficiency of the second ranking model, reduces the training difficulty, and ensures the accuracy of the output results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114444724B_ABST
    Figure CN114444724B_ABST
Patent Text Reader

Abstract

This application discloses a ranking model training method, apparatus, device, and storage medium, belonging to the field of computer technology. The method includes: sorting multiple sample data using a first ranking model to obtain a first arrangement order of the sample data, where different sample data include different content data belonging to the same information; classifying the multiple sample data using a second ranking model to obtain the category of each sample data, and determining a second arrangement order of the multiple sample data based on the category of each sample data, where the category of the sample data represents the ranking position of the sample data; and training the second ranking model based on the first and second arrangement orders of the multiple sample data to obtain a trained second ranking model. This scheme reduces the training difficulty of the second ranking model and improves its training efficiency while ensuring the accuracy of the output results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a sorting model training method, apparatus, device, and storage medium. Background Technology

[0002] In information recommendation scenarios, a first ranking model can be used to sort multiple pieces of information based on their content data, obtaining their order. Information recommendations are then made based on this order. Each piece of information can contain multiple pieces of content data. To reduce the data processing load of the first ranking model, a second ranking model can be added. This second model first scores the multiple pieces of content data within each piece of information, obtaining their order. Then, the highest-scoring piece of content data is input into the first ranking model, allowing it to sort the multiple pieces of information only based on the highest-scoring content data within each piece of information.

[0003] In related technologies, a first ranking model is used as a Teacher network, and a second ranking model is used as a Student network. The second ranking model is trained using the first ranking model. For example, multiple content data are scored using the first and second ranking models respectively, resulting in a score for each content data. Based on the difference between the scores determined by the first and second ranking models, the second ranking model is trained to ensure that its scoring results are consistent with those of the first ranking model. However, in the above approach, training the second ranking model is time-consuming and inefficient. Summary of the Invention

[0004] This application provides a method, apparatus, device, and storage medium for training a ranking model, which improves the training efficiency of the ranking model. The technical solution is as follows:

[0005] On the one hand, a method for training a ranking model is provided, the method comprising:

[0006] The first sorting model is used to sort multiple sample data to obtain a first arrangement order of the multiple sample data. The different sample data in the multiple sample data include different content data belonging to the same information. The first sorting model is used to determine the sorting parameters of each sample data based on the different content data of the same information to obtain the arrangement order of the multiple sample data.

[0007] The multiple sample data are classified using a second sorting model to obtain the category of each sample data. Based on the category of each sample data, the second sorting order of the multiple sample data is determined, and the category of the sample data is used to represent the sorting position of the sample data.

[0008] Based on the first and second arrangement orders of the multiple sample data, the second sorting model is trained to obtain the trained second sorting model.

[0009] On the one hand, a ranking model training device is provided, the device comprising:

[0010] The first processing module is used to sort multiple sample data through a first sorting model to obtain a first arrangement order of the multiple sample data. The different sample data in the multiple sample data include different content data belonging to the same information. The first sorting model is used to determine the sorting parameters of each sample data based on the different content data of the same information to obtain the arrangement order of the multiple sample data.

[0011] The second processing module is used to classify the multiple sample data through a second sorting model to obtain the category of each sample data, and to determine the second arrangement order of the multiple sample data based on the category of each sample data, wherein the category of the sample data is used to represent the arrangement position of the sample data;

[0012] The training module is used to train the second sorting model based on the first and second sorting orders of the multiple sample data to obtain the trained second sorting model.

[0013] In one possible implementation, the second ranking model is a multi-class classification model, which is used to determine the category to which the input data belongs from multiple categories, wherein the multiple categories represent different ranking positions; the second processing module includes:

[0014] A classification unit is used to classify each sample data point using the second sorting model to obtain the probability that the sample data belongs to each category.

[0015] The first determining unit is used to determine the category corresponding to the highest probability as the category to which the sample data belongs;

[0016] The second determining unit is used to determine the second arrangement order of the multiple sample data based on the arrangement position of the category to which the multiple sample data belong.

[0017] In one possible implementation, the second determining unit is configured to, when there are multiple sample data belonging to the same category, determine the order of the multiple first sample data based on the probability that the multiple first sample data belong to the same category, wherein the multiple first sample data are sample data belonging to the same category; and determine a second arrangement order of the multiple sample data based on the order of the categories to which the other sample data in the multiple sample data belong and the order of the multiple first sample data.

[0018] In one possible implementation, the second ranking model is a single-class classification model, used to determine whether the input data belongs to the target category, where the target category represents the target ranking position; the second processing module includes:

[0019] A classification unit is used to classify each sample data using the second ranking model to obtain the probability that each sample data belongs to the target category;

[0020] The first determining unit is configured to determine the category to which each sample data belongs based on the probability that each sample data belongs to the target category, wherein the category is the target category or a non-target category;

[0021] The second determining unit is used to determine the second arrangement order of the multiple sample data based on the arrangement position represented by the category to which each sample data belongs.

[0022] In one possible implementation, the second determining unit is configured to, when there are multiple sample data belonging to the target category, determine the order of the multiple second sample data based on the probability that the multiple second sample data belong to the target category, wherein the multiple second sample data are sample data belonging to the target category; and determine a second arrangement order of the multiple sample data based on the order of the categories to which the other sample data in the multiple sample data belong, and the order of the multiple second sample data.

[0023] In one possible implementation, the first arrangement order is the order in which the multiple sample data are arranged in descending order according to the sorting parameters, and the training module includes:

[0024] The first determining unit is used to determine the third sample data located in the previous target arrangement position based on the first arrangement order;

[0025] The second determining unit is used to determine the fourth sample data located in the previous target arrangement position based on the second arrangement order;

[0026] The training unit is used to train the second ranking model based on the third sample data and the fourth sample data to obtain the trained second ranking model.

[0027] In one possible implementation, the training unit is used to train the second ranking model based on the difference between the third sample data and the fourth sample data when the target ranking is a single ranking, to obtain the trained second ranking model; or, when the target ranking is multiple rankings, the second ranking model is trained based on the difference between the third sample data and the fourth sample data corresponding to the same ranking, to obtain the trained second ranking model.

[0028] In one possible implementation, each sample data entry further includes object data of the object providing the information; the second processing module is configured to, for each sample data entry, classify the content data in the sample data based on the object data using the second sorting model to obtain the category of the sample data.

[0029] In one possible implementation, the second ranking model includes a first feature extraction layer, a second feature extraction layer, and a classification layer; the second processing module is used to extract features from the content data in the sample data through the first feature extraction layer to obtain first feature data;

[0030] The second processing module is used to extract features from the object data through the second feature extraction layer to obtain second feature data;

[0031] The second processing module is used to fuse the first feature data and the second feature data through the classification layer to obtain the third feature data, and to classify the third feature data to obtain the category corresponding to the sample data.

[0032] On one hand, a computer device is provided, the computer device including one or more processors and one or more memories, the one or more memories storing at least one piece of program code, the at least one piece of program code being loaded and executed by the one or more processors to perform the operations performed by the ranking model training method as described in any of the above possible implementations.

[0033] On the one hand, a computer-readable storage medium is provided, which stores at least one piece of program code, which is loaded and executed by a processor to perform the operations performed by the ranking model training method as described in any of the above possible implementations.

[0034] On the one hand, a computer program or computer program product is provided, the computer program or computer program product comprising: computer program code, which, when executed by a computer, causes the computer to perform the operations performed by the ranking model training method as described in any of the above possible implementations.

[0035] The ranking model training method, apparatus, device, and storage medium provided in this application construct different categories based on different arrangement orders, thus building the second ranking model into a classification model. Compared to a scoring model, this reduces the model complexity of the second ranking model. When training the second ranking model, it is only necessary to ensure that the ranking result of the second ranking model is consistent with the ranking result of the first ranking model; there is no need to focus on the specific score of each content data. While ensuring the accuracy of the output result of the second ranking model, this reduces the training difficulty and improves the training efficiency of the second ranking model. Attached Figure Description

[0036] 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.

[0037] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application;

[0038] Figure 2 This is a flowchart of a ranking model training method provided in an embodiment of this application;

[0039] Figure 3 This is a flowchart illustrating the construction process of a second sorting model provided in an embodiment of this application;

[0040] Figure 4 This is a flowchart of a ranking model training method provided in an embodiment of this application;

[0041] Figure 5 This is a flowchart illustrating the training process of a second ranking model provided in an embodiment of this application;

[0042] Figure 6 This is a flowchart illustrating the evaluation process of a second ranking model provided in an embodiment of this application;

[0043] Figure 7 This is a schematic diagram of the structure of a sorting model training device provided in an embodiment of this application;

[0044] Figure 8 This is a schematic diagram of another sorting model training device provided in an embodiment of this application;

[0045] Figure 9 This is a schematic diagram of the terminal structure provided in the embodiments of this application;

[0046] Figure 10 This is a schematic diagram of the server structure provided in an embodiment of this application. Detailed Implementation

[0047] 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.

[0048] It is understood that the terms "first," "second," etc., used in this application may be used herein to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of this application, a first image may be referred to as a second image, and similarly, a second image may be referred to as a first image.

[0049] As used in this application, the terms "at least one", "multiple", "each", and "any" mean that at least one includes one, two, or more than two; multiple includes two or more; each refers to each of the corresponding multiple; and any means refers to any one of the multiple. For example, multiple images include three images, each refers to each of the three images, and any means refers to any one of the three images, which can be the first, the second, or the third.

[0050] The ranking model training method provided in this application is executed by a computer device. In one possible implementation, the computer device is a terminal, such as a desktop computer, tablet computer, or mobile phone. In another possible implementation, the computer device is a server. For example, the server can be a single server, a server cluster consisting of several servers, or a cloud computing service center. In yet another possible implementation, the computer device includes both a terminal and a server.

[0051] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application, such as... Figure 1 As shown, the implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 are connected via a wireless or wired network.

[0052] Optionally, terminal 101 can be any type of terminal such as a desktop computer, tablet computer, or mobile phone. Server 102 can be a single server, a server cluster consisting of several servers, or a cloud computing service center.

[0053] A target application, provided by server 102, is installed on terminal 101. Terminal 101 can perform functions such as data transmission and message interaction through this target application. Optionally, the target application is an application in the operating system of terminal 101, or an application provided by a third party. For example, the target application is an e-commerce application that has the function of recommending merchants to users. Of course, the e-commerce application also has other functions, such as review functions and shopping functions.

[0054] Optionally, terminal 101 trains the second ranking model using the first ranking model to obtain the trained second ranking model, and sends the trained second ranking model to server 102. Server 102 filters recommended data for the user based on the trained second ranking model and the first ranking model, and sends the filtered recommended data to terminal 101.

[0055] Optionally, server 102 trains the second ranking model using the first ranking model to obtain the trained second ranking model, filters recommended data for users based on the first ranking model and the trained second ranking model, and sends the filtered recommended data to terminal 101.

[0056] The sorting model training method provided in this application can be applied to any sorting model training scenario.

[0057] For example, in the training scenario of a ranking model applied to food delivery recommendations.

[0058] When a food delivery platform recommends restaurants to users, it can obtain multiple images of the restaurants (e.g., multiple images of dishes). The platform then uses a second ranking model to sort these images, finding the top-ranked image for each restaurant. This top-ranked image is input into a first ranking model, which then ranks the restaurants based on their top-ranked images. Based on this ranking and the top-ranked images of each restaurant, the platform makes recommendations. For example, if the top 10 restaurants are selected for recommendation, the top-ranked image of each restaurant is displayed in the list. Using the ranking model training method provided in this application reduces the complexity of the second ranking model, increases its processing speed, and thus improves recommendation efficiency. Furthermore, it reduces the training difficulty of the second ranking model and improves training efficiency.

[0059] It should be noted that the embodiments in this application are merely illustrative examples of the training scenario for the ranking model in food delivery recommendations, and do not limit the training scenario for the ranking model.

[0060] Figure 2 This is a flowchart illustrating a ranking model training method provided in an embodiment of this application. This embodiment uses a computer device as an example for illustrative purposes, and includes:

[0061] 201. The computer device sorts multiple sample data using a first sorting model to obtain a first arrangement order of the multiple sample data. Different sample data include different content data belonging to the same information. The first sorting model is used to determine the sorting parameters of each sample data based on different content data of the same information to obtain the arrangement order of the multiple sample data.

[0062] In this embodiment, the first sorting model is a model used for sorting, and it is a trained model with a certain degree of accuracy. Therefore, sorting data using the first sorting model can yield relatively accurate sorting results. After inputting data into the first sorting model, the first sorting model obtains sorting parameters for the input data. By obtaining parameters for multiple input data, the model achieves sorting of the multiple input data. The sorting parameters are reference data used to sort the input data; optionally, these parameters are the scores assigned to the input data by the first sorting model. In other words, the first sorting model can score the input data, obtaining its score. By inputting multiple input data into the first sorting model, multiple scores can be obtained, and the multiple input data are sorted based on these scores. The multiple input data can be sorted in descending order of scores, or in ascending order of scores; this embodiment does not limit the sorting.

[0063] In this embodiment, the information can be any piece of information transmitted over the Internet. For example, the information can be merchant information, advertising information, item information, etc., and this embodiment does not limit the type of information. Content data is a portion of the data in the information. Taking merchant information as an example, the merchant information includes multiple food images, and the content data is any one of those images; or, the merchant information includes multiple user reviews, and the content data is any one of those reviews.

[0064] Sample data includes the content data of information. Different sample data in multiple sample data sets include different content data belonging to the same information. For example, different sample data in multiple sample data sets include different user reviews of the same merchant information; or, different sample data in multiple sample data sets include different pictures of dishes from the same merchant information, such as sample data 1 including a picture of "scrambled eggs with tomatoes", sample data 2 including a picture of "green peppers and bean curd sheets", and sample data 3 including a picture of "braised pork ribs", etc.

[0065] 202. The computer equipment classifies multiple sample data through a second sorting model to obtain the category of each sample data. Based on the category of each sample data, the second sorting order of the multiple sample data is determined. The category of the sample data is used to represent the sorting position of the sample data.

[0066] The second ranking model is the ranking model to be trained. In the embodiments of this application, such as... Figure 3 As shown, different ranking positions are constructed into different categories, and the second ranking model is constructed into a classification model. The second ranking model determines the ranking of input data by determining the category of the input data. By classifying multiple input data using the second ranking model, the categories of the multiple input data can be obtained, and thus the ranking of the multiple input data can be obtained. For example, multiple sample data are sample data 1, sample data 2, and sample data 3. Using the second ranking model, sample data 1 is classified into category 1, which indicates that the sample data ranks first. Sample data 2 is classified into category 3, which indicates that the sample data ranks third. Sample data 3 is classified into category 2, which indicates that the sample data ranks second.

[0067] 203. The computer equipment trains the second sorting model based on the first and second sorting orders of the multiple sample data to obtain the trained second sorting model.

[0068] In this embodiment of the application, when training the second ranking model, the scoring of the second ranking model is no longer considered. It is only necessary to ensure that the order determined by the second ranking model is consistent with the order determined by the first ranking model. Therefore, in this embodiment of the application, the second ranking model is trained based on the first and second arrangement order of the multiple sample data to obtain the trained second ranking model.

[0069] The ranking model training method provided in this application constructs different categories based on different permutation orders, and builds the second ranking model into a classification model. Compared with the scoring model, this reduces the model complexity of the second ranking model. When training the second ranking model, it is only necessary to ensure that the ranking result of the second ranking model is consistent with the ranking result of the first ranking model. There is no need to focus on the specific score of each content data. While ensuring the accuracy of the output result of the second ranking model, the training difficulty of the second ranking model is reduced and the training efficiency of the second ranking model is improved.

[0070] Figure 4 This is a flowchart illustrating a ranking model training method provided in an embodiment of this application. This embodiment uses a computer device as an example for illustrative purposes, and includes:

[0071] 401. The computer device sorts multiple sample data using a first sorting model to obtain a first arrangement order of the multiple sample data. The different sample data in the multiple sample data include different content data belonging to the same information. The first sorting model is used to determine the sorting parameters of each sample data based on the different content data of the same information to obtain the arrangement order of the multiple sample data.

[0072] In one possible implementation, the first sorting model can process multiple sample data together at a time. Multiple sample data are input into the first sorting model, which processes the input sample data to obtain sorting parameters for each sample data. Based on the sorting parameters for each sample data, a first arrangement order of the multiple sample data is determined. In this embodiment, to distinguish between the arrangement order of multiple sample data determined by the first sorting model and the arrangement order of multiple sample data determined by the second sorting model, the arrangement order of multiple sample data determined by the first sorting model is referred to as the first arrangement order, and the arrangement order of multiple sample data determined by the second sorting model is referred to as the second arrangement order.

[0073] In another possible implementation, the first sorting model processes one sample data at a time. Each sample data from multiple sample data is sequentially input into the first sorting model, which processes the input sample data to obtain the sorting parameters for that sample data. After inputting each sample data into the first sorting model, the sorting parameters for each sample data are obtained. Based on the sorting parameters for each sample data, the first arrangement order of the multiple sample data is determined.

[0074] In one possible implementation, each sample data entry also includes object data of the object providing the information. The computer device sorts multiple sample data entries using a first sorting model to obtain a first sorting order. This includes: for each sample data entry, the computer device sorts the content data based on the object data using the first sorting model to obtain the first sorting order of the multiple sample data entries. Because the first sorting model considers the object data of the object providing the information when sorting different content data of the same information, it can adaptively adjust the sorting of different content data in the information based on different objects, achieving a personalized experience.

[0075] It should be noted that, in the specific embodiments of this application, user-related data such as object data, when applied to specific products or technologies, require user permission or consent, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0076] Optionally, the first ranking model includes a feature extraction layer and a ranking parameter acquisition layer; for each sample data, the feature extraction layer extracts features from the object data and content data in the sample data to obtain a first feature; the ranking parameter acquisition layer processes the first feature to obtain the ranking parameters of the sample data; based on the ranking parameters of each sample data, the first arrangement order of the multiple sample data is determined.

[0077] Taking the food delivery recommendation scenario as an example, the content data in the sample data can be any image from multiple dish images provided by the merchant; it can also be any user review from multiple user reviews, etc. The object providing the information is the food delivery merchant, and the object data of the object is the merchant's data. This merchant data can include the merchant's click probability, the business district where the merchant is located, the merchant's sales volume, the interaction information between the merchant and users, etc. This application embodiment does not limit the merchant data.

[0078] It should be noted that the second ranking model is also used to rank different information. When ranking different information, it considers information such as the price quoted by the entity providing the information. However, the second ranking model is only used to rank different content data of the same information. Therefore, it does not consider information such as the price quoted by the entity providing the information. This results in the first and second ranking models considering different information when determining the order. Taking the example of scoring models in related technologies, since the scoring dimensions of the first and second ranking models are not entirely the same, it is impossible to train the second ranking model based on the first ranking model to achieve accurate scoring.

[0079] 402. The computer equipment classifies multiple sample data through a second sorting model to obtain the category of each sample data. The category of the sample data is used to indicate the ranking of the sample data.

[0080] In this embodiment, the second ranking model is no longer constructed as a scoring model, but rather as a classification model. Different ranking positions are constructed as different categories. The category of the input data is determined by the second ranking model to determine the ranking position of the input data, and then the second ranking model is guided by the first ranking model to perform accurate ranking.

[0081] In one possible implementation, the second ranking model can process multiple data samples together at a time. These multiple data samples are input into the second ranking model, which then classifies them to determine the category of each sample. For example, if 10 data samples are input into the second ranking model, it will classify them into 1 to 10 categories.

[0082] In one possible implementation, the second ranking model processes one sample data at a time. Each sample data in the multiple sample data is sequentially input into the second ranking model, which then classifies the input sample data to obtain the category of the sample data. After each sample data is input into the second ranking model, the category of each sample data is obtained.

[0083] In one possible implementation, the second ranking model is a multi-class classification model, used to determine the category to which the input data belongs from multiple categories, where the multiple categories represent different ranking positions. The computer device uses the second ranking model to classify multiple sample data to obtain the category of each sample data, including: for each sample data, the computer device classifies the sample data to determine the category to which the sample data belongs from multiple categories. Optionally, the computer device uses the second ranking model to classify multiple sample data to obtain the category of each sample data, including: for each sample data, using the second ranking model to classify the sample data to obtain the probability that the sample data belongs to each category; and determining the category corresponding to the highest probability as the category to which the sample data belongs.

[0084] For example, given multiple categories—Category 1, Category 2, and Category 3—after classifying the sample data using a second ranking model, the probability that the sample data belongs to Category 1 is 20%, Category 2 is 50%, and Category 3 is 30%. Since the probability of the sample data belonging to Category 2 is the highest, it is determined that the sample data belongs to Category 2.

[0085] In another possible implementation, the second ranking model is a single-class classification model used to determine whether the input data belongs to the target category, where the target category represents the target ranking position. The computer device uses the second ranking model to classify multiple sample data points to obtain the category of each sample data point, including: classifying each sample data point using the second ranking model to obtain the probability that each sample data point belongs to the target category; and determining the category to which each sample data point belongs based on the probability that it belongs to the target category or a non-target category.

[0086] The target arrangement position can be any arrangement position. For example, the target arrangement position can be the first arrangement position, that is, the first position in the arrangement order. This application does not limit the target arrangement position.

[0087] Optionally, the computer device determines the category of each sample data point based on the probability that each sample data point belongs to the target category. This includes: if the probability of the sample data belonging to the target category exceeds a first probability threshold, the computer device determines that the category to which the sample data belongs is the target category; if the probability of the sample data belonging to the target category does not exceed the first probability threshold, the computer device determines that the category to which the sample data belongs is a non-target category. The first probability threshold can be any value, for example, 50%. The first probability threshold can be an empirical value or a value set by a technician; this embodiment does not limit the first probability threshold.

[0088] In one possible implementation, each sample data entry also includes object data of the object providing the information. The computer device uses a second sorting model to classify multiple sample data entries to obtain the category of each sample data entry. This includes: the computer device, based on each sample data entry, using the second sorting model and the object data, classifying the content data within the sample data to obtain the category of the sample data. Because the second sorting model considers the object data of the object providing the information when sorting different content data of the same information, the first sorting model can adaptively adjust the sorting of different content data within the information based on different objects, achieving a personalized experience.

[0089] This object is similar to the object in step 301 above, and its data is similar to the object data in step 301 above, so they will not be described in detail here.

[0090] In one possible implementation, such as Figure 5 As shown, the second ranking model includes a first feature extraction layer, a second feature extraction layer, and a classification layer. The computer device, using the second ranking model, classifies the content data in the sample data based on the object data to obtain the category of the sample data. This includes: extracting features from the content data in the sample data using the first feature extraction layer to obtain first feature data; extracting features from the object data using the second feature extraction layer to obtain second feature data; fusing the first and second feature data using the classification layer to obtain third feature data; and classifying the third feature data to obtain the category of the sample data.

[0091] The fusion of the first feature data and the second feature data can be achieved by performing a dot product or cross product on the first feature data and the second feature data. This application does not limit the fusion method.

[0092] Optionally, the second ranking model includes a third feature extraction layer and a classification layer; the computer device uses the second ranking model to classify the content data in the sample data based on the object data to obtain the category of the sample data, including: extracting features from the object data and content data in the sample data through the third feature extraction layer to obtain fourth feature data; and classifying the fourth feature data through the classification layer to obtain the category of the sample data.

[0093] It should be noted that in related technologies, the second ranking models only process content data and do not consider object data. In this embodiment, object data is also used as processing data in the second ranking model, enabling the second ranking model to classify content data more accurately based on object data. Another point to note is that while both the first and second ranking models in this embodiment consider object data, the first ranking model considers a more comprehensive range of object data, while the second ranking model considers less. For example, the first ranking model considers factors such as the price quoted by the object for the information provided, while the second ranking model does not.

[0094] 403. The computer equipment determines the second arrangement order of multiple sample data based on the category of each sample data.

[0095] In this embodiment of the application, the category of sample data indicates the ranking of the sample data. Therefore, the computer device can determine the second ranking order of the multiple sample data based on the category of each sample data. In one possible implementation, the computer device determines the second ranking order of the multiple sample data based on the category of each sample data, including: determining the second ranking order of the multiple sample data based on the ranking indicated by the category to which the multiple sample data belong.

[0096] When determining the category of sample data, the second ranking model can either directly determine the category of the sample data or determine the probability that the sample data belongs to a certain category, and then determine the category of the sample data based on the probability of the sample data belonging to that category. In one possible implementation, the second ranking model determines the category of the sample data by determining the probability that the sample data belongs to a certain category. However, after processing multiple sample data, some sample data may correspond to the same category. This application embodiment also provides a ranking method for sample data of the same category. Optionally, the computer device determines a second arrangement order of multiple sample data based on the arrangement position represented by the category to which the multiple sample data belong, including: when there are multiple sample data belonging to the same category, the computer device determines the arrangement position of the multiple first sample data based on the probability that the multiple first sample data belong to the same category, wherein the multiple first sample data are sample data belonging to the same category; and determines the second arrangement order of the multiple sample data based on the arrangement position of the categories to which the other sample data in the multiple sample data belong, and the arrangement position of the multiple first sample data.

[0097] The ranking of multiple first sample data points is determined based on the probability that they belong to the same category. This can be done by ranking them in descending order of probability, or by ranking them in ascending order of probability.

[0098] For example, multiple first sample data belong to the first category. The first category means that the first sample data is ranked first. The higher the probability that the first sample data belongs to the first category, the higher the probability that the first sample data is ranked first, and the higher the ranking of the first sample data.

[0099] For example, if sample data 1, sample data 2, and sample data 3 all belong to the first category, sample data 4 and sample data 5 both belong to the second category, and sample data 6 belongs to the third category, and the probability that sample data 1 belongs to the first category is 55%, the probability that sample data 2 belongs to the first category is 79%, the probability that sample data 3 belongs to the first category is 98%, the probability that sample data 4 belongs to the second category is 77%, and the probability that sample data 5 belongs to the second category is 74%, then the ranking of sample data 3 is determined to be first, the ranking of sample data 2 is second, the ranking of sample data 1 is third, the ranking of sample data 4 is fourth, the ranking of sample data 5 is fifth, and the ranking of sample data 6 is sixth.

[0100] In one possible implementation, the second ranking model is a single-class classification model used to determine whether the input data belongs to the target category, where the target category represents the target ranking position. Optionally, the computer device determines the second ranking order of multiple sample data based on the ranking position represented by the category to which each sample data belongs, including: when there are multiple sample data belonging to the target category, the computer device determines the ranking position of the multiple second sample data based on the probability that the multiple second sample data belongs to the target category, where the multiple second sample data are sample data belonging to the target category; and determines the second ranking order of the multiple sample data based on the ranking positions of the categories to which the other sample data (excluding the multiple second sample data) belong and the ranking positions of the multiple second sample data.

[0101] The target ranking position can be any position such as first or second, and this application embodiment does not limit the target ranking position. Determining the ranking position of multiple second sample data based on the probability that they belong to the target category can involve determining the second sample data with the highest probability of belonging to the target category as the sample data with the target ranking position, and determining other second sample data belonging to the target category as sample data with non-target ranking positions. Determining the second arrangement order of the multiple sample data based on the ranking positions of the categories of other sample data (excluding the multiple second sample data) and the ranking positions of the multiple second sample data can involve determining other sample data as sample data with non-target ranking positions.

[0102] 404. The computer equipment trains the second sorting model based on the first and second sorting orders of multiple sample data to obtain the trained second sorting model.

[0103] In this embodiment of the application, the first sorting model only needs to guide the second sorting model to sort. Therefore, when training the second sorting model, the second sorting model is trained based on the first and second arrangement orders of multiple sample data, so that the arrangement order obtained by the second sorting model is consistent with the arrangement order obtained by the first sorting model.

[0104] In one possible implementation, the computer device trains a second ranking model based on a first and second arrangement of multiple sample data to obtain a trained second ranking model, including: the computer device trains the second ranking model based on the differences between sample data in the first and second arrangement that are located in the same position in the arrangement to obtain a trained second ranking model.

[0105] For example, the first ranking order indicates that sample data 1 is in the first position, sample data 2 is in the third position, and sample data 3 is in the second position; the second ranking order indicates that sample data 2 is in the first position, sample data 2 is in the second position, and sample data 3 is in the third position. Then, based on the differences between sample data 1 and sample data 2, the differences between sample data 2 and sample data 3, and the differences between sample data 3 and sample data 2, the second ranking model is trained.

[0106] In one possible implementation, the second ranking model only needs to determine the data located in the top target position from multiple data sets. Therefore, the second ranking model only needs to accurately determine the data in the top target position. When training the second ranking model, it only needs to be trained based on the results of the top target position. Optionally, the first ranking order is the order in which multiple sample data are arranged in descending order according to the ranking parameters, and the second ranking order is the order in which multiple sample data are arranged in descending order according to the ranking parameters. The computer device trains the second ranking model based on the first and second ranking orders of the multiple sample data to obtain the trained second ranking model, including: the computer device determining the third sample data located in the top target position based on the first ranking order; determining the fourth sample data located in the top target position based on the second ranking order; and training the second ranking model based on the third and fourth sample data to obtain the trained second ranking model.

[0107] Optionally, the computer device trains the second ranking model based on the third and fourth sample data to obtain the trained second ranking model, including: when the target ranking position is one ranking position, training the second ranking model based on the difference between the third and fourth sample data to obtain the trained second ranking model; or, when the target ranking position is multiple ranking positions, training the second ranking model based on the difference between the third and fourth sample data corresponding to the same ranking position to obtain the trained second ranking model.

[0108] In one possible implementation, the second ranking model only needs to determine the data located in the later target position from multiple data sets. Therefore, the second ranking model only needs to accurately determine the data in the later target position. When training the second ranking model, it only needs to be trained based on the result of the later target position. Optionally, the first ranking order is the order in which multiple sample data are arranged in ascending order according to the ranking parameters, and the second ranking order is the order in which multiple sample data are arranged in ascending order according to the ranking parameters. The computer device trains the second ranking model based on the first and second ranking orders of the multiple sample data to obtain the trained second ranking model, including: the computer device determining the fifth sample data located in the later target position based on the first ranking order; determining the sixth sample data located in the later target position based on the second ranking order; and training the second ranking model based on the fifth and sixth sample data to obtain the trained second ranking model.

[0109] Optionally, the computer device trains the second ranking model based on the fifth and sixth sample data to obtain the trained second ranking model, including: when the target ranking position is one, training the second ranking model based on the difference between the fifth and sixth sample data to obtain the trained second ranking model; or, when the target ranking position is multiple, training the second ranking model based on the difference between the fifth and sixth sample data corresponding to the same ranking position to obtain the trained second ranking model.

[0110] It should be noted that, in the embodiments of this application, any loss function can be used for training the second ranking model, such as the Softmax function (an activation function), etc. The embodiments of this application do not limit the loss function.

[0111] In this embodiment, multiple sample data points are different content data of the same information. These multiple sample data points can be regarded as a set of sample data. After processing the set of sample data using a first ranking model and a second ranking model, the second ranking model is trained by comparing the processing results of the second ranking model with those of the first ranking model. Subsequently, different content data of another piece of information can be obtained as multiple sample data points, and the second ranking model is trained using this set of sample data points until the second ranking model achieves a certain accuracy, at which point training of the second ranking model stops.

[0112] Taking the second ranking model as an example, which only needs to accurately find the top-ranked content data from different content data of the same information, such as... Figure 6 As shown, the content data ranked first by the first ranking model and the content data ranked first by the second ranking model are compared. The proportion of the content data ranked first by both models is the same, and this proportion is used as the accuracy of the second ranking model. When the accuracy of the second ranking model reaches the target accuracy, the training of the second ranking model is stopped.

[0113] The ranking model training method provided in this application constructs different categories based on different permutation orders, and builds the second ranking model into a classification model. Compared with the scoring model, this reduces the model complexity of the second ranking model. When training the second ranking model, it is only necessary to ensure that the ranking result of the second ranking model is consistent with the ranking result of the first ranking model. There is no need to focus on the specific score of each content data. While ensuring the accuracy of the output result of the second ranking model, the training difficulty of the second ranking model is reduced and the training efficiency of the second ranking model is improved.

[0114] In this embodiment, object data is also used as processing data in the second ranking model, enabling the second ranking model to classify content data more accurately based on object data. Furthermore, this embodiment adds a second feature extraction layer to the second ranking model. This second feature extraction layer extracts feature data from the object data and merges it with the feature data from the content data, further highlighting the impact of the object data's feature data on the classification of the content data's feature data.

[0115] Furthermore, in this embodiment of the application, the second sorting model can accurately sort the content data of the same information, thereby exposing the optimal content data of the information and improving the exposure effect of the information.

[0116] Figure 7 This is a schematic diagram of a sorting model training device provided in an embodiment of this application. See also... Figure 7 The device includes:

[0117] The first processing module 701 is used to sort multiple sample data through a first sorting model to obtain a first arrangement order of the multiple sample data. The different sample data in the multiple sample data include different content data belonging to the same information. The first sorting model is used to determine the sorting parameters of each sample data based on the different content data of the same information to obtain the arrangement order of the multiple sample data.

[0118] The second processing module 702 is used to classify the multiple sample data through a second sorting model to obtain the category of each sample data, and to determine the second arrangement order of the multiple sample data based on the category of each sample data, wherein the category of the sample data is used to represent the arrangement position of the sample data;

[0119] The training module 703 is used to train the second sorting model based on the first and second sorting orders of the multiple sample data to obtain the trained second sorting model.

[0120] like Figure 8 As shown, in one possible implementation, the second ranking model is a multi-class classification model, which is used to determine the category to which the input data belongs from multiple categories, wherein the multiple categories represent different ranking positions; the second processing module 702 includes:

[0121] The classification unit 7021 is used to classify each sample data using the second sorting model to obtain the probability that the sample data belongs to each category.

[0122] The first determining unit 7022 is used to determine the category corresponding to the highest probability as the category to which the sample data belongs;

[0123] The second determining unit 7023 is used to determine the second arrangement order of the multiple sample data based on the arrangement position of the category to which the multiple sample data belong.

[0124] In one possible implementation, the second determining unit 7023 is configured to, when there are multiple sample data belonging to the same category, determine the order of the multiple first sample data based on the probability that the multiple first sample data belong to the same category, wherein the multiple first sample data are sample data belonging to the same category; and determine a second arrangement order of the multiple sample data based on the order of the categories to which the other sample data in the multiple sample data belong and the order of the multiple first sample data.

[0125] In one possible implementation, the second ranking model is a single-class classification model, used to determine whether the input data belongs to the target category, where the target category represents the target ranking position; the second processing module 702 includes:

[0126] The classification unit 7021 is used to classify each sample data using the second sorting model to obtain the probability that each sample data belongs to the target category;

[0127] The first determining unit 7022 is used to determine the category to which each sample data belongs based on the probability that each sample data belongs to the target category, wherein the category is the target category or a non-target category;

[0128] The second determining unit 7023 is used to determine the second arrangement order of the multiple sample data based on the arrangement position represented by the category to which each sample data belongs.

[0129] In one possible implementation, the second determining unit 7023 is configured to, when there are multiple sample data belonging to the target category, determine the order of the multiple second sample data based on the probability that the multiple second sample data belong to the target category, wherein the multiple second sample data are sample data belonging to the target category; and determine a second arrangement order of the multiple sample data based on the order of the categories to which the other sample data in the multiple sample data belong, and the order of the multiple second sample data.

[0130] In one possible implementation, the first arrangement order is the order in which the multiple sample data are arranged in descending order according to the sorting parameters, and the training module 703 includes:

[0131] The first determining unit 7031 is used to determine the third sample data located in the previous target arrangement position based on the first arrangement order;

[0132] The second determining unit 7032 is used to determine the fourth sample data located in the previous target arrangement position based on the second arrangement order;

[0133] Training unit 7033 is used to train the second ranking model based on the third sample data and the fourth sample data to obtain the trained second ranking model.

[0134] In one possible implementation, the training unit 7033 is used to train the second ranking model based on the difference between the third sample data and the fourth sample data when the target ranking is a single ranking, to obtain the trained second ranking model; or, when the target ranking is multiple rankings, the second ranking model is trained based on the difference between the third sample data and the fourth sample data corresponding to the same ranking, to obtain the trained second ranking model.

[0135] In one possible implementation, each sample data entry further includes object data of the object providing the information; the second processing module 702 is used to classify the content data in the sample data based on the object data using the second sorting model to obtain the category of the sample data.

[0136] In one possible implementation, the second ranking model includes a first feature extraction layer, a second feature extraction layer, and a classification layer; the second processing module 702 is used to extract features from the content data in the sample data through the first feature extraction layer to obtain first feature data;

[0137] The second processing module 702 is used to extract features from the object data through the second feature extraction layer to obtain second feature data;

[0138] The second processing module 702 is used to perform fusion processing on the first feature data and the second feature data through the classification layer to obtain third feature data, and to perform classification processing on the third feature data to obtain the category corresponding to the sample data.

[0139] It should be noted that the sorting model training device provided in the above embodiments is only illustrated by the division of the above functional modules when training the sorting model. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. In addition, the sorting model training device and the sorting model training method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0140] In an exemplary embodiment, a computer device is provided, the computer device including one or more processors and one or more memories, the one or more memories storing at least one piece of program code, the at least one piece of program code being loaded and executed by the one or more processors to implement the ranking model training method as described in the above embodiments.

[0141] Optionally, the computer device is provided as a terminal. Figure 9 This illustration shows a structural block diagram of a terminal 900 provided in an exemplary embodiment of this application. The terminal 900 may be a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. The terminal 900 may also be referred to as a user device, portable terminal, laptop terminal, desktop terminal, or other names.

[0142] Terminal 900 includes a processor 901 and a memory 902.

[0143] Processor 901 may include one or more processing cores, such as a quad-core processor or an octa-core processor. Processor 901 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 901 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 901 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 901 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0144] The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 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 902 are used to store at least one program code, which is executed by the processor 901 to implement the sorting model training method provided in the method embodiments of this application.

[0145] In some embodiments, the terminal 900 may also optionally include a peripheral device interface 903 and at least one peripheral device. The processor 901, memory 902, and peripheral device interface 903 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 903 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 904, a display screen 905, a camera 906, an audio circuit 907, a positioning component 908, and a power supply 909.

[0146] Peripheral device interface 903 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 901 and memory 902. In some embodiments, processor 901, memory 902 and peripheral device interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 901, memory 902 and peripheral device interface 903 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

[0147] The radio frequency (RF) circuit 904 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 904 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 904 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 904 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 904 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 904 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.

[0148] Display screen 905 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 905 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 901 for processing. In this case, display screen 905 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, there may be one display screen 905, which serves as the front panel of terminal 900; in other embodiments, there may be at least two display screens 905, respectively disposed on different surfaces of terminal 900 or in a folded design; in still other embodiments, display screen 905 may be a flexible display screen, disposed on a curved or folded surface of terminal 900. Furthermore, display screen 905 may be configured as a non-rectangular irregular shape, i.e., a non-rectangular screen. Display screen 905 may be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light-Emitting Diode).

[0149] The camera assembly 906 is used to acquire images or videos. Optionally, the camera assembly 906 includes a front-facing camera and a rear-facing camera. The front-facing camera is disposed on the front panel of the terminal, and the rear-facing camera is disposed 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 906 may also include a flash. The flash may 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.

[0150] The audio circuit 907 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting them into electrical signals that are input to the processor 901 for processing, or to the radio frequency circuit 904 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 900. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from the processor 901 or the radio frequency circuit 904 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 907 may also include a headphone jack.

[0151] The positioning component 908 is used to determine the current geographic location of the terminal 900 in order to enable navigation or LBS (Location Based Service). The positioning component 908 can be a positioning component based on the US GPS (Global Positioning System), China's BeiDou system, Russia's Granas system, or the European Union's Galileo system.

[0152] The power supply 909 is used to power the various components in the terminal 900. The power supply 909 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery. When the power supply 909 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.

[0153] In some embodiments, the terminal 900 further includes one or more sensors 910. The one or more sensors 910 include, but are not limited to: an accelerometer 911, a gyroscope 912, a pressure sensor 913, a fingerprint sensor 914, an optical sensor 915, and a proximity sensor 916.

[0154] Accelerometer 911 can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by terminal 900. For example, accelerometer 911 can be used to detect the components of gravitational acceleration along the three coordinate axes. Processor 901 can control display screen 905 to display the user interface in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 911. Accelerometer 911 can also be used for games or for acquiring user motion data.

[0155] The gyroscope sensor 912 can detect the orientation and rotation angle of the terminal 900. The gyroscope sensor 912, in conjunction with the accelerometer sensor 911, can collect the user's 3D movements on the terminal 900. Based on the data collected by the gyroscope sensor 912, the processor 901 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.

[0156] The pressure sensor 913 can be disposed on the side bezel of the terminal 900 and / or the lower layer of the display screen 905. When the pressure sensor 913 is disposed on the side bezel of the terminal 900, it can detect the user's grip signal on the terminal 900, and the processor 901 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 913. When the pressure sensor 913 is disposed on the lower layer of the display screen 905, the processor 901 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 905. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

[0157] The fingerprint sensor 914 is used to collect the user's fingerprint. The processor 901 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 914, or vice versa. When the user's identity is identified as trusted, the processor 901 authorizes the user to perform relevant sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, making payments, and changing settings. The fingerprint sensor 914 can be located on the front, back, or side of the terminal 900. When the terminal 900 has physical buttons or a manufacturer's logo, the fingerprint sensor 914 can be integrated with the physical buttons or manufacturer's logo.

[0158] An optical sensor 915 is used to collect ambient light intensity. In one embodiment, the processor 901 can control the display brightness of the display screen 905 based on the ambient light intensity collected by the optical sensor 915. Specifically, when the ambient light intensity is high, the display brightness of the display screen 905 is increased; when the ambient light intensity is low, the display brightness of the display screen 905 is decreased. In another embodiment, the processor 901 can also dynamically adjust the shooting parameters of the camera assembly 906 based on the ambient light intensity collected by the optical sensor 915.

[0159] The proximity sensor 916, also known as a distance sensor, is installed on the front panel of the terminal 900. The proximity sensor 916 is used to detect the distance between the user and the front of the terminal 900. In one embodiment, when the proximity sensor 916 detects that the distance between the user and the front of the terminal 900 is gradually decreasing, the processor 901 controls the display screen 905 to switch from a screen-on state to a screen-off state; when the proximity sensor 916 detects that the distance between the user and the front of the terminal 900 is gradually increasing, the processor 901 controls the display screen 905 to switch from a screen-off state to a screen-on state.

[0160] Those skilled in the art will understand that Figure 9 The structure shown does not constitute a limitation on terminal 900, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0161] Alternatively, the computer device may be provided as a server. Figure 10 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1000 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 1001 and one or more memories 1002. The memory 1002 stores at least one line of program code, which is loaded and executed by the processor 1001 to implement the methods provided in the above-described method embodiments. 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.

[0162] The server 1000 is used to execute the steps performed by the server in the above method embodiments.

[0163] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including program code that can be executed by a processor in a computer device to complete the sorting model training method in the above embodiments. For example, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0164] In an exemplary embodiment, a computer program or computer program product is also provided, which includes computer program code that, when executed by a computer, causes the computer to implement the sorting model training method in the above embodiments.

[0165] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0166] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for training a ranking model, characterized in that, The method, applied to the training scenario of a ranking model in food delivery recommendation, includes: The first sorting model is used to sort multiple sample data to obtain a first arrangement order of the multiple sample data. The different sample data in the multiple sample data include different content data belonging to the same information. The first sorting model is used to determine the sorting parameters of each sample data based on the different content data of the same information to obtain the arrangement order of the multiple sample data. The different sample data in the multiple sample data include different user reviews of the same takeaway merchant information or different dish pictures of the same merchant information. The multiple sample data are classified using a second sorting model to obtain the category of each sample data. Based on the category of each sample data, the second sorting order of the multiple sample data is determined, and the category of the sample data is used to represent the sorting position of the sample data. Based on the first and second arrangement orders of the multiple sample data, the second sorting model is trained to obtain the trained second sorting model. When different sample data in the multiple sample data include different dish images of the same merchant, when the food delivery platform recommends a food delivery merchant to the user, it obtains multiple dish images of the food delivery merchant, sorts the multiple dish images of the same food delivery merchant through a second sorting model, finds the first ranked image of the food delivery merchant, inputs the first ranked image of the food delivery merchant into a first sorting model, and sorts the multiple food delivery merchants based on the first ranked image of each food delivery merchant, obtains the ranking of the multiple food delivery merchants, and makes food delivery merchant recommendations based on the ranking of the multiple food delivery merchants and the first ranked image of each food delivery merchant; The second ranking model is a multi-class classification model. This model is used to determine the category to which the input data belongs from multiple categories, where the multiple categories represent different ranking positions. The step of classifying the multiple sample data using the second ranking model to obtain the category of each sample data, and determining the second ranking order of the multiple sample data based on the category of each sample data, includes: For each sample data, the sample data is classified using the second sorting model to obtain the probability that the sample data belongs to each category; The category corresponding to the highest probability is determined as the category to which the sample data belongs; The second arrangement order of the multiple sample data is determined based on the ranking of the categories to which they belong.

2. The method according to claim 1, characterized in that, Determining the second arrangement order of the multiple sample data based on their ranking according to the category to which they belong includes: When there are multiple sample data belonging to the same category, the order of the multiple first sample data is determined based on the probability that the multiple first sample data belong to the same category, and the multiple first sample data are sample data belonging to the same category; Based on the ranking of the categories of the sample data other than the first sample data and the ranking of the first sample data, a second ranking order of the sample data is determined.

3. The method according to claim 1, characterized in that, The second ranking model is a single-classification model. The second ranking model is used to determine whether the input data belongs to the target category, where the target category represents the target ranking position. The step of classifying the multiple sample data using a second sorting model to obtain the category of each sample data, and determining the second sorting order of the multiple sample data based on the category of each sample data, includes: The second sorting model is used to classify each sample data to obtain the probability that each sample data belongs to the target category; Based on the probability that each sample data belongs to the target category, the category to which each sample data belongs is determined, and the category is either the target category or a non-target category; The second arrangement order of the multiple sample data is determined based on the ranking of the category to which each sample data belongs.

4. The method according to claim 3, characterized in that Determining the second arrangement order of the multiple sample data based on the ranking of the category to which each sample data belongs includes: When there are multiple sample data belonging to the target category, the ranking of the multiple second sample data is determined based on the probability that the multiple second sample data belong to the target category, and the multiple second sample data are sample data belonging to the target category; Based on the ranking of the categories of the sample data other than the multiple second sample data and the ranking of the multiple second sample data, a second arrangement order of the multiple sample data is determined.

5. The method according to claim 1, characterized in that, The first arrangement order is the order in which the multiple sample data are arranged in descending order according to the sorting parameters. The second sorting model is trained based on the first and second arrangement orders of the multiple sample data to obtain the trained second sorting model, including: Based on the first arrangement order, the third sample data located in the previous target arrangement position is determined; Based on the second arrangement order, the fourth sample data located in the previous target arrangement position is determined; Based on the third sample data and the fourth sample data, the second ranking model is trained to obtain the trained second ranking model.

6. The method according to claim 5, characterized in that, The step of training the second ranking model based on the third sample data and the fourth sample data to obtain the trained second ranking model includes: If the target ranking is a single ranking, the second ranking model is trained based on the difference between the third and fourth sample data to obtain the trained second ranking model; or, if the target ranking is multiple rankings, the second ranking model is trained based on the difference between the third and fourth sample data corresponding to the same ranking to obtain the trained second ranking model.

7. The method according to claim 1, characterized in that, Each sample data entry also includes object data of the object providing the information; the classification process of the multiple sample data entries using a second sorting model to obtain the category of each sample data entry includes: For each piece of sample data, the content data in the sample data is classified based on the object data using the second sorting model to obtain the category of the sample data.

8. The method according to claim 7, characterized in that, The second ranking model includes a first feature extraction layer, a second feature extraction layer, and a classification layer; the step of classifying the content data in the sample data based on the object data using the second ranking model to obtain the category of the sample data includes: The first feature extraction layer extracts features from the content data in the sample data to obtain the first feature data. The second feature extraction layer extracts features from the object data to obtain second feature data. The classification layer fuses the first feature data and the second feature data to obtain the third feature data, which is then classified to obtain the category of the sample data.

9. A sorting model training device, characterized in that, The device, used in training ranking models for food delivery recommendations, includes: The first processing module is used to sort multiple sample data through a first sorting model to obtain a first arrangement order of the multiple sample data. The different sample data in the multiple sample data include different content data belonging to the same information. The first sorting model is used to determine the sorting parameters of each sample data based on the different content data of the same information to obtain the arrangement order of the multiple sample data. The different sample data in the multiple sample data include different user reviews of the same takeaway merchant information or different dish pictures of the same merchant information. The second processing module is used to classify the multiple sample data using a second sorting model to obtain the category of each sample data, and to determine a second arrangement order of the multiple sample data based on the category of each sample data. The category of the sample data is used to represent the arrangement position of the sample data. The second sorting model is a multi-classification model, which is used to determine the category to which the input data belongs from multiple categories, and the multiple categories represent different arrangement positions. The step of classifying the multiple sample data using the second sorting model to obtain the category of each sample data and determining the second arrangement order of the multiple sample data based on the category of each sample data includes: for each sample data, classifying the sample data using the second sorting model to obtain the probability of the sample data belonging to each category, determining the category corresponding to the highest probability as the category to which the sample data belongs, and determining the second arrangement order of the multiple sample data based on the arrangement position represented by the categories to which the multiple sample data belongs. The training module is used to train the second sorting model based on the first and second sorting orders of the multiple sample data to obtain the trained second sorting model. When different sample data in the multiple sample data include different dish images of the same merchant, the food delivery platform recommends merchants to users by acquiring multiple dish images of the same merchant, sorting the multiple dish images of the same merchant using a second sorting model, finding the top-ranked image of the merchant, and inputting the top-ranked image of the merchant into a first sorting model. The first sorting model sorts the multiple merchants based on the top-ranked image of each merchant, obtaining the ranking of the multiple merchants. Based on the ranking of the multiple merchants and the top-ranked image of each merchant, the platform makes recommendations for the merchants.

10. A computer device, characterized in that, The computer device includes one or more processors and one or more memories, wherein at least one piece of program code is stored in the one or more memories, and the at least one piece of program code is loaded and executed by the one or more processors to perform the operations performed by the ranking model training method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The storage medium stores at least one piece of program code, which is loaded and executed by a processor to perform the operations of the ranking model training method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Personalized display image generation method and apparatus, and electronic device

    CN110489582A

  • User tag display method and device

    CN113781062A