CN114444724A - Ranking model training method, device, equipment and storage medium - Google Patents

Ranking model training method, device, equipment and storage medium Download PDF

Info

Publication number
CN114444724A
CN114444724A CN202210119045.5A CN202210119045A CN114444724A CN 114444724 A CN114444724 A CN 114444724A CN 202210119045 A CN202210119045 A CN 202210119045A CN 114444724 A CN114444724 A CN 114444724A
Authority
CN
China
Prior art keywords
sample data
pieces
model
data
order
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210119045.5A
Other languages
Chinese (zh)
Inventor
吴强
王永康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN202210119045.5A priority Critical patent/CN114444724A/en
Publication of CN114444724A publication Critical patent/CN114444724A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/06Arrangements for sorting, selecting, merging, or comparing data on individual record carriers
    • G06F7/08Sorting, i.e. grouping record carriers in numerical or other ordered sequence according to the classification of at least some of the information they carry

Abstract

The application discloses a sequencing model training method, a sequencing model training device, sequencing model training equipment and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: sequencing a plurality of pieces of sample data through a first sequencing model to obtain a first sequencing order of the plurality of pieces of sample data, wherein different pieces of sample data comprise different content data belonging to the same information; classifying the plurality of pieces of sample data through a second sequencing model to obtain the category of each piece of sample data, and determining a second arrangement order of the plurality of pieces of sample data based on the category of each piece of sample data, wherein the category of the sample data is used for representing the arrangement order of the sample data; and training the second ranking model based on the first ranking order and the second ranking order of the plurality of pieces of sample data to obtain the trained second ranking model. According to the scheme, on the basis of ensuring the accuracy of the output result of the second sequencing model, the training difficulty of the second sequencing model is reduced, and the training efficiency of the second sequencing model is improved.

Description

