Sample processing based on tag mapping
By mapping labels in the first label space to the second label space, the problem of inaccurate prediction caused by the long tail effect in sample processing in the existing technology is solved, and more efficient sample prediction is achieved.
Patent Information
- Application Number
- CN202380046294.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-06-21
- Filing Date
- 2023-06-14
- Publication Date
- 2025-01-24
AI Technical Summary
The prior art is difficult to effectively predict labels when processing samples, especially in the case of long-tail effects, resulting in inaccurate prediction results.
By mapping labels in the first label space into a second label space with smaller dimensions, a prediction model is generated based on multiple classification models to mitigate the impact of the long tail effect.
It is possible to improve the prediction accuracy of sample processing while mitigating the long tail effect, and the generated prediction model can more accurately describe the association between samples and labels.
Smart Images

Figure CN119365873A_ABST
Abstract
Description
CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] This application claims priority to U.S. patent application No. 17 / 845,956, filed on June 21, 2022, entitled “Sample Processing Based on Label Mapping,” the entire contents of which are incorporated herein by reference. Technical Field
[0002] The present disclosure relates generally to sample processing, and more particularly, to methods, apparatus, and computer program products for sample processing based on mapping labels of samples from a first label space to a second label space. Background Art
[0003] At present, machine learning technology has been widely used in sample processing. For example, in a recommendation environment, objects such as videos, articles, etc. can be provided to users. One user can watch a video for two minutes, and another user can watch a video for five minutes. Tags related to samples (including videos and user data) can be determined, and the tags can indicate how long the user watched the video. Solutions for predicting the trend of tags have been proposed. However, due to the distribution of time lengths over a large range and the possibility of involving a long tail effect, these solutions cannot output accurate prediction results. At this point, how to effectively process samples and predict the accurate tags of samples has become a hot topic. Summary of the invention
[0004] In a first aspect of the present disclosure, a method for sample processing is provided. In the method, based on a first label of a training sample in a plurality of training samples and a plurality of first labels of a plurality of training samples, a first label is mapped to a second label, the first label and the plurality of first labels are represented in a first label space, and the second label is represented in a second label space, the second label space being smaller than the first label space. Based on the second label and the training sample, a plurality of classification models are obtained, wherein a classification model in the plurality of classification models describes an association relationship between a sample and a classification of a label for the sample represented in the second label space. A prediction model is generated based on the plurality of classification models, wherein the prediction model describes an association relationship between a sample and a label for the sample represented in the first label space.
[0005] In a second aspect of the present disclosure, an electronic device is provided, comprising: a computer processor coupled to a computer readable storage unit, the storage unit comprising instructions, which implement the method according to the first aspect of the present disclosure when executed by the computer processor.
[0006] In a third aspect of the present disclosure, a computer program product is provided, which includes a computer-readable storage medium having program instructions implemented therewith, and the program instructions can be executed by an electronic device to enable the electronic device to perform the method according to the first aspect of the present disclosure.
[0007] The present invention summary is provided to introduce alternative concepts in a simplified form, which are further described in the detailed description below. The present invention summary is not intended to identify the key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed technical solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of some implementations of the present disclosure in the accompanying drawings, in which like reference numerals generally refer to like parts throughout the implementations of the present disclosure.
[0009] Figure 1 An example environment for sample processing according to machine learning techniques is shown;
[0010] Figure 2 An example diagram showing label distribution of samples according to an implementation of the present disclosure;
[0011] Figure 3 An example diagram showing a prediction model including multiple classification models generated based on label mapping according to an implementation of the present disclosure;
[0012] Figure 4 An example diagram showing label distribution in a second label space of a sample according to an implementation of the present disclosure;
[0013] Figure 5 An example diagram showing new training data including samples and second labels of the samples according to an implementation of the present disclosure is shown;
[0014] Figure 6 An example diagram showing a prediction model according to an implementation of the present disclosure;
[0015] Figure 7 An example diagram showing a base model included in a prediction model according to an implementation of the present disclosure;
[0016] Figure 8 An example diagram illustrating the performance of a prediction model according to an implementation of the present disclosure;
[0017] Fig. 9 An example flow chart of a sample processing method based on label mapping according to an implementation of the present disclosure is shown;
[0018] Fig.10 A block diagram of a computing device is shown in which various implementations of the present disclosure may be implemented. DETAILED DESCRIPTION
[0019] The principle of the present disclosure will now be described in conjunction with some implementations. It should be understood that describing these implementations is only for illustrative purposes, and helps those skilled in the art to understand and implement the present disclosure, rather than constituting any limitation to the scope of the present disclosure. The disclosure described herein can be implemented in various ways except for the way described below.
[0020] In the following description and claims, unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs.
[0021] References in this disclosure to "one implementation," "an implementation," "an example implementation," etc. indicate that the implementation being described may include a particular feature, structure, or characteristic, but not every implementation necessarily includes the particular feature, structure, or characteristic. Furthermore, such phrases do not necessarily refer to the same implementation. Additionally, when a particular feature, structure, or characteristic is described in conjunction with an example implementation, it is considered to be within the knowledge of those skilled in the art to affect such feature, structure, or characteristic in relation to other implementations, whether or not explicitly described.
[0022] It should be understood that although the terms "first" and "second" etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. For example, a first element may be referred to as a second element, and similarly, a second element may be referred to as a first element without departing from the scope of example implementations. As used herein, the term "and / or" includes any and all combinations of one or more of the listed terms.
[0023] The terms used herein are for the purpose of describing particular implementations only and are not intended to limit example implementations. As used herein, the singular forms "a", "an", and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "including", "having", when used herein, specify the presence of stated features, elements, and / or components, etc., but do not exclude the presence or addition of one or more other features, elements, components, and / or combinations thereof.
[0024] The principle of the present disclosure will now be described in conjunction with some implementations. It should be understood that describing these implementations is only for illustrative purposes, and helps those skilled in the art to understand and implement the present disclosure, and is not intended to constitute any limitation to the scope of the present disclosure. The disclosure described herein can be implemented in a variety of ways except for the manner described below. In the following description and claims, unless otherwise defined, all technical and scientific terms used herein have the same meanings as those of ordinary skill in the art to which the present disclosure belongs.
[0025] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant rules.
[0026] It is understandable that before using the technical solutions disclosed in various implementations of this disclosure, users should be informed of the type, scope of use and usage scenarios of the personal information involved in this disclosure in an appropriate manner. In accordance with the provisions of relevant laws and regulations, the user's authorization should be obtained.
[0027] For example, in response to receiving an active request from a user, a prompt message is sent to the user, clearly informing the user that the requested operation requires obtaining and using the user's personal information. Therefore, the user can independently choose whether to provide personal information to the electronic device, application, server or storage medium or other software or hardware that executes the operation of the technical solution of the present disclosure according to the prompt message.
[0028] As an optional but non-limiting implementation, in response to receiving an active request from the user, the method of sending the prompt information to the user may include, for example, a pop-up window, and the prompt information may be presented in the form of text in the pop-up window. In addition, the pop-up window may also have a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0029] It is understandable that the above process of notifying and obtaining user authorization is only exemplary and does not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations are also applicable to the implementation of the present disclosure.
[0030] For the purpose of description, the following paragraphs will provide more details by taking a recommendation system as an example environment. In a recommendation system, various objects (such as videos, articles, messages, etc.) can be sent to users. Sometimes, the user is interested in the object and then views it for a long time. If the user is not interested in the object, he / she may view the object for a short time, or even skip the object and do nothing. Currently, solutions for generating a prediction model for predicting the length of time, which is the length of time the user views the object, have been provided. In the following, reference will be made to Figure 1 More details on the prediction model are available here Figure 1 An example environment 100 for sample processing according to machine learning techniques is shown.
[0031] exist Figure 1 In the example, a prediction model 130 may be provided for predicting the length of time. Here, the environment 100 includes a training system 150 and an application system 152 . Figure 1 The upper part of shows the training phase, and the lower part shows the application phase. Before the training phase, the prediction model 130 may be configured with untrained or partially trained parameters (such as initial parameters, or pre-trained parameters). In the training phase, based on a training data set 110 including a plurality of training data 112, the prediction model 130 may be trained in a training system 150. Here, each training data 112 may have a two-tuple format and may include a sample 120 (e.g., data associated with an object and a user) and a label 122 of the sample 120. Specifically, a large amount of training data 112 may be used to iteratively implement the training phase. After the training phase, the parameters of the prediction model 130 may be updated and optimized, and a prediction model 130' with trained parameters may be obtained. At this point, in the application phase, the prediction model 130 may be used to implement the prediction task. For example, the sample 140 to be processed may be input into the application system 152, and then the corresponding prediction label 144 may be output.
[0032] exist Figure 1 In the training system 150 and the application system 152, the training system 150 and the application system 152 may include any computing system with computing capabilities, such as various computing devices / systems, terminal devices, servers, etc. The terminal device may involve any type of mobile device, fixed terminal or portable device, including a mobile phone, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a media computer, a multimedia tablet computer, or any combination of the foregoing, including accessories and peripherals of these devices or any combination thereof. The server may include, but is not limited to, a mainframe, an edge computing node, a computing device in a cloud environment, etc. It should be understood that Figure 1 The components and devices in the environment 100 are only examples, and a computing system suitable for implementing the example implementations described in the present disclosure may include one or more different components and other components. For example, the training system 150 and the application system 152 may be integrated in the same system or device.
[0033] like Figure 1As shown, the training data set 110 may include historical training data 112, which is collected from the data log of the recommendation system according to the requirements of the corresponding laws and regulations and related rules. For example, the object may be a video provided to the user, and then the sample 120 may include embeddings related to the object and the user, and the label 122 may indicate the length of time the user watched the video. However, the length of time may vary in a wide range, and then a long tail effect may occur.
[0034] Reference Figure 2 To explain the long tail effect, here Figure 2 An example diagram 200 of label distribution of a sample according to an implementation of the present disclosure is shown. Figure 2 As shown, curve 210 indicates the label distribution of samples. The horizontal axis indicates the original label space of the label, for example, the label may indicate how many minutes the user watched the video. It should be understood that the label only indicates the duration and does not involve identifying the content in the video. In another environment where the user reads an article or a news report, the label may indicate the length of time the user spent in the article or report, but does not involve the content of the article or report. The vertical axis indicates the number of labels. Assuming that the training data set 110 includes 20,000 training data, there may be 20,000 labels for 20,000 samples. Figure 2 In , curve 210 indicates that most users watch videos for about 0-10 minutes. As the length of time increases, the number of users decreases, and very few users watch videos for more than 60 minutes. Figure 2 Although there are some tags in the long tail window 220 (eg, between 60 and 200 minutes), the number of tags is very low compared to the total number of tags.
[0035] The above scenario involves the long tail effect. Here, the long tail effect is a statistical pattern of a distribution that occurs when a large portion of events occur far away from the center or head of the distribution. This means that the long tail distribution includes many values far away from the mean. The long tail effect increases the difficulty of prediction due to the uneven distribution of labels.
[0036] Nowadays, regression models have been developed for prediction models related to the long tail effect. Typically, the mean square error obtained from the training data is used as the loss for training the prediction model. However, the mean square error causes the trained prediction model to output a predicted label that is close to the average of the labels in the training data, but the trained prediction model cannot effectively consider the contribution of the labels in the long tail window 220. Thus, the trained prediction model 130 cannot provide accurate prediction results.
[0037] In view of this, the present disclosure proposes a sample processing solution based on label mapping. As user interests change, labels present a long-tail effect when they are expressed in minutes. In view of the above, it is proposed that labels in the time space can be mapped into a new label space, which has a smaller size than the original label space. Next, a prediction model can be established based on the samples and the new labels in the new label space, so that the long-tail effect in the original label space can be mitigated when establishing the prediction model.
[0038] In the following, reference Figure 3 Describes more details about sample processing. Figure 3 An example diagram 300 of a prediction model including multiple classification models generated based on label mapping according to an implementation of the present disclosure is shown. Figure 3 As shown, the prediction model 320 can be trained by the training data 310, and the training data 310 can include a sample 312 and a first label 314. Here, the sample 312 can include an embedding related to various factors that may affect the first label 314, and the first label 314 can be represented in a first label space (i.e., an original label space). Continuing the example of the recommendation system above, the sample 312 can include an embedding related to a user and a video, and the first label 314 can indicate a time length.
[0039] In order to mitigate the long tail effect in the first label space, the first label 314 may be mapped to the second label 316. Here, the second label 316 may be represented in a smaller label space, and thus the long tail effect in the first label space may be mitigated. In some implementations of the present disclosure, the second label space may be defined by a plurality of buckets. At this point, the second label may refer to a bucket in the plurality of buckets, and thus the first label 314 may be mapped from a continuous space to an ordinal space.
[0040] exist Figure 3 In the example, a plurality of classification models 322, ..., and 324 can be obtained based on the sample 312 and the second label 316. Here, the classification models in the plurality of classification models 322, ..., and 324 can describe the association relationship between the sample and the classification of the label for the sample represented in the second label space. In the context of the present disclosure, the classification may involve the possibility of whether the label matches the classification criteria in the second label space. For example, the classification model 322 may involve a classification criterion indicating whether the label is greater than or equal to a predetermined classification value in the second label space. Similarly, the classification model 324 may involve another classification value in the second label space.
[0041] In addition, based on multiple classification models 322, ... and 324, a prediction model 320 can be generated. Classification models 322, ..., and 324 solve the problem of classifying labels into corresponding categories, which is a simple problem compared to the prediction model 320 for predicting the length of time (which is affected by the long tail effect). Therefore, the classification models 322, ... and 324 can adopt a simple network structure and can be better trained using samples 312 and second labels 316. Then, by mapping the first label 314 to the second label 316, the prediction model 320 can be generated in a more efficient and easy way.
[0042] In implementations of the present disclosure, various methods may be used to map the first label 314 to the second label 316. Specifically, a mapping function may be determined for mapping a label (in the first label space) to a label (in the second label space). Here, the first label space represents a continuous space and the second label space represents an ordinal space. The mapping function may depend on various aspects. For example, in order to reflect the relationship between the first label and other first labels (in the first label space) of other samples in the training data set 110, a normalization function may be determined for label mapping.
[0043] In an implementation of the present disclosure, a reference basis (such as a 1 / 4 quantile, a 1 / 2 quantile, a 3 / 4 quantile, or an average) may be determined from all first labels of samples in the training data set 110. Assuming that the training data set includes 20,000 training data, and the 1 / 2 quantile is selected as the reference basis, the label of the 10,000th training sample in the training data set 110 may be used as the reference basis in the normalization function. At this time, for the i-th first label in the first label space, the i-th first label may be converted into a normalized value based on Formula 1.
[0044] In formula 1, Indicates label i The normalized value of norm() represents the normalization function, label i represents the i-th first label (in the first label space) of the i-th sample in the training data set 110, label ref represents the reference basis of the normalization function. Here, is an intermediate value represented in a third label space, which is different from the first label space and the second label space.
[0045] In the implementation of the present disclosure, label can be determined based on the quantiles of multiple first labels. refAlternatively and / or additionally, label may be determined based on an average of multiple first labels. ref In addition, label can be determined based on the sum of multiple first labels or the maximum label among multiple first labels. ref At this time, depending on how the reference basis is selected, the third label space may have a different range. For example, if the maximum label is used as the reference basis, the third label space may have a range of [0,1]. In another example, if the first label space has a range of [0,200] and the average value (e.g., label ref =5) is used as a reference basis, the third label space can have a range of [0,40].
[0046] Using these implementations of the present disclosure, a first label space (having a relatively large size) can be mapped into a second label space having a smaller size. Therefore, the long tail effect can be mitigated to a certain extent. In addition, if multiple first labels are scattered in the first label space, the compression function can be used to compress the first label space into the compressed space. For example, a square root (or cube root, etc.) can be determined from the first label, and then the square root can be normalized. At this time, the normalized value can be determined based on the following formula 2:
[0047] In Formula 2, comp() represents a compression function, and other symbols may have the same meanings as those in Formula 1. With these implementations of the present disclosure, the first label space may be further compressed, and thus the long tail effect may be further reduced.
[0048] It should be understood that the normalized value is obtained based on a division operation, and therefore the normalized value is represented as a real number. Since further classification processing does not require high-precision real numbers, and real numbers may cost more computing resources, the real numbers can be further converted into integers based on a bucket function. Then, a bucket function can be determined, which is used to convert the normalized value into a label in the second label space.
[0049] In an implementation of the present disclosure, a bucket function may be determined based on a comparison between a normalized value and a third label space. In order to determine the bucket function, the number of buckets may be determined first, for example, the number of buckets may be determined based on a predetermined level of precision. For example, a high level of precision may define that the third label space should be divided into 100 buckets, a medium level of precision may define that the third label space should be divided into 80 buckets, and a low level of precision may define that the third label space should be divided into 50 buckets. At this point, based on the determined number of buckets, the third label space may be divided into a plurality of buckets, and then a bucket function may be determined based on a comparison between the normalized value and the plurality of buckets. Assuming that the third label space has a range of [min, max] and is divided into N buckets, the bucket function may be defined as follows:
[0050] In Formula 3, label represents a label in the third label space, min represents the lower boundary of the third label space, max represents the upper boundary of the third label space, size represents the size of the bucket, and N represents the total number of buckets. Other symbols may have the same meanings as those in the above formula. Assuming that a high precision level is selected, the second label space may include 100 buckets, and then the second label space may be represented as {1,2,3…,100} (100 integers in [1,100]).
[0051] There are two main reasons for introducing bucket functions. First, the quality of labels is uneven and there is noise in the labels. Bucket functions can reduce the noise in the labels by classifying the labels in corresponding buckets. Second, the classification model needs to learn how to distinguish between high labels and low labels. In other words, labels with large gaps can be distinguished. However, for labels with very close values, the classification model does not need to distinguish them in an accurate way. Therefore, bucket functions can help reduce noise and also achieve the purpose of classification with lower computing resources.
[0052] Using Formula 3, the normalized value can be mapped from the third label space to the second label space. Here, the label mapping can be implemented by first implementing the normalization function and then implementing the bucket function. In other words, based on the above normalization function (shown in Formula 1 or Formula 2) and the bucket function (shown in Formula 3), the mapping function can be expressed as follows: mapping(label i )=bucket(norm(label i )) Formula 4
[0053] In Formula 4, mapping() represents a mapping function, bucket() represents a bucket function (which can be determined based on Formula 3), and norm() represents a normalization function (which can be determined based on Formula 1 or Formula 2). At this time, according to Formula 4, the first label 314 can be mapped to the second label 316.
[0054] In the implementation of the present disclosure, based on Formula 4, each first label in the training data set 110 can be processed, and then all first labels in the training data set 110 can be mapped to corresponding second labels in the second label space. Figure 4 Describes details about the second label space. Figure 4 An example diagram 400 of label distribution in a second label space for a sample according to an implementation of the present disclosure is shown. Figure 4 As shown, all first labels with continuous real numbers in the range [0, 200] are mapped to corresponding ordinal integers in the range {1, 2, ..., 100}. Here, the buckets can include different numbers of labels. For example, in the second label space, bucket 410 includes about 9000 labels, bucket 420 includes about 4000 labels, bucket 430 includes about 2000 labels, and subsequent buckets 440 and 450 include fewer labels, respectively.
[0055] With these implementations of the present disclosure, the size of the second label space is significantly smaller than the size of the first label space. In addition, during the label mapping process, the label noise in the first label space is removed, and thus the sample 312 and the second label 316 can train the prediction model 320 in a more accurate manner. At this point, a new training date for further training can be established based on the sample 312 and the second label 316 to improve the accuracy level of the prediction model 320.
[0056] Figure 5 An example diagram 500 of new training data including samples and second labels of the samples according to an implementation of the present disclosure is shown. Figure 5 As shown, samples 312 are retrieved from the original training data, and in the context of the recommendation system, the samples 312 may include embeddings of various aspects that may affect the first label 314. For example, the samples 312 may include: user feature embeddings 510 for describing various aspects of users who watch the provided video; and video feature embeddings 520 for describing various aspects of the video. For example, video features may include the length of the video, the encoding format of the video, and the resolution of the video, etc. It should be understood that all embeddings are represented in vector form, and the original sensitive information related to the user and the video is not visible. In addition, the new training data includes a second label 316 mapped from the first label 314 by a mapping function.
[0057] It should be understood that Figure 5 Only an example of new training data is provided, which is generated from training data 310. In an implementation of the present disclosure, similar processing may be performed on all 20,000 training data in training data set 110, and thus 20,000 new training data may be obtained for generating classification models 322, ..., and 324.
[0058] Having described the details about label mapping and generating new training data, the following paragraphs will provide more information about obtaining multiple classification models 322, ..., 324, and generating a prediction model 320 based on the multiple classification models. In an implementation of the present disclosure, the prediction model 320 can be generated based on regression prediction theory. Specifically, based on regression prediction theory, the following formula 5 can be used to predict the label of the training sample (represented by embedding x):
[0059] In Formula 5, x represents the embedding of the input training sample, predication() represents the probability of the label of the training sample, and it can be expressed as the sum of i*P(i|x) (where i=1, 2, 3, ..., N, N represents the number of buckets in the second label bucket). P(i|x) represents the probability of the predicted label when x is equal to i. In addition, Formula 5 can be converted into Formula 6 based on mathematical transformation:
[0060] In Formula 6, P(≥i|x) represents the probability of the predicted label when the embedding x is greater than i, and other symbols may have the same meanings as those in the above formula. Here, P(≥i|x) can be implemented by a classification model, and therefore the technical problem of establishing a prediction model 320 based on regression prediction theory (as shown in Formula 5) is converted to establishing a prediction model 320 based on multiple classification models (as shown in Formula 6). Compared with the regression prediction model, the structure and training objectives of the classification model are easier to implement, which can directly reduce the complexity and cost of generating a prediction model based on regression prediction theory.
[0061] In the following, reference will be made to Figure 6 For more information about the classification models 322 , . . . , 324 and the prediction model 320 . Figure 6 An example diagram 600 of a prediction model 320 according to an implementation of the present disclosure is shown. Figure 6As shown, the prediction model 320 includes a base model 610 (which is established based on the sum of multiple classification models 322, ... and 324) and an inverse mapping function 620. Here, each model in the classification models 322, ... and 324 represents a corresponding probability P (≥ i|x) (where i = 1, 2, 3, ..., N), and can be obtained by Figure 5 The basic model 610 is trained with the new training data shown in , so that the basic model 610 can describe the association relationship between the sample and the corresponding second label.
[0062] In the prediction model 320, the number of classification models reflects the accuracy level of the prediction model 320, and a greater number can lead to a higher accuracy level. In general, the accuracy level of the prediction model 320 depends on the proportion of new training data covering the second label space. Return Figure 4 , most of the second labels are gathered in the front buckets (e.g., the first three buckets 410, 420, and 430), and only a small number of labels in the tail (such as the labels in buckets 440, 450 and other subsequent buckets) are far away from the center of the label distribution. Since the labels in the tail are significantly small after label mapping, the tail makes a relatively weak contribution to the prediction model 320. Since the labels in the tail greatly increase the complexity level and resource cost, only the front buckets can be considered when generating the classification model. Therefore, a balance can be found between complexity, cost, and accuracy level.
[0063] At this point, an appropriate number of front buckets can be determined first, for example, based on the distribution of multiple second tags in the second tag space. Since most of the second tags are located in the front buckets 410, 420, and 430, the number of these front buckets can then be used to determine how many classification models can be generated. In another example, the threshold ratio can be determined first, and then the number can be determined based on the threshold ratio. Assuming that the threshold ratio is set to 85% and the first three buckets 410, 420, and 430 cover more than 85% of the second tags, the number can be set to 3. In addition, 3 classification models can be generated. If the threshold ratio is set to a higher value, the number can be increased (e.g., to 4).
[0064] refer to Figure 7 More details of the base model 610 and multiple classification models are described. Figure 7 An example diagram 700 of a base model 610 included in a prediction model 320 according to an implementation of the present disclosure is shown. In an implementation of the present disclosure, once the number of buckets is determined, the number of classification models is determined. Here, a classification model can be generated for the bucket. Assuming that the number of classification models is determined to be M=3, 3 classification models can be generated for the first three buckets 410, 420, and 430 in the second label space. At this time, Formula 7 can be determined from Formula 6.
[0065] In Formula 7, prediction′(x) represents a simplified prediction formula, M (where M=3) represents the number of classification models, and other symbols have the same meanings as those in the previous formulas. Figure 7 , a classification model 322 may be generated to provide a probability 720 indicating whether the predicted label matches a classification criterion (e.g., greater than or equal to a classification value (i.e., 1)). A classification model 710 may be generated to provide a probability 722 associated with another classification criterion (e.g., greater than or equal to a classification value (i.e., 2)). Similarly, a classification model 324 may be generated to provide a probability 724 associated with a further classification criterion (e.g., greater than or equal to a classification value (i.e., 3)).
[0066] Here, the classification models 322, 710 and 324 can be composed of Figure 5 The new training data of the form shown is trained. In the implementation of the present disclosure, an initial classification model can be obtained. For example, a common classification network structure can be used as the initial classification model, and then the initial classification model can be trained by a plurality of new training data. For example, based on the new training data, it can be determined whether the second label matches the classification standard in the second label space.
[0067] When training the classification model 322, the second label 316 is compared with the classification criterion (e.g., greater than or equal to "1"). If the second label 316 is greater than or equal to "1", the true value probability label can be set to "1", otherwise the true value probability label can be set to "0". Then, all new training data can be used to iteratively train the classification model 322 in the direction of minimizing the loss function. It should be understood that this paragraph only provides examples of classification criteria, alternatively and / or additionally, the classification criteria can be selected from any one of the following: greater than the classification value, less than the classification value, less than or equal to the classification value, etc.
[0068] It should be understood that the classification criteria may vary for different classification models. For the classification model 710, the classification criteria may be set to: whether the second label 316 is greater than or equal to "2". Similarly, if the second label 316 is greater than or equal to "2", the true value probability label may be set to "1", otherwise the true value probability label may be set to "0". Based on a plurality of new training data, the classification model 710 may be trained to output a probability 722, where the probability 722 indicates whether the predicted label is greater than or equal to "2". In addition, for the classification model 324, the classification criteria may be set to: whether the second label 316 is greater than or equal to "3". Then, the classification model 324 may be trained to output a probability 724, where the probability 724 indicates whether the predicted label is greater than or equal to "3".
[0069] In an implementation of the present disclosure, classification models 322, 710, and 324 can be trained in an iterative manner through multiple new training data. Here, these classification models can be trained individually and / or in combination. Based on the above, the three items in the above formula 7 (i.e., P(≥i|x), i=1,2,3) can be determined by three classification models 322, 710, and 324, respectively. In addition, based on formula 7, the probabilities output by the three classification models can be added together at the summer 612 to provide an intermediate label 614 for the base model 610. Here, the intermediate label 614 indicates the predicted label (represented in the second label space) for the input sample. At this time, the base model 610 can describe the association relationship between the sample and the label in the second label space.
[0070] Since the middle tag 614 is in the second tag space, it is represented by a bucket and cannot indicate how long the user watched the video. The middle tag 614 should be mapped back to the first tag space so that it can indicate the true meaning of the tag (e.g., the length of time the user watched the video). Figure 6 The prediction module 320 further includes an inverse mapping function 620 for mapping the labels in the second label space to the labels in the first label space. Here, the intermediate labels 614 may be processed by the inverse mapping function 620 so that they may be converted back to the first label space.
[0071] In the implementation of the present disclosure, the inverse mapping function 620 is the inverse function of the mapping function. In other words, the inverse mapping function 620 maps the labels in the second label space back to the labels in the first label space. For the mapping function in Formula 5, the inverse mapping function 620 can be defined as follows: mapping -1 (label j )=norm -1 (bucket -1 (labelj )) Formula 8
[0072] In formula 8, mapping -1 () represents the inverse function of the mapping function, label j Indicates the label in the second label space, nrom -1 () and buckey -1 () represent the inverse functions of the normalization function and the bucket function, respectively. Since the inverse mapping function only involves the mathematical transformation of the mapping function, its details will be omitted below.
[0073] Further, the intermediate label 614 can be converted from the second label space to the first label space according to Formula 8. Using the implementation of the present disclosure, the long tail effect in the first label space is mitigated by label mapping. In addition, a prediction model 320 is established based on the classification model, which converts a complex regression prediction model into multiple simpler classification models. Therefore, the accuracy of the prediction model 320 is improved.
[0074] In the implementation of the present disclosure, the prediction model 320 can accept the input sample and output the predicted label for the input sample. Since the prediction model 320 is more accurate than the traditional regression prediction model, the predicted label can be more accurate and reliable. Specifically, the target sample can be input in the basic model 610 to output 3 probabilities, and then the probability can be increased to form an intermediate label. Since the intermediate label 614 is represented in the second label space, it should be converted into the first label space by the inverse mapping function 620. Since the inverse mapping function 620 is based on mathematical operations, the inverse mapping function will not introduce errors into the target label. Therefore, the target label can indicate a reliable value in the first label space.
[0075] Continuing with the example in the recommendation system above, the target sample may be processed by the prediction model 320, the target sample including the user feature embedding and the video feature embedding. Specifically, the target sample may be input into the classification model 322, the classification model 710, and the classification model 324, respectively. At this time, the classification model 322 may output a probability indicating whether the label predicted from the target sample is greater than or equal to 1, the classification model 710 may output a probability indicating whether the label predicted from the target sample is greater than or equal to 2, and the classification model 322 may output a probability indicating whether the label predicted from the target sample is greater than or equal to 3. Further, the intermediate label may be determined based on the sum of the probabilities of the three outputs.
[0076] Assuming that all three classification models 322, 710, and 324 output 1, the intermediate label can be determined as 1+1+1=3. Afterwards, based on the inverse mapping function 620, the intermediate label can be converted from the second label space back to the first label space. The intermediate label "3" can be input into the above formula 8, and then the intermediate label "3" can be converted into a target label in the first label space (e.g., target label = 12.5). The target label indicates that the user may watch the provided video for about 12.5 minutes. Similarly, another target sample can be input into the prediction model 320, assuming that the classification models 322, 710, and 324 output 1, 0, and 0, respectively, and the intermediate label can be determined as 1+0+0=1. At this point, the inverse mapping function 620 can output a target label in the first label space (e.g., target label = 4). Here, the target label indicates that the user will likely watch the video for 4 minutes.
[0077] Figure 8 An example diagram 800 is shown showing the performance of a prediction model according to an implementation of the present disclosure. Figure 8 As shown, the horizontal axis indicates the buckets of the true value, and the vertical axis indicates the predicted buckets. Line 810 indicates the performance of an ideal prediction model, which always outputs accurate predicted buckets equal to the true value. Curve 820 indicates the performance of a traditional prediction model based on regression theory. As shown, the shape of curve 820 remains roughly in the horizontal direction, and the predicted value does not increase with the true value. Therefore, the accuracy level of the traditional prediction model is not satisfactory.
[0078] exist Figure 8 In FIG. 8 , curve 830 indicates the performance of prediction model 320, which is established based on label mapping and multiple classification models. Since label mapping reduces potential errors caused by the long tail effect in the first label space, and the classification model implements a complex regression model, prediction model 320 exhibits better performance than a traditional regression model. As shown in curve 830, the predicted label increases with the true value label, and although curve 830 does not completely match the ideal curve 810, the change trend of curve 830 is inconsistent with the change trend of curve 810. Therefore, when processing samples involving the long tail effect, prediction model 320 is more accurate and reliable than the conversion prediction model.
[0079] Although the above paragraphs describe an implementation of the present disclosure in a recommendation system, in which samples represent embeddings related to users and videos, and labels represent the length of time that users watch videos, the proposed solution can be implemented in other environments. For example, in a computing system, samples can represent embeddings related to parameters, which are related to errors in the computing system (such as the type of error, the cause of the error, etc.), and labels can represent the length of time used for troubleshooting. At this time, a prediction model can be generated by mapping labels in a continuous time space into a bucket space. Alternatively and / or additionally, in a market management system, samples can represent embeddings related to factors that may affect the price of a product, and labels can represent the price of a product. In this case, a prediction model can be generated by mapping labels in a continuous space into a bucket space. Therefore, the long tail effect in the original label space (e.g., the length of time used for troubleshooting, and the price of the product) can be reduced, and the accuracy level of the prediction model can be improved.
[0080] The above paragraphs describe the details for sample processing. According to the implementation of the present disclosure, a method for sample processing is provided. For more details about the method, please refer to Fig. 9 ,here, Fig. 9 An example flow chart of a method 900 for sample processing based on multiple time windows according to an implementation of the present disclosure is shown. At box 910, based on the first label of a training sample in a plurality of training samples and the plurality of first labels of the plurality of training samples, the first label is mapped to a second label, the first label and the plurality of first labels are represented in a first label space, and the second label is represented in a second label space, the second label space being smaller than the first label space. At box 920, based on the second label and the training samples, a plurality of classification models are obtained, the classification models in the plurality of classification models describing the association relationship between the sample and the classification of the label for the sample represented in the second label space. At box 930, a prediction model is generated based on the plurality of classification models, the prediction model describing the association relationship between the sample and the label for the sample represented in the first label space.
[0081] In an implementation of the present disclosure, mapping a first label to a second label includes: determining a mapping function for mapping a label in a first label space to a label in a second label space, the first label space represents a continuous space, and the second label space represents an ordinal space; and determining the second label based on the first label and the mapping function.
[0082] In an implementation of the present disclosure, determining a mapping function includes: determining a normalization function based on a label in a first label space and a plurality of first labels, the normalization function being used to convert the label in the first label space into a normalized value in a third label space; and determining a bucket function based on a comparison between the normalized value and the third label space, the bucket function being used to convert the normalized value into a label in a second label space.
[0083] In an implementation of the present disclosure, determining a bucket function includes: determining the number of buckets based on a predetermined level of accuracy; dividing the third label space into multiple buckets based on the determined number of buckets; and obtaining the bucket function based on a comparison between a normalized value and multiple buckets.
[0084] In an implementation of the present disclosure, obtaining multiple classification models includes: determining the number of multiple classification models based on the distribution of multiple second labels of multiple training samples in a second label space, and the multiple second labels are represented in the second label space; and obtaining multiple classification models based on the determined number.
[0085] In an implementation of the present disclosure, obtaining multiple classification models includes: for a classification model among the multiple classification models, obtaining a classification model by training an initial classification model, wherein the initial classification model is trained using: classification of training samples and whether the second label matches the classification criteria in the second label space.
[0086] In an implementation of the present disclosure, determining a prediction model includes: generating a base model based on multiple classification models; determining an inverse mapping function, which is used to map labels in a second label space to labels in a first label space; and determining a prediction model based on the base model and the inverse mapping function.
[0087] In an implementation of the present disclosure, generating a base model includes generating a prediction model based on a sum of multiple classification models.
[0088] In an implementation of the present disclosure, the method 900 further includes: in response to receiving the target sample, determining a target label for the target sample in the first label space based on the target sample and the prediction model.
[0089] In an implementation of the present disclosure, determining a target label based on a target sample and a prediction model includes: determining an intermediate label in a second label space based on the target sample and a base model in the prediction model; and determining a target label based on the intermediate label and an inverse mapping function.
[0090] According to the implementation of the present disclosure, a device for sample processing is provided. The device includes: a mapping unit, configured to map a first label to a second label based on a first label of a training sample in a plurality of training samples and a plurality of first labels of a plurality of training samples, wherein the first label and the plurality of first labels are represented in a first label space, and the second label is represented in a second label space, and the second label space is smaller than the first label space; an acquisition unit, configured to obtain a plurality of classification models based on the second label and the training samples, wherein the classification models in the plurality of classification models describe the association relationship between the sample and the classification of the label for the sample represented in the second label space; and a generation unit, configured to generate a prediction model based on the plurality of classification models, wherein the prediction model describes the association relationship between the sample and the label for the sample represented in the first label space. Further, the device may also include other units for implementing other steps in the above method.
[0091] According to the implementation of the present disclosure, an electronic device for implementing the above method is provided. The electronic device includes: a computer processor, the computer processor is coupled to a computer-readable memory unit, the memory unit includes instructions, and the instructions implement a method for sample processing when executed by the computer processor. The method includes: based on the first label of a training sample in a plurality of training samples and a plurality of first labels of a plurality of training samples, mapping the first label to the second label, the first label and the plurality of first labels are represented in a first label space, and the second label is represented in a second label space, and the second label space is smaller than the first label space; based on the second label and the training sample, obtaining a plurality of classification models, the classification model in the plurality of classification models describing the association relationship between the sample and the classification of the label for the sample represented in the second label space; and generating a prediction model based on the plurality of classification models, the prediction model describing the association relationship between the sample and the label for the sample represented in the first label space.
[0092] In an implementation of the present disclosure, mapping a first label to a second label includes: determining a mapping function for mapping a label in a first label space to a label in a second label space, the first label space represents a continuous space, and the second label space represents an ordinal space; and determining the second label based on the first label and the mapping function.
[0093] In an implementation of the present disclosure, determining a mapping function includes: determining a normalization function based on a label in a first label space and a plurality of first labels, the normalization function being used to convert the label in the first label space into a normalized value in a third label space; and determining a bucket function based on a comparison between the normalized value and the third label space, the bucket function being used to convert the normalized value into a label in a second label space.
[0094] In an implementation of the present disclosure, determining a bucket function includes: determining the number of buckets based on a predetermined level of accuracy; dividing the third label space into multiple buckets based on the determined number of buckets; and obtaining the bucket function based on a comparison between a normalized value and multiple buckets.
[0095] In an implementation of the present disclosure, obtaining multiple classification models includes: determining the number of multiple classification models based on the distribution of multiple second labels of multiple training samples in a second label space, and the multiple second labels are represented in the second label space; and obtaining multiple classification models based on the determined number.
[0096] In an implementation of the present disclosure, obtaining multiple classification models includes: for a classification model among the multiple classification models, obtaining a classification model by training an initial classification model, wherein the initial classification model is trained using: classification of training samples and whether the second label matches the classification criteria in the second label space.
[0097] In an implementation of the present disclosure, determining a prediction model includes: generating a basic model based on the sum of multiple classification models; determining an inverse mapping function, which is used to map labels in a second label space to labels in a first label space; and determining a prediction model based on the basic model and the inverse mapping function.
[0098] In an implementation of the present disclosure, generating a base model includes generating a prediction model based on a sum of multiple classification models.
[0099] In an implementation of the present disclosure, the method further includes: in response to receiving the target sample, determining a target label for the target sample in the first label space based on the target sample and the prediction model.
[0100] In the implementation of the present disclosure, determining the target label based on the target sample and the prediction model includes: determining the intermediate label in the second label space based on the target sample and the base model in the prediction model; and determining the target label based on the intermediate label and the inverse mapping function.
[0101] According to an implementation of the present disclosure, a computer program product includes a computer-readable storage medium having program instructions implemented therewith, and the program instructions can be executed by an electronic device to enable the electronic device to perform method 800.
[0102] Fig.10 1 illustrates a block diagram of a computing device 1000 in which various implementations of the present disclosure may be implemented. It should be understood that Fig.10The computing device 1000 shown is for illustration purposes only and does not in any way imply any limitation on the functionality and scope of the present disclosure. The computing device 1000 may be used to implement the above method 800 in the implementation of the present disclosure. Fig.10 As shown, computing device 1000 may be a general computing device. Computing device 1000 may include at least one or more processors or processing units 1010, memory 1020, storage unit 1030, one or more communication units 1040, one or more input devices 1050, and one or more output devices 1060.
[0103] Processing unit 1010 may be a physical or virtual processor and may implement various processes based on a program stored in memory 1020. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to increase the parallel processing capability of computing device 1000. Processing unit 1010 may also be referred to as a central processing unit (CPU), a microprocessor, a controller, or a microcontroller.
[0104] The computing device 1000 typically includes various computer storage media. Such media can be any media accessible to the computing device 1000, including but not limited to volatile and non-volatile media, or removable and non-removable media. The memory 1020 can be a volatile memory (e.g., a register, a cache, a random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), or flash memory), or any combination thereof. The storage unit 1030 can be any removable or non-removable medium, and can include a machine-readable medium, such as a memory, a flash drive, a disk, or other media, which can be used to store information and / or data and can be accessed in the computing device 1000.
[0105] The computing device 1000 may also include additional removable / non-removable, volatile / non-volatile storage media. Fig.10 Not shown in the figure, but a disk drive for reading and / or writing from a removable and non-volatile disk and an optical drive for reading and / or writing from a removable non-volatile disk may be provided. In this case, each drive may be connected to a bus (not shown) via one or more data medium interfaces.
[0106] The communication unit 1040 communicates with another computing device via a communication medium. In addition, the functionality of the components in the computing device 1000 can be implemented by a single computing cluster or multiple computing machines that can communicate via a communication connection. Therefore, the computing device 1000 can operate in a networked environment using logical connections to one or more other servers, networked personal computers (PCs), or other general-purpose network nodes.
[0107] Input device 1050 may be one or more of a variety of input devices, such as a mouse, keyboard, trackball, voice input device, etc. Output device 1060 may be one or more of a variety of output devices, such as a display, speaker, printer, etc. With the aid of communication unit 1040, computing device 1000 may also communicate 1080 with one or more external devices (not shown), such as storage devices and display devices, one or more of which enable a user to interact 1070 with computing device 1000, if desired, or with any device that enables computing device 1000 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).
[0108] In some implementations, some or all of the components of the computing device 1000 may also be arranged in a cloud computing architecture rather than being integrated in a single device. In a cloud computing architecture, the components may be provided remotely and work together to implement the functions described in the present disclosure. In some implementations, cloud computing provides computing, software, data access, and storage services, which will not require the end user to know the physical location or configuration of the system or hardware that provides these services. In various implementations, cloud computing uses a suitable protocol to provide services via a wide area network (e.g., the Internet). For example, a cloud computing provider provides an application over a wide area network that can be accessed through a web browser or any other computing component. The software or components of the cloud computing architecture and the corresponding data may be stored on a server at a remote location. The computing resources in a cloud computing environment may be merged or distributed at the location of a remote data center. Cloud computing infrastructures may provide services through shared data centers, although they act as a single access point for users. Therefore, cloud computing architectures may be used to provide the components and functions described herein from a service provider at a remote location. Alternatively, they may be provided from a traditional server or installed directly or otherwise on a client device.
[0109] The functions described herein may be performed at least in part by one or more hardware logic components. For example, but not limited to, illustrative types of hardware logic components that may be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), etc.
[0110] The program code for executing the technical solution described herein can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, and when executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed in whole or in part on the machine, in part on the machine as an independent software package, in part on a remote machine, or in whole on a remote machine or server.
[0111] In the context of the present disclosure, a machine-readable medium may be any tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or apparatus. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include an electrical connection with one or more wires, a portable computer floppy disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable memory, a programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0112] In addition, although operations are shown in a particular order, this should not be understood as requiring such operations to be performed in the particular order shown or in a continuous order, or performing all of the operations shown to achieve the desired result. In some cases, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the discussion above, these should not be interpreted as limitations on the scope of the technical solutions described herein, but should be interpreted as descriptions of features that may be specific to a particular implementation. Certain features described in the context of a separate implementation may also be implemented in combination in a single implementation. On the contrary, the various features described in a single implementation may also be implemented individually in multiple implementations or in any suitable sub-combination.
[0113] Although the technical solution has been described in language specific to structural features and / or method behaviors, it should be understood that the technical solution specified in the appended claims is not necessarily limited to the above-mentioned specific features or behaviors. Instead, the above-mentioned specific features and actions are disclosed as example forms of implementing the claims.
[0114] From the foregoing, it should be understood that the specific implementation of the currently disclosed technology is described herein for illustrative purposes, but various modifications can be made without departing from the scope of the present disclosure. Therefore, the currently disclosed technology is not limited by the attached claims.
[0115] The implementation of the technical solutions and functional operations described in the present disclosure can be implemented in various systems, digital electronic circuits, or computer software, firmware or hardware, including the structures disclosed in this specification and their structural equivalents, or one or more of them can be implemented in a combined form. The implementation of the technical solutions described in this specification can be implemented as one or more computer program products, that is, one or more computer program instruction modules data processing devices encoded on a tangible and non-temporary computer-readable medium for execution or control operations. The computer-readable medium can be a machine-readable storage device, a machine-readable storage substrate, a storage device, a material composition that affects a machine-readable propagation signal, or a combination of one or more of them. The term "data processing unit" or "data processing device" covers all devices, equipment and machines for processing data, including, for example, a programmable processor, a computer or multiple processors or computers. In addition to hardware, the device may also include code to create an execution environment for the computer program in question, such as code constituting a processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of them.
[0116] A computer program (also referred to as a program, software, software application, script, or code) may be written in any form of programming language (including compiled or interpreted languages) and may be deployed in any form, including as a stand-alone form, a separate program, or as a module, component, subroutine, or other unit suitable for use in a computing environment. A computer program does not necessarily correspond to a file in a file system. A program may be stored in a portion of a file that holds other programs or data (e.g., one or more scripts stored in a markup language document), in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or portions of code). A computer program may be deployed to be executed on one computer or on multiple computers that are located at one site or distributed across multiple sites and interconnected by a communications network.
[0117] For example, processors suitable for executing computer programs include general and special purpose microprocessors, and any one or more processors of any type of digital computer. Typically, the processor will receive instructions and data from a read-only memory or a random access memory or both. The basic elements of a computer are a processor for executing instructions and one or more memory devices for storing instructions and data. Generally speaking, a computer will also include or be operably coupled to receive data from or transmit data to one or more large-capacity storage devices for storing data, or both, such as magnetic disks, magneto-optical disks, or optical disks. However, a computer does not need to have such a device. Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and storage devices, including, for example, semiconductor storage devices, such as EPROM, EEPROM, and flash memory devices. The processor and memory can be supplemented by or incorporated into a dedicated logic circuit.
[0118] This manual and the attached Figure 1 The foregoing are to be considered exemplary only, where exemplary means example. As used herein, the use of "or" is intended to include "and / or" unless the context clearly dictates otherwise.
[0119] Although the present disclosure contains many details, these should not be interpreted as limitations on the scope of any disclosure or the scope of what may be claimed, but rather as descriptions of features that may be specific to a particular implementation disclosed in particular. Certain features described in the present disclosure in the context of separate implementations may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented individually in multiple implementations or in any suitable sub-combination. In addition, although features may be described above as functioning in certain combinations and even initially claimed as such, one or more features from the claimed combination may be deleted from the claimed combination in some cases, and the claimed combination may be directed to a sub-combination or a variation of a sub-combination.
[0120] Similarly, although operations are shown in a particular order in the accompanying drawings, this should not be understood as requiring that the operations be performed in the particular order shown or in a sequential order, or that all of the operations shown be performed, to achieve the desired results. In addition, the separation of various system components in the implementations described in this disclosure should not be understood as requiring such separation in all implementations. Only some implementations and examples are described, and other implementations, enhancements, and variations may be made based on what is described and illustrated in this disclosure.
Claims
1. A method for sample processing, comprising: Based on a first label of a training sample in a plurality of training samples and a plurality of first labels of the plurality of training samples, mapping the first label to a second label, the first label and the plurality of first labels being represented in a first label space, and the second label being represented in a second label space, the second label space being smaller than the first label space; Based on the second label and the training sample, a plurality of classification models are obtained, wherein a classification model in the plurality of classification models describes an association relationship between a sample and a classification of a label for the sample represented in the second label space; as well as A prediction model is generated based on the multiple classification models, where the prediction model describes an association relationship between a sample and a label for the sample represented in the first label space.
2. The method of claim 1 , wherein mapping the first label to the second label comprises: determining a mapping function for mapping labels in the first label space to labels in the second label space, the first label space representing a continuous space and the second label space representing an ordinal space; as well as Based on the first label and the mapping function, the second label is determined.
3. The method of claim 2, wherein determining the mapping function comprises: Based on the label in the first label space and the plurality of first labels, determining a normalization function, wherein the normalization function is used to convert the label in the first label space into a normalized value in a third label space; as well as Based on the comparison between the normalized value and the third label space, a bucket function is determined, the bucket function being used to convert the normalized value into a label in the second label space.
4. The method of claim 3, wherein determining the bucket function comprises: determining the number of buckets based on a predetermined level of precision; Based on the determined number of buckets, dividing the third label space into a plurality of buckets; as well as The bucket function is obtained based on a comparison between the normalized value and the plurality of buckets.
5. The method according to claim 1, wherein obtaining the plurality of classification models comprises: Determining the number of the plurality of classification models based on the distribution of the plurality of second labels of the plurality of training samples in the second label space, the plurality of second labels being represented in the second label space; as well as Based on the determined number, the plurality of classification models are obtained.
6. The method according to claim 5, wherein obtaining the plurality of classification models comprises: For the classification model among the multiple classification models, the classification model is obtained by training an initial classification model, wherein the initial classification model is trained using: training samples and classification of whether the second label matches a classification criterion in the second label space.
7. The method of claim 1 , wherein determining the prediction model comprises: generating a base model based on the multiple classification models; Determine an inverse mapping function, where the inverse mapping function is used to map labels in the second label space to labels in the first label space; as well as Based on the basic model and the inverse mapping function, the prediction model is determined.
8. The method according to claim 7, wherein generating the base model comprises: The prediction model is generated based on the sum of the multiple classification models.
9. The method according to claim 7, further comprising: In response to receiving a target sample, a target label in the first label space for the target sample is determined based on the target sample and the prediction model.
10. The method according to claim 9, wherein determining the target label based on the target sample and the prediction model comprises: Determine an intermediate label in the second label space based on the target sample and the base model in the prediction model; as well as The target label is determined based on the intermediate label and the inverse mapping function.
11. An electronic device comprising a computer processor coupled to a computer readable memory unit, the memory unit comprising instructions which, when executed by the computer processor, implement a method for sample processing comprising: Based on a first label of a training sample in a plurality of training samples and a plurality of first labels of the plurality of training samples, mapping the first label to a second label, the first label and the plurality of first labels being represented in a first label space, and the second label being represented in a second label space, the second label space being smaller than the first label space; Based on the second label and the training sample, a plurality of classification models are obtained, wherein a classification model in the plurality of classification models describes an association relationship between a sample and a classification of a label for the sample represented in the second label space; as well as A prediction model is generated based on the multiple classification models, where the prediction model describes an association relationship between a sample and a label for the sample represented in the first label space.
12. The apparatus of claim 11, wherein mapping the first label to the second label comprises: determining a mapping function for mapping labels in the first label space to labels in the second label space, the first label space representing a continuous space and the second label space representing an ordinal space; as well as Based on the first label and the mapping function, the second label is determined.
13. The apparatus of claim 12, wherein determining the mapping function comprises: Based on the label in the first label space and the plurality of first labels, determining a normalization function, wherein the normalization function is used to convert the label in the first label space into a normalized value in a third label space; as well as Based on the comparison between the normalized value and the third label space, a bucket function is determined, the bucket function being used to convert the normalized value into a label in the second label space.
14. The apparatus of claim 13, wherein determining the bucket function comprises: determining the number of buckets based on a predetermined level of precision; Based on the determined number of buckets, dividing the third label space into a plurality of buckets; as well as The bucket function is obtained based on a comparison between the normalized value and the plurality of buckets.
15. The apparatus according to claim 11, wherein obtaining the plurality of classification models comprises: Determining the number of the plurality of classification models based on the distribution of the plurality of second labels of the plurality of training samples in the second label space, the plurality of second labels being represented in the second label space; as well as Based on the determined number, the plurality of classification models are obtained.
16. The apparatus according to claim 15, wherein obtaining the plurality of classification models comprises: For the classification model among the multiple classification models, the classification model is obtained by training an initial classification model, wherein the initial classification model is trained using: training samples and classification of whether the second label matches a classification criterion in the second label space.
17. The apparatus of claim 11, wherein determining the prediction model comprises: generating a base model based on the sum of the multiple classification models; Determine an inverse mapping function, where the inverse mapping function is used to map labels in the second label space to labels in the first label space; as well as Based on the basic model and the inverse mapping function, the prediction model is determined.
18. The apparatus of claim 17, the method further comprising: In response to receiving a target sample, a target label in the first label space for the target sample is determined based on the target sample and the prediction model.
19. The apparatus according to claim 18, wherein determining the target label based on the target sample and the prediction model comprises: Determine an intermediate label in the second label space based on the target sample and the base model in the prediction model; as well as The target label is determined based on the intermediate label and the inverse mapping function.
20. A computer program product, the computer program product comprising a computer-readable storage medium having program instructions embodied therewith, the program instructions being executable by an electronic device to cause the electronic device to perform a method for sample processing, the method comprising: Based on a first label of a training sample in a plurality of training samples and a plurality of first labels of the plurality of training samples, mapping the first label to a second label, the first label and the plurality of first labels being represented in a first label space, and the second label being represented in a second label space, the second label space being smaller than the first label space; Based on the second label and the training sample, a plurality of classification models are obtained, wherein a classification model in the plurality of classification models describes an association relationship between a sample and a classification of a label for the sample represented in the second label space; as well as A prediction model is generated based on the multiple classification models, where the prediction model describes an association relationship between a sample and a label for the sample represented in the first label space.