Sample acquisition method and device, equipment and medium
By filtering and upsampling video samples with high playback completion as training samples, the problem of poor acquisition of training samples of video sorting models is solved, and the accuracy of video recommendations is improved.
Patent Information
- Application Number
- CN202510574463.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-08-08
AI Technical Summary
In the prior art, the training sample acquisition method of the video sorting model is poor, which affects the accuracy of the recommended video of the model.
By filtering video samples with high playback completion as the first positive sample and upsampling them, the target positive sample is obtained and used to train the video sorting model.
It improves the learning effect of the video sorting model on positive samples whose playback completion is in line with the needs, and improves the accuracy of video recommendations.
Smart Images

Figure CN120455781A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a sample acquisition method, apparatus, device, and medium. Background Art
[0002] Video playback platforms often use video ranking models to recommend videos to users. For example, they can rank multiple videos, determine the preferred videos to recommend to users based on the ranking results, and then display the recommended videos on the user interface for users to watch. The inventors have discovered that the reliability of the training samples for video ranking models directly affects the model's recommendation results. However, the methods used in related technologies to obtain model training samples are poor, which affects the accuracy of the model's ranking of videos. Therefore, there is an urgent need to improve the methods for obtaining model training samples. Summary of the Invention
[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a sample acquisition method, apparatus, device and medium.
[0004] An embodiment of the present disclosure provides a sample acquisition method, which includes: acquiring multiple video samples; wherein the click-through rate of the video samples is within a preset indicator range; based on the playback completion degree corresponding to each of the multiple video samples, screening out a first positive sample from the multiple video samples; wherein the playback completion degree of the first positive sample is higher than the playback completion degree of other video samples in the multiple video samples except the first positive sample; performing upsampling processing on the first positive sample to obtain a target positive sample; and obtaining a training sample of a video sorting model based on the multiple video samples and the target positive sample.
[0005] Optionally, the upsampling of the first positive sample to obtain a target positive sample includes: obtaining multiple specified time intervals; determining the target interval to which the first positive sample belongs from the multiple specified time intervals, and obtaining target time information corresponding to the video sample contained in the target interval; and upsampling the first positive sample based on the target time information to obtain a target positive sample.
[0006] Optionally, obtaining multiple specified duration intervals includes: determining multiple specified duration intervals based on the video duration of each of the multiple video samples; different specified duration intervals correspond to different interval ranges, and the shorter the video duration of the video sample, the smaller the interval range of the specified duration interval in which it is located.
[0007] Optionally, the upper limit value of the specified duration interval is higher than the target value; wherein the target value includes the mean playback duration or the median playback duration corresponding to the video samples in the specified duration interval.
[0008] Optionally, obtaining the target duration information corresponding to the video samples contained in the target interval includes: obtaining an average video duration corresponding to the target interval based on the video durations of each video sample contained in the target interval; obtaining an average playback duration corresponding to the target interval based on the playback durations of each video sample contained in the target interval; and using the average video duration and the average playback duration as target duration information.
[0009] Optionally, upsampling the first positive sample based on the target duration information to obtain a target positive sample includes: upsampling the first positive sample based on the ratio of the average playback duration to the average video duration to obtain a target positive sample.
[0010] Optionally, the upsampling processing is performed on the first positive sample based on the ratio of the average playback time to the average video time to obtain a target positive sample, including: determining an upsampling multiple based on the ratio of the average playback time to the average video time; and copying the first positive sample based on the upsampling multiple to obtain a target positive sample.
[0011] Optionally, the upsampling multiple is determined based on the ratio of the average playback time to the average video time, including: when the ratio of the average playback time to the average video time is a non-integer, rounding is performed based on the ratio, and determining the upsampling multiple based on the rounding result; when the ratio of the average playback time to the average video time is greater than a preset multiple threshold, determining the upsampling multiple based on the preset multiple threshold.
[0012] The embodiment of the present disclosure also provides a sample acquisition device, including: a video sample acquisition module, used to acquire multiple video samples; wherein the click-through rate of the video samples is within a preset index range; a positive sample screening module, used to screen out a first positive sample from the multiple video samples based on the playback completion degrees corresponding to each of the multiple video samples; wherein the playback completion degree of the first positive sample is higher than the playback completion degrees of other video samples in the multiple video samples except the first positive sample; an upsampling processing module, used to perform upsampling processing on the first positive sample to obtain a target positive sample; a training sample acquisition module, used to obtain a training sample of a video sorting model based on the multiple video samples and the target positive sample.
[0013] An embodiment of the present disclosure further provides an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; the processor for reading the executable instructions from the memory and executing the instructions to implement the sample acquisition method provided in the embodiment of the present disclosure.
[0014] An embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the sample acquisition method provided in the embodiment of the present disclosure.
[0015] The above-mentioned technical solution provided by the embodiment of the present disclosure takes into account the impact of playback completion on the accuracy of video recommendation, and takes into account that the number of positive samples is usually small and easily leads to an imbalance between positive and negative samples. Therefore, after obtaining multiple video samples with click-through rates in a preset index range, based on the playback completion corresponding to each of the multiple video samples, the first positive sample with a high playback completion is first screened out from the multiple video samples, and the first positive sample is further upsampled. This method can effectively increase the number of positive samples with playback completion that meets the requirements, and on this basis, it helps to obtain more reasonable and reliable training samples for the video sorting model, and helps to strengthen the video sorting model's learning of positive samples with playback completion that meets the requirements, thereby improving the accuracy of the video sorting results, and correspondingly improving the accuracy of video recommendations.
[0016] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0018] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0019] Figure 1 A flow chart of a sample acquisition method provided in an embodiment of the present disclosure;
[0020] Figure 2 A flow chart of a sample acquisition method provided in an embodiment of the present disclosure;
[0021] Figure 3 A schematic diagram of an application scenario provided by an embodiment of the present disclosure;
[0022] Figure 4 A schematic structural diagram of a sample acquisition device provided in an embodiment of the present disclosure;
[0023] Figure 5 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.
[0025] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0026] In the waterfall recommendation scenario on the homepage of a video playback platform, personalized recommendations are usually made to users from a massive video library, and the types of videos are usually diversified. However, the existing technology has a poor recommendation effect on short videos such as PUGC (Professional User Generated Content). The inventor has found through research that the main reason is that the existing video recommendation technology mainly focuses on video recommendations based on click-through rate. However, although the click-through rate of most existing PUGC and other types of short videos is low, the playback completion rate is high. The inventor considers that the playback completion rate can better reflect the user's attention to the video and can better reflect the true relevance of the recommendation. Therefore, the short video recommendation is optimized from the perspective of playback completion. Specifically, the training samples of the video sorting model can be obtained based on the playback completion rate as a consideration, and the existing method of obtaining model training samples can be improved so that the obtained model training samples are more reasonable and reliable, thereby improving the video recommendation accuracy of the trained model. The following is a detailed explanation.
[0027] Figure 1 This is a flow chart of a sample acquisition method provided by an embodiment of the present disclosure. The method can be executed by a sample acquisition device, wherein the device can be implemented using software and / or hardware and can generally be integrated into an electronic device. Figure 1 As shown, the method mainly includes the following steps S102 to S108:
[0028] Step S102: Acquire multiple video samples, wherein the click-through rates of the video samples are within a preset index range. The preset index range can be flexibly set according to needs and is not limited here, so that the required model training samples can be selected from the video samples with click-through rates within this range.
[0029] Exemplarily, multiple video samples may be video samples corresponding to a target video type, such as a short video type with a high playback completion rate but a low click-through rate. Exemplarily, the target video types include: professional user-generated content PUGC video types. In actual applications, videos belonging to the target video type can be identified based on click-through rate and playback completion. For example, the target video type is a video type with a click-through rate in a first indicator interval (that is, the aforementioned preset indicator interval) and a playback completion rate in a second indicator interval. Therefore, multiple video samples can be directly selected from videos belonging to the target video type. For PUGC videos, they are produced by users or teams with certain professional capabilities, such as knowledge bloggers and independent creators in specific fields. The content quality is high, and the phenomenon of high playback completion but low click-through rate is common. They are more suitable for the sample acquisition scenario provided by the embodiments of the present disclosure.
[0030] Exemplarily, the above-mentioned multiple video samples may be, for example, published PUGC videos, which at least have the characteristic of low click-through rate and can be obtained by screening through the above-mentioned preset indicator interval. In addition, most of them also have the characteristic of high playback completion. Therefore, on the basis of the click-through rate, the required video samples can be further identified through the indicator interval corresponding to the playback completion. The embodiment of the present disclosure does not limit the method of obtaining multiple video samples. Exemplarily, video samples collected in different time periods and / or video samples obtained by different sampling methods can be freely combined to obtain multiple video samples corresponding to the target video type. Exemplarily, all PUGC videos collected in the past half month can be aggregated to obtain multiple video samples.
[0031] Step S104 , based on the respective corresponding playback completions of the multiple video samples, a first positive sample is screened out from the multiple video samples; wherein the playback completion of the first positive sample is higher than the playback completions of the other video samples in the multiple video samples except the first positive sample.
[0032] Playback completion is an indicator that measures the degree to which users have completely watched a video. It can be used to effectively evaluate the attractiveness of video content and the effectiveness of its delivery. For example, for a certain video, the playback completion of the video can be determined based on the ratio of the actual viewing time of a single user to the total viewing time of the video, or it can be measured as a whole based on the viewing of the video by multiple users. For example, the playback completion of the video can be determined based on the total viewing time of multiple users / (total viewing time of the video * number of times it is played).
[0033] As previously mentioned, the playback completion degree of the first positive sample is higher than the playback completion degrees of other video samples in the plurality of video samples except the first positive sample. In other words, the playback completion degree of the selected first positive sample is higher than that of the video samples not selected as the first positive sample. In some implementation examples, video samples with a playback completion degree higher than a preset threshold can be used as first positive samples. In other implementation examples, the playback completion degrees of multiple video samples can be sorted in descending order, and the top N video samples or the top M percent of video samples can be used as first positive samples. The specific method of selecting the first positive sample based on the playback completion degree can be flexibly set and is not limited here.
[0034] Step S106, upsampling the first positive sample to obtain a target positive sample. The disclosed embodiment fully takes into account that the number of positive samples that can be obtained is usually much lower than the number of negative samples. For example, when recommending ten videos to a user, the user may only be interested in one of the videos, and the remaining unplayed videos are all negative samples. The above is only an example for easy understanding, which is intended to illustrate that the number gap between existing positive and negative samples is usually large, and the imbalance in the ratio of positive and negative samples will also affect the model training effect, such as affecting the model's processing ability for positive samples. Therefore, the disclosed embodiment will upsample the first positive sample screened by the playback completion degree. The upsampling process is also a quantity increase process. In other words, upsampling the first positive sample mainly includes increasing the number of the first positive samples. The disclosed embodiment does not limit the specific method of upsampling. For example, the first positive sample can be efficiently and conveniently upsampled by copying the first positive sample, and the copied sample of the first positive sample can be used as the target positive sample.
[0035] Step S108, based on multiple video samples and target positive samples, obtain training samples for the video sorting model. Samples other than the first positive sample in the multiple video samples can be used as negative samples, and the negative samples and the target positive samples are used as training samples for the video sorting model. Since the above-mentioned target positive sample is obtained by upsampling the first positive sample selected based on the playback completion, it not only effectively improves the problem of imbalance in the number of positive and negative samples, but also can better guide the video sorting model to learn positive samples based on the playback completion. The positive samples strengthen the model to score videos with a high playback completion as the goal. The scores of videos such as PUGC with high playback completion will be improved accordingly, thereby improving the ranking of such videos and increasing the probability of displaying and recommending such videos to users.
[0036] The above method provided by the embodiment of the present disclosure takes into account the impact of playback completion on the accuracy of video recommendation, and takes into account that the number of positive samples is usually small and easily leads to an imbalance between positive and negative samples. Therefore, after obtaining multiple video samples with click-through rates in a preset index range, based on the playback completion corresponding to each of the multiple video samples, the first positive sample with a high playback completion is first screened out from the multiple video samples, and the first positive sample is further upsampled. This method can effectively increase the number of positive samples with playback completion that meets the requirements, and on this basis, it helps to obtain more reasonable and reliable training samples for the video sorting model, and helps to strengthen the video sorting model's learning of positive samples with playback completion that meets the requirements, thereby improving the accuracy of the video sorting results, and correspondingly improving the accuracy of video recommendations.
[0037] In some implementation examples, the above step S106, i.e., the step of performing upsampling processing on the first positive sample to obtain the target positive sample, can be performed with reference to the following steps A to C:
[0038] Step A: Obtain multiple specified time intervals.
[0039] In some implementation examples, multiple preset duration intervals can be directly obtained. In other implementation examples, in order to set the duration intervals more reasonably, multiple specified duration intervals can be determined based on the video duration of each of the multiple video samples; the interval ranges corresponding to different specified duration intervals are different, and the shorter the video duration of the video sample, the smaller the interval range of the specified duration interval in which it is located. The disclosed embodiments fully take into account the different effects of the same viewing time or the same total duration difference on videos of different lengths, such as the effect of a user's viewing time of 10s on a video with a total duration of 30s and a video with a total duration of 5 minutes. For example, the duration difference between a video with a total duration of 1 minute and a video with a total duration of 2 minutes is 1 minute, and the duration difference is relatively large. However, although the duration difference between a video with a total duration of 15 minutes and a video with a total duration of 14 minutes is also 1 minute, the duration difference can be considered relatively small. In order to be able to objectively and effectively divide the duration intervals and reasonably classify different videos according to their duration for subsequent analysis and processing, the disclosed embodiment can set multiple specified duration intervals of different interval ranges. The shorter the total duration of the video, the smaller the corresponding interval range, such as dividing the duration interval in the manner of 1 to 15s, 15 to 60s, 1min to 2min, 2min to 5min, and 5min to 10min. The above values are only examples. In actual applications, different interval ranges can be flexibly set and are not limited here. Furthermore, considering that there may be videos with a shorter total duration that will be automatically replayed after being played, resulting in a phenomenon where the playback duration is longer than the video duration, in order to avoid such a situation, when setting the specified duration interval, the principle that the upper limit value of the specified duration interval is higher than the target value can be followed; wherein the target value includes the average playback duration or the median playback duration corresponding to the video samples in the specified duration interval. Through the above method, the aforementioned problems can be effectively avoided and the rationality of interval division based on video duration can be fully guaranteed.
[0040] Step B: determining a target interval to which the first positive sample belongs from a plurality of specified duration intervals, and obtaining target duration information corresponding to the video samples included in the target interval.
[0041] In some specific examples, the average video duration of the target interval can be obtained based on the video duration of each video sample included in the target interval; the average playback duration of the target interval can be obtained based on the playback duration of each video sample included in the target interval; and the average video duration and average playback duration are used as the target duration information. In other words, the target duration information includes the average video duration and average playback duration of the target interval.
[0042] Step C: Upsampling the first positive sample based on the target duration information to obtain a target positive sample. The disclosed embodiments, by statistically analyzing the playback duration and video duration of the video samples contained in the target interval, facilitate more reasonable and reliable determination of the upsampling method for the first positive sample. In some implementation examples, upsampling the first positive sample can be performed based on the ratio of the average playback duration to the average video duration to obtain the target positive sample. That is, the upsampling multiple can be reasonably determined based on this ratio to obtain the target positive sample.
[0043] In some specific implementation examples, the step of performing upsampling on the first positive sample based on the ratio of the average playback duration to the average video duration to obtain the target positive sample can be performed with reference to the following steps a and b:
[0044] Step a, based on the ratio of the average playback time to the average video time, determine the upsampling multiple. Specifically, for each first positive sample, based on the ratio of the average playback time to the average video time corresponding to the target interval where the first positive sample is located, determine the upsampling multiple of the first positive sample. Compared to the method of directly setting a fixed upsampling multiple for all positive samples, the embodiment of the present disclosure can fully consider the average playback time and average video time of all videos in the time interval to which each first positive sample belongs, and on this basis, based on the ratio of the two, it helps to more reasonably determine the upsampling multiple of each first positive sample, thereby reasonably increasing the proportion of the first positive samples in the model training samples, and further strengthening the model's learning of the first positive samples whose playback completion meets the requirements. In practical applications, the ratio can be directly used as the upsampling multiple, or the upsampling multiple can be determined based on the mapping relationship between the ratio and the preset upsampling multiple. The mapping relationship can be represented by a linear function or a nonlinear function. The mapping relationship can be flexibly set according to needs, such as determining the mapping relationship based on the distribution ratio of the target video type and other video types such as long videos to ensure the distribution balance between the target video type and other video types. There is no restriction here. For example, if the target interval corresponding to a first positive sample includes 3 videos, namely 10s, 20s and 60s, then the average video length of the target interval is 30s. In addition, assuming that the 10s and 20s videos are not played and are both negative samples, and the 60s video as the first positive sample is played completely multiple times, the average playback time of the target interval is 60s, then the ratio is 2. In order to increase the number of first positive samples and improve the proportional balance of positive and negative samples, the upsampling multiple can be directly 2, or an upsampling multiple with a mapping relationship with 2 can be determined based on a specific mapping relationship. For example, if the mapping relationship is represented by ratio * preset coefficient, then the value obtained by 2*preset coefficient can be used as the upsampling multiple, and there is no restriction here.
[0045] In practical applications, when the ratio of the average playback time to the average video time is a non-integer, a rounding process can be performed based on the ratio, and the upsampling multiple can be determined based on the rounding process result, such as using the rounding process result as the upsampling multiple, or performing mapping processing based on the rounding process result to obtain the upsampling multiple. In addition, a multiple threshold can be pre-set. When the ratio of the average playback time to the average video time is greater than a preset multiple threshold, the upsampling multiple can be determined based on the preset multiple threshold, such as directly using the preset multiple threshold as the upsampling multiple. For example, assuming that the ratio is 12, but the preset multiple threshold is 10, the upsampling multiple can be directly set to 10 instead of 12, or mapping processing can be performed directly based on the preset multiple threshold 10 to obtain the corresponding upsampling multiple. The embodiment of the present disclosure limits the upper limit of the upsampling multiple by setting a preset multiple threshold, avoiding the situation where the sampling multiple of individual positive samples is too high and noise samples appear, causing interference to model training, thereby further ensuring the rationality of the final upsampling multiple.
[0046] In step b, the first positive sample is replicated based on the upsampling factor to obtain a target positive sample. The upsampling factor is the number of copies of the first positive sample, and the replicated target positive sample is added to the positive sample set. This replication process can simply and efficiently increase the number of positive samples, ensuring that the number of target positive samples meets the requirements.
[0047] The present disclosure also provides Figure 2 The flow chart of a sample acquisition method shown mainly includes the following steps S202 to S214:
[0048] Step S202: Acquire multiple video samples corresponding to the PUGC video type. Since the video sample is a PUGC video type, that is, a PUGC video, its click-through rate is usually within the first indicator range (corresponding to the aforementioned preset indicator range), and its playback completion rate is also usually within the second indicator range.
[0049] Step S204 , based on the respective corresponding playback completions of the multiple video samples, a first positive sample is screened out from the multiple video samples; wherein the playback completion of the first positive sample is higher than the playback completions of the other video samples in the multiple video samples except the first positive sample.
[0050] Step S206: Based on the video durations of the multiple video samples, multiple designated duration intervals are determined. Different designated duration intervals have different ranges, and the shorter the video sample, the smaller the range of the designated duration interval. The upper limit of the designated duration interval is higher than the target value; the target value includes the mean or median playback duration of the video samples in the designated duration interval.
[0051] Step S208: Determine the target interval to which the first positive sample belongs from multiple specified duration intervals, and obtain the average video duration corresponding to the target interval based on the video duration of each video sample included in the target interval; and obtain the average playback duration corresponding to the target interval based on the playback duration of each video sample included in the target interval.
[0052] Step S210: determining an upsampling factor based on a ratio of the average playback duration to the average video duration.
[0053] Step S212: Based on the upsampling multiple, the first positive sample is copied to obtain a target positive sample.
[0054] Step S214: obtaining training samples for a video ranking model based on the multiple video samples and the target positive samples.
[0055] The specific implementation of the above steps can refer to the aforementioned related content and will not be repeated here. Through the above method, it is possible to first screen out the first positive sample with high playback completion based on the playback completion, and reasonably divide the duration interval based on the video sample duration, so as to reasonably determine the upsampling multiple based on the video situation of the target interval to which the first positive sample belongs, and simply and efficiently increase the number of the first positive sample by copying, which helps to obtain training samples with a balance between positive and negative samples, strengthen the video sorting model's learning of positive samples with a playback completion that meets the requirements, improve the score of PUGC videos with high playback completion and the probability of displaying them to users, thereby improving the accuracy of video recommendations.
[0056] Furthermore, for ease of understanding, the present disclosure also provides an application scenario of the above sample acquisition method. Figure 3The diagram of an application scenario is shown. It illustrates the key steps of selecting personalized recommended videos from the video library. Specifically, it can go through multiple key steps such as recall, filtering, rough sorting, fine sorting and re-sorting. Among them, the recall step mainly selects tens of thousands / thousands of candidate videos from the video library based on a specific recall strategy. The filtering step will further filter based on a specific filtering strategy based on the recall results, such as filtering out videos that the user has previously watched or videos that the user is not interested in. There is no restriction on the filtering strategy here. The rough sorting step will perform a rough ranking score on the videos retained by the filtering step and select the top N videos as the rough sorting results. The number of the top N videos is still relatively large and may reach thousands. The fine ranking link is a relatively critical link. It can further select more accurate recommended videos based on the rough ranking results, greatly narrowing the range of the number of videos that can be recommended to users. For example, hundreds of videos can be selected first, and then the fine ranking results can be scattered through specific re-ranking strategies such as business logic, and the top M videos can be selected and recommended to users. The number of the top M videos is usually small, perhaps only more than ten or dozens, which can reasonably be used as personalized video recommendation results for users. Among them, the training samples obtained by the above-mentioned sample acquisition method are used to train the video ranking model mainly used in the fine ranking link. Specifically, initial sample data can be obtained based on label data such as positive and negative sample labels and feature data such as video attribute features and user features, and sample acquisition processing can be performed based on the obtained initial sample data to obtain model training samples. Specifically, multiple video samples that meet the requirements can be determined based on the obtained initial sample data, and then the sample acquisition method provided by the embodiment of the present disclosure can be executed to obtain model training samples. Model training is performed based on the model training samples to obtain a trained video ranking model, which can be used in the fine ranking link to further perform fine ranking recommendations based on the rough ranking results. It should be noted that the above embodiments of the present disclosure provide Figure 3 This is only an application example. In actual applications, the video ranking model trained in the above manner can also be applied to other scenarios and is not limited here.
[0057] To sum up, the sample acquisition method provided by the embodiments of the present disclosure helps to obtain more reasonable and reliable training samples for the video sorting model, helps to strengthen the video sorting model's learning of positive samples whose playback completion meets the requirements, thereby improving the accuracy of the video sorting results, and correspondingly improving the accuracy of video recommendations, and can be better applied to video recommendation scenarios.
[0058] Corresponding to the aforementioned sample acquisition method, the embodiment of the present disclosure further provides a sample acquisition device, Figure 4 This is a schematic diagram of the structure of a sample acquisition device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated into an electronic device, such as Figure 4 As shown, the sample acquisition device includes:
[0059] The video sample acquisition module 402 is used to acquire a plurality of video samples; wherein the click rate of the video samples is within a preset index range;
[0060] A positive sample screening module 404 is configured to screen a first positive sample from the plurality of video samples based on the respective corresponding playback completion levels of the plurality of video samples; wherein the playback completion level of the first positive sample is higher than the playback completion levels of the other video samples in the plurality of video samples except the first positive sample;
[0061] An upsampling processing module 406 is configured to perform upsampling processing on the first positive sample to obtain a target positive sample;
[0062] The training sample obtaining module 408 is configured to obtain training samples for a video ranking model based on multiple video samples and target positive samples.
[0063] The above-mentioned device provided by the embodiment of the present disclosure takes into account the impact of the playback completion degree on the accuracy of video recommendation, and takes into account that the number of positive samples is usually small and easily leads to an imbalance between positive and negative samples. Therefore, after obtaining multiple video samples with click-through rates in a preset indicator range, based on the playback completion degrees corresponding to the multiple video samples, the first positive sample with a high playback completion degree is first screened out from the multiple video samples, and the first positive sample is further upsampled. This device can effectively increase the number of positive samples with playback completion degrees that meet the requirements, and on this basis, it helps to obtain more reasonable and reliable training samples for the video sorting model, and helps to strengthen the video sorting model's learning of positive samples with playback completion degrees that meet the requirements, thereby improving the accuracy of the video sorting results, and correspondingly improving the accuracy of video recommendations.
[0064] In some embodiments, the upsampling processing module 406 is specifically used to: obtain multiple specified time intervals; determine the target interval to which the first positive sample belongs from the multiple specified time intervals, and obtain the target time information corresponding to the video sample contained in the target interval; upsample the first positive sample based on the target time information to obtain a target positive sample.
[0065] In some embodiments, the upsampling processing module 406 is specifically used to: determine multiple specified duration intervals based on the video duration of each of the multiple video samples; different specified duration intervals correspond to different interval ranges, and the shorter the video duration of the video sample, the smaller the duration interval range of the interval in which it is located.
[0066] In some embodiments, the upper limit of the specified duration interval is higher than the target value; wherein the target value includes the mean playback duration or the median playback duration corresponding to the video samples in the specified duration interval.
[0067] In some embodiments, the upsampling processing module 406 is specifically used to: obtain the average video duration corresponding to the target interval based on the video duration of each video sample included in the target interval; obtain the average playback duration corresponding to the target interval based on the playback duration of each video sample included in the target interval; and use the average video duration and the average playback duration as target duration information.
[0068] In some implementations, the upsampling processing module 406 is specifically configured to: perform upsampling processing on the first positive sample based on the ratio of the average playback duration to the average video duration to obtain a target positive sample.
[0069] In some embodiments, the upsampling processing module 406 is specifically used to: determine an upsampling multiple based on the ratio of the average playback time to the average video time; and copy the first positive sample based on the upsampling multiple to obtain a target positive sample.
[0070] In some embodiments, the upsampling processing module 406 is specifically used to: when the ratio of the average playback time to the average video time is a non-integer, perform rounding based on the ratio, and determine the upsampling multiple based on the rounding result; when the ratio of the average playback time to the average video time is greater than a preset multiple threshold, use the preset multiple threshold as the upsampling multiple.
[0071] The sample acquisition device provided in the embodiments of the present disclosure can execute the sample acquisition method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0072] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device embodiment can refer to the corresponding process in the method embodiment, and will not be repeated here.
[0073] An embodiment of the present disclosure provides an electronic device, which includes: a storage device storing a computer program; and a processing device configured to execute the computer program in the storage device to implement the steps of any one of the methods in the present disclosure.
[0074] Reference below Figure 5, which shows a schematic structural diagram of an electronic device 500 suitable for implementing the embodiments of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0075] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0076] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0077] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0078] In addition to the above-mentioned methods and devices, the embodiments of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, cause the processor to perform the image processing method provided by the embodiments of the present disclosure. The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present disclosure, the programming languages including object-oriented programming languages such as Java, C++, etc., and also conventional procedural programming languages such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0079] In addition, the embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the processor is caused to execute the sample acquisition method provided by the embodiment of the present disclosure.
[0080] The computer-readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can, for example, include but is not limited to a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable 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 thereof.
[0081] The embodiments of the present disclosure further provide a computer program product, including a computer program / instruction, which implements the sample acquisition method in the embodiments of the present disclosure when executed by a processor.
[0082] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0083] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0084] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0085] It is understandable that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0086] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0087] The foregoing description is intended only to provide specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the embodiments described herein, but rather to be construed in the broadest manner consistent with the principles and novel features disclosed herein.
Claims
1. A sample acquisition method, characterized in that: include: Acquire multiple video samples; wherein the click-through rates of the video samples are within a preset index range; Based on the playback completion degrees corresponding to the multiple video samples, a first positive sample is selected from the multiple video samples; wherein the playback completion degree of the first positive sample is higher than the playback completion degrees of other video samples in the multiple video samples except the first positive sample; Performing upsampling on the first positive sample to obtain a target positive sample; Based on the multiple video samples and the target positive samples, training samples of a video ranking model are obtained.
2. The method according to claim 1, characterized in that The upsampling of the first positive sample to obtain a target positive sample includes: Get multiple specified time intervals; Determining a target interval to which the first positive sample belongs from the multiple specified duration intervals, and obtaining target duration information corresponding to the video samples included in the target interval; The first positive sample is upsampled based on the target duration information to obtain a target positive sample.
3. The method according to claim 2, characterized in that The obtaining of multiple specified time intervals includes: Based on the video duration of each of the multiple video samples, multiple designated duration intervals are determined; different designated duration intervals correspond to different interval ranges, and the shorter the video duration of a video sample, the smaller the interval range of the designated duration interval in which it is located.
4. The method according to claim 3, characterized in that The upper limit value of the specified duration interval is higher than the target value; wherein the target value includes the average playback duration or the median playback duration corresponding to the video samples in the specified duration interval.
5. The method according to claim 2, characterized in that The obtaining target duration information corresponding to the video samples included in the target interval includes: Obtaining an average video duration corresponding to the target interval based on the video durations of the video samples included in the target interval; Obtaining an average playback duration corresponding to the target interval based on the playback durations of the video samples included in the target interval; The average video duration and the average playback duration are used as target duration information.
6. The method according to claim 5, characterized in that The upsampling of the first positive sample based on the target duration information to obtain a target positive sample includes: Based on the ratio of the average playback duration to the average video duration, upsampling is performed on the first positive sample to obtain a target positive sample.
7. The method according to claim 6, characterized in that The upsampling of the first positive sample based on the ratio of the average playback duration to the average video duration to obtain a target positive sample includes: Determining an upsampling multiple based on a ratio of the average playback duration to the average video duration; Based on the upsampling multiple, the first positive sample is copied to obtain a target positive sample.
8. The method according to claim 7, characterized in that The determining of the upsampling multiple based on the ratio of the average playback duration to the average video duration includes: When the ratio of the average playback duration to the average video duration is a non-integer, performing rounding based on the ratio, and determining an upsampling multiple based on the rounding result; When the ratio of the average playback duration to the average video duration is greater than a preset multiple threshold, an upsampling multiple is determined based on the preset multiple threshold.
9. A sample acquisition device, characterized in that: include: A video sample acquisition module is used to acquire multiple video samples corresponding to the target video type; wherein the click rate of the video samples is within a preset index range; a positive sample screening module, configured to screen out a first positive sample from the plurality of video samples based on the respective corresponding playback completion degrees of the plurality of video samples; wherein the playback completion degree of the first positive sample is higher than the playback completion degrees of other video samples in the plurality of video samples except the first positive sample; an upsampling processing module, configured to perform upsampling processing on the first positive sample to obtain a target positive sample; The training sample obtaining module is used to obtain training samples of the video ranking model based on the multiple video samples and the target positive samples.
10. An electronic device, characterized in that: The electronic device comprises: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the sample acquisition method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and the computer program is used to execute the sample acquisition method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The invention comprises a computer program, which implements the sample acquisition method according to any one of claims 1 to 8 when executed by a processor.