Ranking model training method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for training a ranking model.
Background
In the information recommendation scene, the plurality of pieces of information can be ranked based on content data in the plurality of pieces of information through the first ranking model to obtain the ranking order of the plurality of pieces of information, and information recommendation can be performed based on the ranking order of the plurality of pieces of information. Each piece of information may include a plurality of pieces of content data, in order to reduce the data processing amount of the first ordering model, a second ordering model may be added, the plurality of pieces of content data in each piece of information are scored through the second ordering model to obtain the ordering order of each piece of content data in the piece of information, and then the first-ranked piece of content data (the piece of content data with the highest score) is input to the first ordering model, so that the first ordering model only needs to order the pieces of information based on the piece of content data with the highest score in each piece of information.
In the related art, a first ranking model is used as a Teacher network, a second ranking model is used as a Student network, and the second ranking model is trained through the first ranking model. For example, a plurality of content data are respectively scored through a first sorting model and a second sorting model to obtain the score of each content data; and training the second sorting model based on the difference between the scores determined by the first sorting model and the scores determined by the second sorting model, so that the second sorting model is consistent with the scoring results of the first sorting model. However, in the above scheme, the training of the second ranking model takes a long time, and the training efficiency is low.
Disclosure of Invention
The embodiment of the application provides a sequencing model training method, a sequencing model training device, sequencing model training equipment and a storage medium, and the training efficiency of the sequencing model is improved. The technical scheme is as follows:
in one aspect, a ranking model training method is provided, and the method includes:
sequencing a plurality of pieces of sample data through a first sequencing model to obtain a first sequencing order of the plurality of pieces of sample data, wherein different pieces of sample data in the plurality of pieces of sample data comprise different content data belonging to the same information, and the first sequencing model is used for determining a sequencing parameter of each piece of sample data based on the different content data of the same information to obtain the sequencing order of the plurality of pieces of sample data;
classifying the plurality of pieces of sample data through a second sequencing model to obtain the category of each piece of sample data, and determining a second arrangement order of the plurality of pieces of sample data based on the category of each piece of sample data, wherein the category of the sample data is used for representing the arrangement order of the sample data;
and training the second sequencing model based on the first sequencing order and the second sequencing order of the plurality of pieces of sample data to obtain the trained second sequencing model.
In one aspect, an apparatus for training a ranking model is provided, the apparatus comprising:
the first processing module is used for carrying out sorting processing on a plurality of pieces of sample data through a first sorting model to obtain a first sorting order of the plurality of pieces of sample data, wherein different pieces of sample data in the plurality of pieces of sample data comprise different content data belonging to the same information, and the first sorting model is used for determining a sorting parameter of each piece of sample data based on the different content data of the same information to obtain the sorting order of the plurality of pieces of sample data;
the second processing module is used for classifying the plurality of pieces of sample data through a second sorting model to obtain the category of each piece of sample data, and determining a second arrangement order of the plurality of pieces of sample data based on the category of each piece of sample data, wherein the category of the sample data is used for representing the arrangement order of the sample data;
and the training module is used for training the second sequencing model based on the first sequencing order and the second sequencing order of the plurality of pieces of sample data to obtain the trained second sequencing model.
In one possible implementation, the second ranking model is a multi-classification model, and the second ranking model is used for determining a class to which the input data belongs from a plurality of classes, and the classes represent different ranking orders; the second processing module comprises:
the classification unit is used for classifying each piece of sample data through the second sequencing model to obtain the probability that the sample data belongs to each class;
a first determining unit, configured to determine a category corresponding to the highest probability as a category to which the sample data belongs;
a second determining unit, configured to determine a second arrangement order of the plurality of pieces of sample data based on an arrangement rank indicated by a category to which the plurality of pieces of sample data belong.
In a possible implementation manner, the second determining unit is configured to determine, when there are multiple pieces of sample data belonging to the same category, rank order of the multiple pieces of first sample data based on probability that the multiple pieces of first sample data belong to the same category, where the multiple pieces of first sample data are sample data belonging to the same category; and determining a second arrangement order of the plurality of pieces of sample data based on the arrangement order of the classes to which other pieces of sample data except the plurality of pieces of first sample data belong in the plurality of pieces of sample data and the arrangement order of the plurality of pieces of first sample data.
In one possible implementation manner, the second sorting model is a single classification model, and the second sorting model is used for determining whether the input data belongs to a target class, and the target class represents a target arrangement order; the second processing module comprises:
the classification unit is used for classifying each piece of sample data through the second sequencing model to obtain the probability that each piece of sample data belongs to the target class;
a first determining unit, configured to determine a category to which each piece of sample data belongs based on a probability that each piece of sample data belongs to the target category, where the category is the target category or a non-target category;
a second determining unit, configured to determine a second arrangement order of the multiple pieces of sample data based on the arrangement order represented by the category to which each piece of sample data belongs.
In a possible implementation manner, the second determining unit is configured to, in a case that there are multiple pieces of sample data belonging to the target category, determine rank of the multiple pieces of second sample data based on a probability that the multiple pieces of second sample data belong to the target category, where the multiple pieces of second sample data are sample data belonging to the target category; and determining a second arrangement order of the plurality of pieces of sample data based on the arrangement rank of the class to which other sample data except the plurality of pieces of second sample data belongs in the plurality of pieces of sample data and the arrangement rank of the plurality of pieces of second sample data.
In a possible implementation manner, the first arrangement order is an order in which the plurality of pieces of sample data are arranged in a descending order according to an ordering parameter, and the training module includes:
a first determination unit configured to determine third sample data located at a previous target arrangement order based on the first arrangement order;
a second determining unit, configured to determine fourth sample data located at the previous target arrangement order based on the second arrangement order;
and the training unit is used for training the second ranking model based on the third sample data and the fourth sample data to obtain the trained second ranking model.
In a possible implementation manner, the training unit is configured to train the second ranking model based on a difference between the third sample data and the fourth sample data when the rank of the front target is one rank, so as to obtain the trained second ranking model; or, when the rank of the front target is multiple ranks, training the second ranking model based on a difference between third sample data and fourth sample data corresponding to the same rank to obtain the trained second ranking model.
In one possible implementation, each piece of sample data further includes object data of an object providing the information; and the second processing module is used for classifying the content data in the sample data through the second sequencing model and based on the object data to obtain the category of the sample data.
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 configured to perform feature extraction on content data in the sample data through the first feature extraction layer to obtain first feature data;
the second processing module is configured to perform feature extraction on the object data through the second feature extraction layer to obtain second feature data;
and the second processing module is used for performing fusion processing on the first characteristic data and the second characteristic data through the classification layer to obtain third characteristic data, and performing classification processing on the third characteristic data to obtain a category corresponding to the sample data.
In one aspect, a computer device is provided that includes one or more processors and one or more memories having at least one program code stored therein, the at least one program code being loaded by the one or more processors and executed to implement the operations performed by the sequencing model training method according to any of the possible implementations described above.
In one aspect, a computer-readable storage medium is provided, in which at least one program code is stored, and the at least one program code is loaded and executed by a processor to implement the operations performed by the ranking model training method according to any one of the above possible implementations.
In one aspect, there is provided a computer program or computer program product comprising: computer program code which, when executed by a computer, causes the computer to carry out the operations performed by the ranking model training method of any one of the possible implementations described above.
According to the ranking model training method, the ranking model training device, the ranking model training equipment and the ranking model training storage medium, different ranking orders are built into different categories, and the second ranking model is built into a category model. When the second sequencing model is trained, only the sequencing result of the second sequencing model is required to be consistent with the sequencing result of the first sequencing model, the specific score of each content data is not required to be concerned, the training difficulty of the second sequencing model is reduced on the basis of ensuring the accuracy of the output result of the second sequencing model, and the training efficiency of the second sequencing model is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
FIG. 2 is a flowchart of a ranking model training method according to an embodiment of the present disclosure;
FIG. 3 is a flow chart of a second ranking model according to an embodiment of the present application;
FIG. 4 is a flowchart of a ranking model training method provided by an embodiment of the present application;
FIG. 5 is a flow chart of a second ranking model provided in an embodiment of the present application;
FIG. 6 is a flow chart illustrating evaluation of a second ranking model provided in an embodiment of the present application;
FIG. 7 is a schematic structural diagram of a training apparatus for a ranking model according to an embodiment of the present disclosure;
FIG. 8 is a schematic structural diagram of another training apparatus for ranking models according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a terminal provided in an embodiment of the present application;
fig. 10 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
It will be understood that the terms "first," "second," and the like as used herein may be used herein to describe various concepts, which are not limited by these terms unless otherwise specified. These terms are only used to distinguish one concept from another. For example, a first image may be referred to as a second image, and similarly, a second image may be referred to as a first image, without departing from the scope of the present application.
As used herein, the terms "at least one," "a plurality," "each," and "any," at least one of which includes one, two, or more than two, a plurality of which includes two or more than two, and each of which refers to each of the corresponding plurality, and any of which refers to any of the plurality, for example, the plurality of images includes 3 images, and each of which refers to each of the 3 images, and any of which refers to any of the 3 images, which may be the first, the second, or the third.
The ranking model training method provided by the embodiment of the application is executed by computer equipment. In one possible implementation, the computer device is a terminal, for example, the terminal is any type of terminal such as a desktop computer, a tablet computer, or a mobile phone. In another possible implementation, the computer device is a server. For example, the server may be a server, a server cluster composed of several servers, or a cloud computing service center. In another possible implementation, the computer device includes a terminal and a server.
Fig. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application, and as shown in fig. 1, the implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 are connected by a wireless or wired network.
Alternatively, the terminal 101 is any type of terminal such as a desktop computer, a tablet computer, or a mobile phone. The server 102 is a server, or a server cluster composed of a plurality of servers, or a cloud computing service center.
The terminal 101 has installed thereon a target application served by the server 102, through which the terminal 101 can implement functions such as data transmission, message interaction, and the like. Optionally, the target application is an application in an operating system of the terminal 101 or an application provided by a third party. For example, the target application is an electronic commerce application having a function of recommending a merchant to the user, and of course, the electronic commerce application also has other functions such as a comment function, a shopping function, and the like.
Optionally, the terminal 101 trains the second ranking model through the first ranking model to obtain the trained second ranking model, sends the trained second ranking model to the server 102, and the server 102 screens recommendation data for the user based on the trained second ranking model and the first ranking model and sends the screened recommendation data to the terminal 101.
Optionally, the server 102 trains the second ranking model through the first ranking model to obtain the trained second ranking model, screens recommendation data for the user based on the first ranking model and the trained second ranking model, and sends the screened recommendation data to the terminal 101.
The ranking model training method provided by the embodiment of the application can be applied to any ranking model training scene.
For example, the ranking model applied to take-away recommendations trains the scenario.
When the takeout platform recommends a takeout merchant to the user, a plurality of pictures (for example, a plurality of dish pictures) of the takeout merchant can be obtained, when the takeout platform recommends the takeout merchant to the user, the pictures of the same takeout merchant are sequenced through the second sequencing model, the picture with the first rank in the takeout merchant is found, the picture with the first rank in the takeout merchant is input into the first sequencing model, the plurality of takeout merchants are sequenced through the first sequencing model based on the picture with the first rank of each takeout merchant in the plurality of takeout merchants, the sequencing of the plurality of takeout merchants is obtained, and the takeout merchant recommendation is carried out based on the sequencing of the plurality of takeout merchants and the picture with the first rank of each takeout merchant. For example, the top 10 takeaway merchants are selected for recommendation, and when the 10 takeaway merchants are shown in the list, the first ranking pictures of each takeaway merchant are respectively shown. By adopting the ranking model training method provided by the embodiment of the application, the model complexity of the second ranking model can be reduced, the processing speed of the second ranking model is increased, and the recommendation efficiency is further increased. And when the second sequencing model is trained, the training difficulty of the second sequencing model is reduced, and the training efficiency is improved.
It should be noted that, the embodiment of the present application is only an exemplary description of a ranking model training scenario in takeaway recommendation, and the ranking model training scenario is not limited.
Fig. 2 is a flowchart of a ranking model training method according to an embodiment of the present disclosure. In the embodiment of the present application, an execution subject is taken as an example of a computer device for exemplary explanation, and the embodiment includes:
201. the computer device performs sorting processing on a plurality of pieces of sample data through a first sorting model to obtain a first sorting order of the plurality of pieces of sample data, wherein different pieces of sample data comprise different content data belonging to the same information, and the first sorting model is used for determining a sorting parameter of each piece of sample data based on the different content data of the same information to obtain the sorting order of the plurality of pieces of sample data.
In the embodiment of the application, the first sequencing model is a model for sequencing, and the first sequencing model is a trained model with certain accuracy, so that data can be sequenced through the first sequencing model, and a relatively accurate sequencing result can be obtained. After data is input into the first sequencing model, the first sequencing model obtains sequencing parameters of the input data, and sequencing of the input data is achieved by obtaining parameters of the input data. The sorting parameter is data referred to for sorting the input data, and optionally, the sorting parameter is a score of the first sorting model on the input data. That is, the first ranking model may score input data to obtain scores of the input data, and by inputting a plurality of input data into the first ranking model, scores of the plurality of input data may be obtained, and the plurality of input data may be ranked based on the scores of the plurality of input data. The input data may be sorted in sequence from the scores to be small, and the input data may also be sorted in sequence from the scores to be small, which is not limited in the embodiment of the present application.
In the embodiment of the application, the information may be any information transmitted in the internet. For example, the information may be merchant information, advertisement information, article information, and the like of a take-away merchant, and the information is not limited in the embodiment of the present application. The content data is partial data in the information, taking the information as merchant information as an example, the merchant information comprises a plurality of dish pictures, and the content data is any one of the dish pictures; or the merchant information comprises a plurality of user comments, and the content data is any one of the user comments.
The sample data includes content data of the information, and different sample data among the plurality of pieces of sample data includes different content data belonging to the same information. For example, different sample data in the plurality of pieces of sample data includes different user comments of the same merchant information; for another example, different sample data in the multiple pieces of sample data include different dish pictures of the same merchant information, for example, sample data 1 includes a picture of "fried eggs with tomatoes", sample data 2 includes a picture of "green pepper bean skin", and sample data 3 includes a picture of "braised pork ribs in brown sauce", and the like.
202. And the computer equipment classifies the plurality of pieces of sample data through the second sequencing model to obtain the category of each piece of sample data, and determines a second arrangement order of the plurality of pieces of sample data based on the category of each piece of sample data, wherein the category of the sample data is used for representing the arrangement order of the sample data.
The second ranking model is the ranking model to be trained. In the embodiment of the present application, as shown in fig. 3, different arrangement orders are constructed into different categories, and a second sorting model is constructed into a classification model, so that the second sorting model determines the arrangement order of input data by determining the category of the input data, and the second sorting model performs classification processing on a plurality of input data, so as to obtain the categories of the plurality of input data, and further obtain the arrangement orders of the plurality of input data. For example, a plurality of pieces of sample data are sample data 1, sample data 2 and sample data 3, the sample data 1 is classified through the second sorting model, and the class of the sample data 1 is determined to be a first class, wherein the first class is used for indicating that the arrangement order of the sample data is a first order; classifying the sample data 2 through a second sorting model, and determining that the class of the sample data 2 is a third class, wherein the third class is used for indicating that the arrangement order of the sample data is a third bit; and classifying the sample data 3 through a second sorting model, and determining that the class of the sample data 3 is a second class, wherein the second class is used for indicating that the arrangement order of the sample data is a second order.
203. And training the second sequencing model by the computer equipment based on the first sequencing sequence and the second sequencing sequence of the plurality of pieces of sample data to obtain the trained second sequencing model.
In the embodiment of the present application, when training the second ranking model, the scoring of the second ranking model is not concerned any more, and only the order determined by the second ranking model is required to be consistent with the order determined by the first ranking model.
According to the ranking model training method provided by the embodiment of the application, different ranking orders are built into different categories, and the second ranking model is built into a classification model, so that compared with a scoring model, the model complexity of the second ranking model is reduced. When the second sequencing model is trained, only the sequencing result of the second sequencing model is required to be consistent with the sequencing result of the first sequencing model, the specific score of each content data is not required to be concerned, the training difficulty of the second sequencing model is reduced on the basis of ensuring the accuracy of the output result of the second sequencing model, and the training efficiency of the second sequencing model is improved.
Fig. 4 is a flowchart of a ranking model training method according to an embodiment of the present disclosure. In the embodiment of the present application, an execution subject is taken as an example of a computer device for exemplary explanation, and the embodiment includes:
401. the computer device performs sorting processing on a plurality of pieces of sample data through a first sorting model to obtain a first sorting order of the plurality of pieces of sample data, wherein different pieces of sample data in the plurality of pieces of sample data comprise different content data belonging to the same information, and the first sorting model is used for determining a sorting parameter of each piece of sample data based on the different content data of the same information to obtain the sorting order of the plurality of pieces of sample data.
In one possible implementation, the first ordering model may process multiple pieces of sample data together at a time. The method comprises the steps of inputting a plurality of pieces of sample data into a first sequencing model, processing the input plurality of pieces of sample data by the first sequencing model to obtain a sequencing parameter of each piece of sample data, and determining a first sequencing order of the plurality of pieces of sample data based on the sequencing parameter of each piece of sample data. In the embodiment of the present application, in order to distinguish an arrangement order of a plurality of pieces of sample data determined by a first ordering model from an arrangement order of a plurality of pieces of sample data determined by a second ordering model, the arrangement order of the plurality of pieces of sample data determined by the first ordering model is referred to as a first arrangement order, and the arrangement order of the plurality of pieces of sample data determined by the second ordering model is referred to as a second arrangement order.
In another possible implementation, the first ordering model processes one sample of data at a time. Each piece of sample data in the plurality of pieces of sample data is sequentially input into a first sequencing model, the first sequencing model processes the input sample data to obtain a sequencing parameter of the sample data, the sequencing parameter of each piece of sample data is obtained after each piece of sample data is input into the first sequencing model, and the first sequencing order of the plurality of pieces of sample data is determined based on the sequencing parameter of each piece of sample data.
In one possible implementation manner, each piece of sample data further includes object data of an object providing the information, and the computer device performs sorting processing on a plurality of pieces of sample data through the first sorting model to obtain a first sorting order of the plurality of pieces of sample data, including: and for each piece of sample data, the computer device performs sorting processing on the content data in the sample data through the first sorting model and on the basis of the object data to obtain a first sorting sequence of the plurality of pieces of sample data. Because the first ordering model takes the object data of the object providing the information into consideration when ordering different content data of the same information, the first ordering model can adaptively adjust the ordering of different content data in the information based on different objects, and realize thousands of people.
In the embodiments of the present application, data related to a user, such as object data, needs to obtain user permission or consent when the embodiments of the present application are applied to specific products or technologies, and the collection, use and processing of the related data need to comply with relevant laws and regulations and standards of relevant countries and regions.
Optionally, the first ranking model includes a feature extraction layer and a ranking parameter acquisition layer; for each piece of sample data, performing feature extraction on object data and content data in the sample data through a feature extraction layer to obtain a first feature; processing the first characteristic through a sorting parameter acquisition layer to obtain a sorting parameter of the sample data; a first ranking order of the pieces of sample data is determined based on the ranking parameter of each piece of sample data.
Taking a takeaway recommendation scene as an example, the content data in the sample data can be any one of a plurality of dish pictures provided by a merchant; any one of the plurality of user comments may be used. The object providing the information is a takeaway merchant, the object data of the object is merchant data of the takeaway merchant, and the merchant data may include click probability of the merchant, a business circle where the merchant is located, sales volume of the merchant, interaction information between the merchant and the user, and the like.
It should be noted that the second ranking model is also used for ranking different information, and when ranking different information, information such as quotation of an object providing the information is also considered, and the second ranking model is only used for ranking different content data of the same information, so the second ranking model does not consider information such as quotation of an object providing the information, and the considered information is not completely the same when determining the ranking order by the first ranking model and the second ranking model. Taking the example that the first ranking model and the second ranking model are scoring models in the related art, since the scoring dimensionality of the first ranking model is not completely the same as the scoring dimensionality of the second ranking model, it is not possible to train the second ranking model based on the first ranking model to score accurately.
402. And the computer equipment classifies a plurality of pieces of sample data through the second sequencing model to obtain the category of each piece of sample data, wherein the category of the sample data is used for representing the arrangement rank of the sample data.
In the embodiment of the application, the second sorting model is not constructed into the scoring model, but is constructed into the classification model, different arrangement orders are constructed into different categories, the category of the input data is determined through the second sorting model to determine the arrangement order of the input data, and the first sorting model is used for guiding the second sorting model to perform accurate sorting.
In one possible implementation, the second ranking model may process multiple pieces of sample data together at a time. And inputting the plurality of pieces of sample data into a second sorting model together, and classifying the plurality of pieces of input sample data by the second sorting model to obtain the category of each piece of sample data. For example, 10 pieces of sample data are input together to a second ranking model, and the 10 pieces of sample data are classified into 1 to 10 categories by the second ranking model.
In a possible implementation manner, the second sorting model processes one piece of sample data each time, each piece of sample data in the plurality of pieces of sample data is sequentially input into the second sorting model, the second sorting model performs classification processing on the input sample data to obtain the category of the sample data, and after each piece of sample data is input into the second sorting model, the category of each piece of sample data is obtained.
In one possible implementation, the second ranking model is a multi-classification model, and the second ranking model is used for determining a class to which the input data belongs from a plurality of classes, and the classes represent different ranking orders. The computer equipment classifies a plurality of pieces of sample data through the second sequencing model to obtain the category of each piece of sample data, and the method comprises the following steps: and the computer equipment classifies each piece of sample data, and determines the class of the sample data from multiple classes. Optionally, the classifying, by the computer device, the multiple pieces of sample data through the second sorting model to obtain the category of each piece of sample data includes: for each piece of sample data, classifying the sample data through a second sequencing model to obtain the probability that the sample data belongs to each class; and determining the category corresponding to the highest probability as the category to which the sample data belongs.
For example, the plurality of categories are a first category, a second category, and a third category, and after the sample data is classified by the second ranking model, the probability that the sample data belongs to the first category is 20%, the probability that the sample data belongs to the second category is 50%, and the probability that the sample data belongs to the third category is 30%. Since the sample data has the highest probability of belonging to the second class, it is determined that the sample data belongs to the second class.
In another possible implementation, the second ranking model is a single classification model, and the second ranking model is used for determining whether the input data belongs to a target class, and the target class represents the target ranking. The computer equipment classifies a plurality of pieces of sample data through the second sequencing model to obtain the category of each piece of sample data, and the method comprises the following steps: classifying each piece of sample data through a second sequencing model to obtain the probability that each piece of sample data belongs to the target class; and determining the class of each sample data based on the probability of each sample data belonging to the target class, wherein the class is a target class or a non-target class.
The target rank may be any rank, for example, the target rank may be the first rank, that is, the first bit in the rank order. The embodiment of the application does not limit the target arrangement order.
Optionally, the determining, by the computer device, the class to which each sample data belongs based on the probability that each sample data belongs to the target class includes: the method comprises the steps that under the condition that the probability that sample data belongs to a target category exceeds a first probability threshold value, computer equipment determines that the category to which the sample data belongs is the target category; and under the condition that the probability that the sample data belongs to the target class does not exceed the first probability threshold, determining that the class to which the sample data belongs is a non-target class. The first probability threshold may be any value, for example, the first probability threshold is 50%, etc. The first probability threshold may be an empirical value or a numerical value set by a technician, and the first probability threshold is not limited in the embodiment of the present application.
In one possible implementation, each piece of sample data further includes object data of an object providing the information; the computer equipment classifies a plurality of pieces of sample data through the second sequencing model to obtain the category of each piece of sample data, and the method comprises the following steps: and the computer equipment classifies the content data in the sample data through the second sequencing model based on each piece of sample data and the object data to obtain the class of the sample data. The second ordering model takes the object data of the object providing the information into consideration when ordering different content data of the same information, so that the first ordering model can adaptively adjust the ordering of different content data in the information based on different objects, and thousands of people are realized.
The object is the same as the object in step 301, and the object data is the same as the object data in step 301, which is not described in detail herein.
In one possible implementation, as shown in fig. 5, the second ranking model includes a first feature extraction layer, a second feature extraction layer, and a classification layer; the computer equipment classifies the content data in the sample data through the second sequencing model based on the object data to obtain the category of the sample data, and the method comprises the following steps: performing feature extraction on content data in the sample data through a first feature extraction layer to obtain first feature data; performing feature extraction on the object data through a second feature extraction layer to obtain second feature data; and performing fusion processing on the first characteristic data and the second characteristic data through a classification layer to obtain third characteristic data, and performing classification processing on the third characteristic data to obtain the class of the sample data.
The first feature data and the second feature data are fused, and the first feature data and the second feature data may be subjected to point multiplication, cross multiplication and the like.
Optionally, the second ranking model comprises a third feature extraction layer and a classification layer; the computer equipment classifies the content data in the sample data through the second sequencing model based on the object data to obtain the category of the sample data, and the method comprises the following steps: performing feature extraction on object data and content data in the sample data through a third feature extraction layer to obtain fourth feature data; and classifying the fourth feature data through a classification layer to obtain the class of the sample data.
It should be noted that, in the related art, the second ranking model processes only the content data, and does not consider the object data, and in this embodiment of the application, the object data is also used as the processing data of the second ranking model, so that the second ranking model can classify the content data more accurately based on the object data. It should be noted that, in the embodiment of the present application, although the first ordering model and the second ordering model both consider the object data, the object data considered by the first ordering model is more comprehensive, and the second ordering model considers less object data than the first ordering model. For example, the first ranking model may consider the price quote, etc., of the provided information by the object, while the first ranking model may not consider the price quote, etc., of the provided information by the object.
403. The computer device determines a second arrangement order of the plurality of pieces of sample data based on the category of each piece of sample data.
In this embodiment, the class of the sample data indicates the rank of the sample data, and therefore, the computer device may determine the second ranking order of the plurality of pieces of sample data based on the class of each piece of sample data. In one possible implementation, the computer device determines a second arrangement order of the plurality of pieces of sample data based on the category of each piece of sample data, including: and determining a second arrangement order of the plurality of pieces of sample data based on the arrangement order represented by the category to which the plurality of pieces of sample data belong.
When the second ranking model determines the category of the sample data, the category of the sample data may be directly determined, or the probability that the sample data belongs to a certain category may be determined, and the category of the sample data is determined according to the probability that the sample data belongs to the category. In one possible implementation, the second ranking model determines the class of sample data by determining a probability that the sample data belongs to the class. However, after the second sorting model processes a plurality of pieces of sample data, the categories corresponding to part of the sample data may be the same. Optionally, the determining, by the computer device, a second arrangement order of the plurality of pieces of sample data based on the arrangement order represented by the category to which the plurality of pieces of sample data belong includes: the method comprises the steps that when a plurality of pieces of sample data belonging to the same category exist, the computer equipment determines the arrangement order of the plurality of pieces of first sample data based on the probability that the plurality of pieces of first sample data belong to the same category, wherein the plurality of pieces of first sample data are the sample data belonging to the same category; and determining a second arrangement order of the plurality of pieces of sample data based on the arrangement order of the class to which other sample data except the plurality of pieces of first sample data belongs in the plurality of pieces of sample data and the arrangement order of the plurality of pieces of first sample data.
The ranking order of the plurality of pieces of first sample data is determined based on the probability that the plurality of pieces of first sample data belong to the same category, and the ranking order of the plurality of pieces of first sample data may be determined in the order from high to low of the probability based on the probability that the plurality of pieces of first sample data belong to the same category; the rank order of the plurality of pieces of first sample data may be determined in order from low to high based on the probability that the plurality of pieces of first sample data belong to the same category.
For example, the plurality of pieces of first sample data all belong to a first category, the first category indicates that the ranking order is first, and when the probability that the first sample data belongs to the first category is higher, it indicates that the higher the probability that the ranking order of the first sample data is first, the earlier the ranking order of the first sample data is.
For example, if the sample data 1, the sample data 2, and the sample data 3 all belong to the first category, the sample data 4 and the sample data 5 all belong to the second category, the sample data 6 belongs to the third category, the probability that the sample data 1 belongs to the first category is 55%, the probability that the sample data 2 belongs to the first category is 79%, the probability that the sample data 3 belongs to the first category is 98%, the probability that the sample data 4 belongs to the second category is 77%, and the probability that the sample data 5 belongs to the second category is 74%, it is determined that the arrangement order of the sample data 3 is the first order, the arrangement order of the sample data 2 is the second order, the arrangement order of the sample data 1 is the third order, the arrangement order of the sample data 4 is the fourth order, the arrangement order of the sample data 5 is the fifth order, and the arrangement order of the sample data 6 is the sixth order.
In one possible implementation, the second sorting model is a single classification model for determining whether the input data belongs to a target class, and the target class represents a target ranking. Optionally, the determining, by the computer device, a second arrangement order of the plurality of pieces of sample data based on the arrangement order represented by the category to which each piece of sample data belongs includes: under the condition that a plurality of pieces of sample data belonging to the target category exist, determining the ranking of the plurality of pieces of second sample data based on the probability that the plurality of pieces of second sample data belong to the target category, wherein the plurality of pieces of second sample data are the sample data belonging to the target category; and determining a second arrangement order of the plurality of pieces of sample data based on the arrangement order of the classes to which other sample data except the plurality of pieces of second sample data belongs in the plurality of pieces of sample data and the arrangement orders of the plurality of pieces of second sample data.
The target arrangement order may be any one of a first order, a second order, and the like, and the target arrangement order is not limited in this embodiment of the application. The rank of the plurality of pieces of second sample data is determined based on the probability that the plurality of pieces of second sample data belong to the target category, which may be that the second sample data with the highest probability belonging to the target category is determined as the sample data of the target rank, and other second sample data belonging to the target category is determined as the sample data of the non-target rank. The second arrangement order of the plurality of pieces of sample data is determined based on the arrangement rank of the class to which other sample data except the plurality of pieces of second sample data belongs and the arrangement ranks of the plurality of pieces of second sample data, and may be sample data in which other sample data is determined to be non-target arrangement ranks.
404. And training the second sequencing model by the computer equipment based on the first sequencing sequence and the second sequencing sequence of the plurality of pieces of sample data to obtain the trained second sequencing model.
In the embodiment of the application, the first ordering model only needs to guide the second ordering model to order, so that when the second ordering model is trained, the second ordering model is trained based on the first ordering sequence and the second ordering sequence of a plurality of pieces of sample data, and the ordering sequence obtained by the second ordering model is consistent with the ordering sequence obtained by the first ordering model.
In one possible implementation manner, the training, by the computer device, the second ranking model based on the first ranking order and the second ranking order of the plurality of pieces of sample data to obtain the trained second ranking model includes: and training the second sequencing model by the computer equipment based on the difference between the sample data in the same arrangement order in the first arrangement order and the sample data in the same arrangement order in the second arrangement order to obtain the trained second sequencing model.
For example, the first arrangement order indicates that sample data 1 is located at the first bit, sample data 2 is located at the third bit, and sample data 3 is located at the second bit; the second arrangement order indicates that the sample number 2 is located at the first bit, the sample data 2 is located at the second bit, and the sample data 3 is located at the third bit. Then a second ranking model is trained based on the differences between sample data 1 and sample data 2, between sample data 2 and sample data 3, and between sample data 3 and sample data 2.
In a possible implementation manner, the second ranking model only needs to determine the data of the previous target rank from the plurality of data, and then the second ranking model only needs to be able to accurately determine the data of the previous target rank. When the second ranking model is trained, the second ranking model only needs to be trained based on the result of the previous target rank. Optionally, the first arrangement order is an order in which the plurality of pieces of sample data are sequentially arranged in a descending manner according to the sorting parameter, and the second arrangement order is an order in which the plurality of pieces of sample data are sequentially arranged in a descending manner according to the sorting parameter. The computer device trains the second ranking model based on the first ranking order and the second ranking order of the plurality of pieces of sample data to obtain a trained second ranking model, and the method comprises the following steps: the computer equipment determines third sample data of the arrangement order of the previous targets based on the first arrangement order; determining fourth sample data positioned at the arrangement order of the front target based on the second arrangement order; and training the second ranking model based on the third sample data and the fourth sample data to obtain the trained second ranking model.
Optionally, the training, by the computer device, the second ranking model based on the third sample data and the fourth sample data to obtain a trained second ranking model, including: training the second ranking model based on the difference between the third sample data and the fourth sample data under the condition that the arrangement order of the front target is one arrangement order to obtain a trained second ranking model; or, when the arrangement order of the front target is multiple arrangement orders, training the second ranking model based on the difference between third sample data and fourth sample data corresponding to the same arrangement order to obtain the trained second ranking model.
In a possible implementation manner, the second ranking model only needs to determine the data located at the later target rank from the plurality of data, and then the second ranking model only needs to be able to accurately determine the data at the later target rank. When the second ranking model is trained, the second ranking model is only required to be trained based on the result of the post-target rank. Optionally, the first arrangement order is an order in which the plurality of pieces of sample data are sequentially arranged in an increasing order according to the sorting parameter, and the second arrangement order is an order in which the plurality of pieces of sample data are sequentially arranged in an increasing order according to the sorting parameter. The computer device trains the second ranking model based on the first ranking order and the second ranking order of the plurality of pieces of sample data to obtain a trained second ranking model, and the method comprises the following steps: the computer equipment determines fifth sample data located at the later target arrangement order based on the first arrangement order; determining sixth sample data located at the rear target arrangement order based on the second arrangement order; and training the second ranking model based on the fifth sample data and the sixth sample data to obtain the trained second ranking model.
Optionally, the training, by the computer device, the second ranking model based on the fifth sample data and the sixth sample data to obtain a trained second ranking model, including: training the second ranking model based on the difference between the fifth sample data and the sixth sample data under the condition that the ranking order of the front target is one ranking order to obtain a trained second ranking model; or, when the arrangement order of the front target is multiple arrangement orders, training the second ranking model based on the difference between the fifth sample data and the sixth sample data corresponding to the same arrangement order to obtain the trained second ranking model.
It should be noted that, in this embodiment of the present application, when training the second ranking model, any loss function may be used for training, for example, a Softmax function (an activation function), and the loss function is not limited in this embodiment of the present application.
In the embodiment of the application, a plurality of pieces of sample data are different content data of the same information, the plurality of pieces of sample data can be regarded as a group of sample data, and after the group of sample data is processed through the first sorting model and the second sorting model, the second sorting model is trained through the difference between the processing result of the second sorting model and the processing result of the first sorting model. And then, different content data of another piece of information can be acquired as a plurality of pieces of sample data, the second ranking model is trained through a sample data group consisting of the plurality of pieces of sample data, and the training of the second ranking model is stopped until the second ranking model has certain accuracy.
Taking the example that the second ranking model only needs to accurately find the first-ranked content data from different content data of the same information, as shown in fig. 6, the first-ranked content data determined by the first ranking model and the first-ranked content data determined by the second ranking model are compared, the same proportion of the first-ranked content data determined by the first ranking model and the second-ranked content data determined by the second ranking model is determined, the proportion is used as the accuracy of the second ranking model, and when the accuracy of the second ranking model reaches the target accuracy, the training of the second ranking model is stopped.
According to the ranking model training method provided by the embodiment of the application, different ranking orders are built into different categories, and the second ranking model is built into a classification model, so that compared with a scoring model, the model complexity of the second ranking model is reduced. When the second sequencing model is trained, only the sequencing result of the second sequencing model is required to be consistent with the sequencing result of the first sequencing model, the specific score of each content data is not required to be concerned, the training difficulty of the second sequencing model is reduced on the basis of ensuring the accuracy of the output result of the second sequencing model, and the training efficiency of the second sequencing model is improved.
In the embodiment of the application, the object data is also used as the processing data of the second sorting model, so that the second sorting model can classify the content data more accurately based on the object data. In addition, in the embodiment of the application, a second feature extraction layer is further added in the second ranking model, the feature data of the object data is extracted through the second feature extraction layer, and the feature data of the object data and the feature data of the content data are fused, so that the influence of the feature data of the object data on the classification of the feature data of the content data is more prominent.
In addition, in the embodiment of the application, the second sorting model can accurately sort the content data of the same information, so that the optimal content data of the information can be exposed, and the exposure effect of the information can be improved.
Fig. 7 is a schematic structural diagram of a ranking model training apparatus provided in an embodiment of the present application, and referring to fig. 7, the apparatus includes:
a first processing module 701, configured to perform sorting processing on multiple pieces of sample data through a first sorting model to obtain a first sorting order of the multiple pieces of sample data, where different pieces of sample data in the multiple pieces of sample data include different content data belonging to the same information, and the first sorting model is configured to determine, based on different content data of the same information, a sorting parameter of each piece of sample data to obtain the sorting order of the multiple pieces of sample data;
a second processing module 702, configured to perform classification processing on the multiple pieces of sample data through a second sorting model to obtain a category of each piece of sample data, and determine a second arrangement order of the multiple pieces of sample data based on the category of each piece of sample data, where the category of the sample data is used to indicate an arrangement rank of the sample data;
a training module 703, configured to train the second ranking model based on the first ranking order and the second ranking order of the multiple pieces of sample data, to obtain a trained second ranking model.
As shown in fig. 8, in one possible implementation, the second ranking model is a multi-classification model, and the second ranking model is used for determining a class to which the input data belongs from a plurality of classes, and the classes represent different ranking orders; the second processing module 702 includes:
a classifying unit 7021, configured to, for each piece of sample data, perform classification processing on the sample data through the second sorting model to obtain a probability that the sample data belongs to each category;
a first determining unit 7022, configured to determine a category corresponding to the highest probability as a category to which the sample data belongs;
a second determining unit 7023, configured to determine a second arrangement order of the multiple pieces of sample data based on the arrangement order represented by the category to which the multiple pieces of sample data belong.
In a possible implementation manner, the second determining unit 7023 is configured to, when there are multiple pieces of sample data belonging to the same category, determine rank of the multiple pieces of first sample data based on a probability that the multiple pieces of first sample data belong to the same category, where the multiple pieces of first sample data are sample data belonging to the same category; and determining a second arrangement order of the plurality of pieces of sample data based on the arrangement order of the classes to which other pieces of sample data except the plurality of pieces of first sample data belong in the plurality of pieces of sample data and the arrangement order of the plurality of pieces of first sample data.
In one possible implementation manner, the second sorting model is a single classification model, and the second sorting model is used for determining whether the input data belongs to a target class, and the target class represents a target arrangement order; the second processing module 702 includes:
a classifying unit 7021, configured to perform classification processing on each piece of sample data through the second sorting model to obtain a probability that each piece of sample data belongs to the target category;
a first determining unit 7022, configured to determine, based on a probability that each piece of sample data belongs to the target category, a category to which each piece of sample data belongs, where the category is the target category or a non-target category;
a second determining unit 7023, configured to determine a second arrangement order of the multiple pieces of sample data based on the arrangement order represented by the class to which each piece of sample data belongs.
In a possible implementation manner, the second determining unit 7023 is configured to, when there are multiple pieces of sample data belonging to the target class, determine rank of the multiple pieces of second sample data based on a probability that the multiple pieces of second sample data belong to the target class, where the multiple pieces of second sample data are sample data belonging to the target class; and determining a second arrangement order of the plurality of pieces of sample data based on the arrangement rank of the class to which other sample data except the plurality of pieces of second sample data belongs in the plurality of pieces of sample data and the arrangement rank of the plurality of pieces of second sample data.
In a possible implementation manner, the first arrangement order is an order in which the plurality of pieces of sample data are sequentially arranged in a descending order according to an ordering parameter, and the training module 703 includes:
a first determining unit 7031, configured to determine, based on the first arrangement order, third sample data located at a previous target arrangement order;
a second determining unit 7032, configured to determine, based on the second arrangement order, fourth sample data located at the previous target arrangement order;
a training unit 7033, configured to train the second ranking model based on the third sample data and the fourth sample data, to obtain the trained second ranking model.
In a possible implementation manner, the training unit 7033 is configured to, when the rank of the front target is one rank, train the second ranking model based on a difference between the third sample data and the fourth sample data to obtain the trained second ranking model; or, when the rank of the front target is multiple ranks, training the second ranking model based on a difference between third sample data and fourth sample data corresponding to the same rank to obtain the trained second ranking model.
In one possible implementation, each piece of sample data further includes object data of an object providing the information; the second processing module 702 is configured to, for each piece of sample data, perform classification processing on content data in the sample data based on the object data through the second sorting model to obtain a category of the sample data.
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 configured to perform feature extraction on content data in the sample data through the first feature extraction layer to obtain first feature data;
the second processing module 702 is configured to perform feature extraction on the object data through the second feature extraction layer to obtain second feature data;
the second processing module 702 is configured to perform fusion processing on the first feature data and the second feature data through the classification layer to obtain third feature data, and perform classification processing on the third feature data to obtain a category corresponding to the sample data.
It should be noted that: in the training of the ranking model, the ranking model training apparatus provided in the above embodiment is only illustrated by the division of the above functional modules, and in practical applications, the above functions may be distributed by different functional modules according to needs, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the above described functions. In addition, the device for training the ranking model and the method for training the ranking model provided by the above embodiments belong to the same concept, and the specific implementation process thereof is described in the method embodiments, and is not described herein again.
In an exemplary embodiment, a computer device is provided that includes one or more processors and one or more memories having stored therein at least one program code that is loaded and executed by the one or more processors to implement the ranking model training method as in the above embodiments.
Optionally, the computer device is provided as a terminal. Fig. 9 shows a block diagram of a terminal 900 according to an exemplary embodiment of the present application. The terminal 900 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. Terminal 900 may also be referred to by other names such as user equipment, portable terminals, laptop terminals, desktop terminals, and the like.
The terminal 900 includes: a processor 901 and a memory 902.
Processor 901 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so forth. The processor 901 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 901 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 901 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 901 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
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, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 902 is used to store at least one program code for execution by processor 901 to implement the ranking model training methods provided by method embodiments herein.
In some embodiments, terminal 900 can also optionally include: a peripheral interface 903 and at least one peripheral. The processor 901, memory 902, and peripheral interface 903 may be connected by buses or signal lines. Various peripheral devices may be connected to the peripheral interface 903 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 904, display screen 905, camera 906, audio circuitry 907, positioning component 908, and power supply 909.
The peripheral interface 903 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 901 and the memory 902. In some embodiments, the processor 901, memory 902, and peripheral interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 901, the memory 902 and the peripheral interface 903 may be implemented on a separate chip or circuit board, which is not limited by this embodiment.
The Radio Frequency circuit 904 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 904 communicates with communication networks and other communication devices via electromagnetic signals. The radio frequency circuit 904 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 904 comprises: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuit 904 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: metropolitan area networks, various generation mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the radio frequency circuit 904 may also include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 905 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 905 is a touch display screen, the display screen 905 also has the ability to capture touch signals on or over the surface of the display screen 905. The touch signal may be input to the processor 901 as a control signal for processing. At this point, the display 905 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 905 may be one, providing the front panel of the terminal 900; in other embodiments, the number of the display panels 905 may be at least two, and each of the display panels is disposed on a different surface of the terminal 900 or is in a foldable design; in still other embodiments, the display 905 may be a flexible display disposed on a curved surface or a folded surface of the terminal 900. Even more, the display screen 905 may be arranged in a non-rectangular irregular figure, i.e. a shaped screen. The Display panel 905 can be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and other materials.
The camera assembly 906 is used to capture images or video. Optionally, camera assembly 906 includes a front camera and a rear camera. The front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 906 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
Audio circuit 907 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 901 for processing, or inputting the electric signals to the radio frequency circuit 904 for realizing voice communication. For stereo sound acquisition or noise reduction purposes, the microphones may be multiple and disposed at different locations of the terminal 900. The microphone may also be an array microphone or an omni-directional acquisition microphone. The speaker is used to convert the electrical signals from the processor 901 or the radio frequency circuit 904 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, audio circuit 907 may also include a headphone jack.
The positioning component 908 is used to locate the current geographic Location of the terminal 900 for navigation or LBS (Location Based Service). The Positioning component 908 may be a Positioning component based on the GPS (Global Positioning System) in the united states, the beidou System in china, the graves System in russia, or the galileo System in the european union.
Power supply 909 is used to provide power to the various components in terminal 900. The power source 909 may be alternating current, direct current, disposable or rechargeable. When power source 909 comprises a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, terminal 900 can also include one or more sensors 910. The one or more sensors 190 include, but are not limited to: acceleration sensor 911, gyro sensor 912, pressure sensor 913, fingerprint sensor 914, optical sensor 915, and proximity sensor 916.
The acceleration sensor 911 can detect the magnitude of acceleration in three coordinate axes of the coordinate system established with the terminal 900. For example, the acceleration sensor 911 may be used to detect the components of the gravitational acceleration in three coordinate axes. The processor 901 can control the display screen 905 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 911. The acceleration sensor 911 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 912 may detect a body direction and a rotation angle of the terminal 900, and the gyro sensor 912 may cooperate with the acceleration sensor 911 to acquire a 3D motion of the user on the terminal 900. The processor 901 can implement the following functions according to the data collected by the gyro sensor 912: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
The pressure sensor 913 may be disposed on a side bezel of the terminal 900 and/or underneath the display 905. When the pressure sensor 913 is disposed on the side frame of the terminal 900, the user's holding signal of the terminal 900 may be detected, and the processor 901 performs left-right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 913. When the pressure sensor 913 is disposed at the lower layer of the display screen 905, the processor 901 controls the operable control on the UI interface according to the pressure operation of the user on the display screen 905. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 914 is used for collecting a fingerprint of the user, and the processor 901 identifies the user according to the fingerprint collected by the fingerprint sensor 914, or the fingerprint sensor 914 identifies the user according to the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, processor 901 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings, etc. The fingerprint sensor 914 may be disposed on the front, back, or side of the terminal 900. When a physical key or vendor Logo is provided on the terminal 900, the fingerprint sensor 914 may be integrated with the physical key or vendor Logo.
The optical sensor 915 is used to collect ambient light intensity. In one embodiment, the processor 901 may 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 reduced. In another embodiment, the processor 901 can also dynamically adjust the shooting parameters of the camera assembly 906 according to the ambient light intensity collected by the optical sensor 915.
A proximity sensor 916, also referred to as a distance sensor, is provided on the front panel of the terminal 900. The proximity sensor 916 is used to collect the distance between the user and the front face of the terminal 900. In one embodiment, when the proximity sensor 916 detects that the distance between the user and the front face of the terminal 900 gradually decreases, the processor 901 controls the display 905 to switch from the bright screen state to the dark screen state; when the proximity sensor 916 detects that the distance between the user and the front surface of the terminal 900 gradually becomes larger, the display 905 is controlled by the processor 901 to switch from the breath screen state to the bright screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 9 does not constitute a limitation of terminal 900, and may include more or fewer components than those shown, or may combine certain components, or may employ a different arrangement of components.
Optionally, the computer device is provided as a server. Fig. 10 is a schematic structural diagram of a server according to an embodiment of the present application, where the server 1000 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 1001 and one or more memories 1002, where the memory 1002 stores at least one program code, and the at least one program code is loaded and executed by the processors 1001 to implement the methods provided by the method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input/output, and the server may also include other components for implementing the functions of the device, which are not described herein again.
The server 1000 is configured to perform the steps performed by the server in the above method embodiments.
In an exemplary embodiment, a computer-readable storage medium, such as a memory including program code, which is executable by a processor in a computer device to perform the ranking model training method in the above embodiments, is also provided. For example, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program or a computer program product is also provided, which comprises computer program code, which, when executed by a computer, causes the computer to implement the ranking model training method in the above-described embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (12)

1. A method of ranking model training, the method comprising:
the method comprises the steps that a plurality of pieces of sample data are subjected to sorting processing through a first sorting model to obtain a first sorting order of the plurality of pieces of sample data, different sample data in the plurality of pieces of sample data comprise different content data belonging to the same information, and the first sorting model is used for determining a sorting parameter of each piece of sample data based on the different content data of the same information to obtain the sorting order of the plurality of pieces of sample data;
classifying the plurality of pieces of sample data through a second sequencing model to obtain the category of each piece of sample data, and determining a second arrangement order of the plurality of pieces of sample data based on the category of each piece of sample data, wherein the category of the sample data is used for representing the arrangement order of the sample data;
and training the second sequencing model based on the first sequencing order and the second sequencing order of the plurality of pieces of sample data to obtain the trained second sequencing model.
2. The method of claim 1, wherein the second order model is a multi-classification model, and the second order model is configured to determine a class to which input data belongs from a plurality of classes, the plurality of classes representing different orders of arrangement, and the classifying the plurality of pieces of sample data by the second order model to obtain the class of each piece of sample data, and determining the second order of the plurality of pieces of sample data based on the class of each piece of sample data comprises:
for each piece of sample data, classifying the sample data through the second sequencing model to obtain the probability that the sample data belongs to each class;
determining the category corresponding to the highest probability as the category to which the sample data belongs;
and determining a second arrangement order of the plurality of pieces of sample data based on the arrangement order represented by the category to which the plurality of pieces of sample data belong.
3. The method according to claim 2, wherein said determining the second arrangement order of the plurality of pieces of sample data based on the arrangement order of the class representations to which the plurality of pieces of sample data belongs comprises:
under the condition that a plurality of pieces of sample data belonging to the same category exist, determining the arrangement order of the plurality of pieces of first sample data based on the probability that the plurality of pieces of first sample data belong to the same category, wherein the plurality of pieces of first sample data are the sample data belonging to the same category;
determining a second arrangement order of the plurality of pieces of sample data based on the arrangement order of the classes to which the other pieces of sample data except the plurality of pieces of first sample data belong and the arrangement order of the plurality of pieces of first sample data.
4. The method of claim 1, wherein the second order model is a single classification model, and the second order model is used for determining whether the input data belongs to a target class, and the target class represents a target ranking order;
classifying the plurality of pieces of sample data through a second sorting model to obtain the category of each piece of sample data, and determining a second arrangement order of the plurality of pieces of sample data based on the category of each piece of sample data, including:
classifying each piece of sample data through the second sequencing model to obtain the probability of each piece of sample data belonging to the target category;
determining the class of each sample data based on the probability of each sample data belonging to the target class, wherein the class is the target class or a non-target class;
and determining a second arrangement order of the plurality of pieces of sample data based on the arrangement order represented by the category to which each piece of sample data belongs.
5. The method according to claim 4, wherein said determining the second arrangement order of the plurality of pieces of sample data based on the arrangement order of the class representation to which each piece of sample data belongs comprises:
under the condition that a plurality of pieces of sample data belong to the target class, determining the ranking of the plurality of pieces of second sample data based on the probability that the plurality of pieces of second sample data belong to the target class, wherein the plurality of pieces of second sample data are the sample data belonging to the target class;
and determining a second arrangement order of the plurality of pieces of sample data based on the arrangement rank of the class to which other sample data except the plurality of pieces of second sample data belongs in the plurality of pieces of sample data and the arrangement rank of the plurality of pieces of second sample data.
6. The method of claim 1, wherein the first arrangement order is an order in which the plurality of pieces of sample data are arranged in a descending order according to an ordering parameter, and the training of the second ordering model based on the first arrangement order and the second arrangement order of the plurality of pieces of sample data to obtain the trained second ordering model comprises:
determining third sample data located at a previous target arrangement order based on the first arrangement order;
determining fourth sample data located at the front target arrangement order based on the second arrangement order;
and training the second ranking model based on the third sample data and the fourth sample data to obtain the trained second ranking model.
7. The method of claim 6, wherein said training the second ranking model based on the third sample data and the fourth sample data to obtain the trained second ranking model comprises:
training the second ranking model based on the difference between the third sample data and the fourth sample data under the condition that the ranking order of the front target is one ranking order to obtain the trained second ranking model; alternatively, the first and second electrodes may be,
and under the condition that the arrangement order of the front target is a plurality of arrangement orders, training the second ranking model based on the difference between third sample data and fourth sample data corresponding to the same arrangement order to obtain the trained second ranking model.
8. The method of claim 1, wherein each piece of sample data further includes object data of an object providing the information; classifying the plurality of pieces of sample data through the second sorting model to obtain the category of each piece of sample data, including:
and for each piece of sample data, classifying the content data in the sample data based on the object data through the second sequencing model to obtain the category of the sample data.
9. The method of claim 8, wherein the second order model comprises a first feature extraction layer, a second feature extraction layer, and a classification layer; classifying the content data in the sample data based on the object data through the second sorting model to obtain the category of the sample data, including:
performing feature extraction on content data in the sample data through the first feature extraction layer to obtain first feature data;
performing feature extraction on the object data through the second feature extraction layer to obtain second feature data;
and performing fusion processing on the first characteristic data and the second characteristic data through the classification layer to obtain third characteristic data, and performing classification processing on the third characteristic data to obtain the category of the sample data.
10. An order model training apparatus, the apparatus comprising:
the first processing module is used for carrying out sorting processing on a plurality of pieces of sample data through a first sorting model to obtain a first sorting order of the plurality of pieces of sample data, wherein different pieces of sample data in the plurality of pieces of sample data comprise different content data belonging to the same information, and the first sorting model is used for determining a sorting parameter of each piece of sample data based on the different content data of the same information to obtain the sorting order of the plurality of pieces of sample data;
the second processing module is used for classifying the plurality of pieces of sample data through a second sorting model to obtain the category of each piece of sample data, and determining a second arrangement order of the plurality of pieces of sample data based on the category of each piece of sample data, wherein the category of the sample data is used for representing the arrangement order of the sample data;
and the training module is used for training the second sequencing model based on the first sequencing order and the second sequencing order of the plurality of pieces of sample data to obtain the trained second sequencing model.
11. A computer device comprising one or more processors and one or more memories having stored therein at least one program code, the at least one program code loaded into and executed by the one or more processors to perform the operations performed by the sequencing model training method of any of claims 1 to 9.
12. A computer-readable storage medium having stored therein at least one program code, which is loaded and executed by a processor to perform operations performed by the order model training method of any one of claims 1 to 9.
CN202210119045.5A 2022-02-08 2022-02-08 Ranking model training method, device, equipment and storage medium Pending CN114444724A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210119045.5A CN114444724A (en) 2022-02-08 2022-02-08 Ranking model training method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210119045.5A CN114444724A (en) 2022-02-08 2022-02-08 Ranking model training method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114444724A true CN114444724A (en) 2022-05-06

Family

ID=81371126

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210119045.5A Pending CN114444724A (en) 2022-02-08 2022-02-08 Ranking model training method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114444724A (en)

Similar Documents

Publication Publication Date Title
CN110471858B (en) Application program testing method, device and storage medium
CN109784351B (en) Behavior data classification method and device and classification model training method and device
CN111506758A (en) Method and device for determining article name, computer equipment and storage medium
CN111897996A (en) Topic label recommendation method, device, equipment and storage medium
CN111078521A (en) Abnormal event analysis method, device, equipment, system and storage medium
CN110929159B (en) Resource release method, device, equipment and medium
CN112000264B (en) Dish information display method and device, computer equipment and storage medium
CN111782950A (en) Sample data set acquisition method, device, equipment and storage medium
CN111563201A (en) Content pushing method, device, server and storage medium
CN113343709B (en) Method for training intention recognition model, method, device and equipment for intention recognition
CN112230822B (en) Comment information display method and device, terminal and storage medium
CN111159551B (en) User-generated content display method and device and computer equipment
CN111858983A (en) Picture type determining method and device, electronic equipment and storage medium
CN112560903A (en) Method, device and equipment for determining image aesthetic information and storage medium
CN111539794A (en) Voucher information acquisition method and device, electronic equipment and storage medium
CN114444724A (en) Ranking model training method, device, equipment and storage medium
CN112100528A (en) Method, device, equipment and medium for training search result scoring model
CN111258673A (en) Fast application display method and terminal equipment
CN112989198B (en) Push content determination method, device, equipment and computer-readable storage medium
CN112116480A (en) Virtual resource determination method and device, computer equipment and storage medium
CN112925903B (en) Text classification method, device, electronic equipment and medium
CN113408809B (en) Design scheme evaluation method and device for automobile and computer storage medium
CN111753154B (en) User data processing method, device, server and computer readable storage medium
CN114492756A (en) Sample screening method, device, apparatus, storage medium, and program product
CN113947648A (en) Electronic poster generation method, device, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination