Training set construction method and device, electronic equipment and storage medium

By determining the user behavior data screening and feature construction within a specified time interval in the video recommendation model, the problems of low training efficiency and insufficient recommendation accuracy are solved, and efficient training set construction and accurate video recommendations are achieved.

CN120707983APending Publication Date: 2025-09-26BEIJING IQIYI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510752064.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-06
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

In the existing technology, the training efficiency of video recommendation models is low and the recommendation accuracy is insufficient, mainly because the large amount of user behavior data leads to low efficiency in building training sets.

Method used

By determining multiple specified time intervals, selecting user behavior data within each interval, screening and constructing training sets based on expected contribution, including the construction of positive and negative sample features, and prioritizing recent user behavior data to improve the contribution and accuracy of model training.

Benefits of technology

It improves the efficiency of training set construction and the accuracy of model recommendations, ensures the diversity of training set data and its matching degree with user interests, and enhances the model's generalization ability and recommendation effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120707983A_ABST
    Figure CN120707983A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a training set construction method and device, electronic equipment and a storage medium, and relates to the technical field of data processing. The specific implementation scheme is as follows: determining a plurality of specified time intervals; for each specified time interval, selecting the user behavior data from each piece of user behavior data in the specified time interval so as to select at least one piece of user behavior data; and generating a training set for training a video recommendation model based on the selected user behavior data. Therefore, according to the scheme, a data basis can be provided for considering the training efficiency of the model and the recommendation accuracy of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a training set construction method, device, electronic device and storage medium. Background Art

[0002] In the prior art, the video recommendation models used by video platforms for search terms are trained using user behavior data. Typically, to ensure the accuracy of the video recommendation model, existing user behavior data is used to construct a training set for training the model. However, this training method suffers from low model training efficiency due to the large amount of user behavior data and training set data. The user behavior data for any given user includes data related to the actions taken by any user in response to a specified video; the specified video is a video recommended to the user based on the user's search term.

[0003] Therefore, there is an urgent need for a training set construction method to provide a data basis for both the training efficiency of the model and the accuracy of the model in recommending videos to users. Summary of the Invention

[0004] The purpose of the embodiments of the present application is to provide a training set construction method, device, electronic device, and storage medium to provide a data foundation for balancing the training efficiency of the model and the accuracy of the model's recommendations. The specific technical solutions are as follows:

[0005] In a first aspect of the present application, a method for constructing a training set is provided, the method comprising:

[0006] Determine a plurality of designated time intervals; wherein the plurality of designated time intervals include a target designated time interval with the current time as the end time;

[0007] For each designated time interval, user behavior data is selected from each piece of user behavior data within the designated time interval to obtain at least one piece of user behavior data; wherein a selection weight of the user behavior data selection is positively correlated with an expected contribution of the user behavior data within the designated time interval to model training; the user behavior data within the target designated time interval is set to have the greatest expected contribution to model training;

[0008] Based on the selected user behavior data, a training set for training a video recommendation model is generated. Optionally, the generating of a training set for training a video recommendation model based on the selected user behavior data includes:

[0009] Determining sample user behavior data from the selected user behavior data; wherein the sample user behavior data at least includes: user behavior data whose recorded viewing time is greater than a first specified time;

[0010] Based on the sample user behavior data, a training set for training a video recommendation model is generated.

[0011] Optionally, generating a training set for training a video recommendation model based on the sample user behavior data includes:

[0012] Based on the sample user behavior data, a training set including positive sample features and negative sample features for training a video recommendation model is constructed according to a predetermined positive sample feature construction method and a negative sample feature construction method;

[0013] The positive sample feature construction method includes: for each user behavior data in the sample user behavior data, constructing a positive sample feature based on at least a description feature of a video recorded by the user behavior data;

[0014] The negative sample feature construction method includes: for each user behavior data in the sample user behavior data, determining the target user to which the user behavior data belongs and the target search term recorded by the user behavior data; determining the videos recommended when the target user searches using the target search term; from the various videos, determining the videos that the target user has not played; for each determined video, constructing a negative sample feature based at least on the descriptive features of the video.

[0015] Optionally, for each specified time interval, user behavior data selection is performed from each piece of user behavior data within the specified time interval to select at least one piece of user behavior data, including:

[0016] For each designated time interval, in response to the designated time interval being the target designated time interval, selecting all user behavior data from each piece of user behavior data within the designated time interval;

[0017] In response to the designated time interval not being a target designated time interval, dividing the user behavior data recorded with the same search term within the designated time interval into a group of user behavior data; and

[0018] For each group of user behavior data obtained by the division, select user behavior data from the group of user behavior data according to the selection proportion corresponding to the specified time interval;

[0019] For any two specified time intervals other than the target specified time interval, the selection proportion corresponding to the specified time interval whose represented time is closer to the current time is greater than the selection proportion corresponding to the specified time interval whose represented time is farther from the current time; the selection proportion of each specified time interval is negatively correlated with the span of the time corresponding to the specified time interval from the current time.

[0020] Optionally, selecting user behavior data from the set of user behavior data according to a selection weight corresponding to the specified time interval includes:

[0021] Sort each piece of user behavior data in the set of user behavior data by sorting the data record time from recent to oldest to obtain a sorted sequence;

[0022] From the obtained sorting sequence, the user behavior data with the highest sorting is selected according to the selection proportion corresponding to the specified time interval.

[0023] Optionally, determining sample user behavior data from the selected pieces of user behavior data includes:

[0024] Determine, from the selected pieces of user behavior data, user behavior data whose recorded viewing duration is greater than a first specified duration, to obtain first-category user behavior data;

[0025] Determining, from the selected pieces of user behavior data, user behavior data whose recorded viewing duration is no longer than a first specified duration, clustering the determined user behavior data according to the specified time interval to obtain at least one clustering result;

[0026] For each clustering result, selecting a predetermined proportion of user behavior data corresponding to the clustering result from the clustering result to obtain a selected result, and selecting user behavior data with a recorded viewing duration greater than a second specified duration from the selected result to obtain second-category user behavior data; wherein the predetermined proportion corresponding to the clustering result is a predetermined proportion set for the specified time interval to which the user behavior data in the clustering result belongs;

[0027] Based on the obtained first category user behavior data and second category user behavior data, sample user behavior data is determined.

[0028] A corresponding predetermined ratio may be pre-set for each designated time interval, and the predetermined ratio may be used to perform data screening on the behavior data in the clustering results.

[0029] Optionally, for each clustering result, selecting a predetermined proportion of user behavior data corresponding to the clustering result from the clustering result, and obtaining the selected result includes:

[0030] For each clustering result, determining an interest quality evaluation value for each user behavior data in the clustering result; wherein the interest quality evaluation value is used to represent the user's interest in the video and is positively correlated with the viewing time recorded in the user behavior data;

[0031] Sort the user behavior data in the clustering result according to the interest quality evaluation value from high to low to obtain a sorted sequence;

[0032] From the obtained sorting sequence, user behavior data with a higher sorting order is selected according to a predetermined ratio corresponding to the clustering result to obtain a selection result corresponding to the clustering result.

[0033] Optionally, the negative sample feature construction method further includes:

[0034] For each piece of user behavior data selected, other than the sample user behavior data, a negative sample feature is constructed based at least on a description feature of the video recorded by the user behavior data.

[0035] In a second aspect of the present application, a training set construction device is provided, the device comprising:

[0036] a determination module, configured to determine a plurality of designated time intervals; wherein the plurality of designated time intervals include a target time interval with the current time as the end time;

[0037] a selection module configured to select, for each specified time interval, user behavior data from each piece of user behavior data within the specified time interval to obtain at least one piece of user behavior data; wherein a weight of the selected user behavior data is positively correlated with an expected contribution of the user behavior data within the specified time interval to model training; and the user behavior data within the target specified time interval is set to have the greatest expected contribution to model training;

[0038] The generation module is used to generate a training set for training a video recommendation model based on the selected user behavior data.

[0039] A third aspect of the present application provides an electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0040] Memory for storing computer programs;

[0041] The processor is configured to implement any of the above-mentioned training set construction methods when executing the program stored in the memory.

[0042] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the above-mentioned training set construction methods is implemented.

[0043] In another aspect of the implementation of the present application, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the above-described training set construction methods.

[0044] The embodiment of the present application provides a method for constructing a training set. When generating a training set, based on the expected contribution of user behavior data in each specified time interval to model training, user behavior data is selected from each specified time interval according to the selection ratio of the specified time interval. This can effectively streamline the amount of user behavior data under the premise of ensuring the diversity of the time to which the user behavior data used to construct the training set belongs, so that the efficiency of training the model using the data set constructed by the selected user behavior data is higher. Since the expected contribution of each specified time interval is set in this application, the limited number of user behavior data selected meets the data requirements for each specified time interval during model training, and since recent behavior data can better reflect the user's interests, the expected contribution of the target specified time interval is set to the maximum, which can increase the contribution of recent behavior data to model training. Therefore, the model trained using the data set constructed by the selected user behavior data has a high degree of match between the recommended content and the user's interests. It can be seen that the solution of this application provides a data basis for balancing the training efficiency of the model and the recommendation accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present application 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.

[0046] Figure 1 A flow chart of a training set construction method provided in an embodiment of the present application;

[0047] Figure 2 A schematic diagram of another method for constructing a training set provided in an embodiment of the present application;

[0048] Figure 3 A schematic diagram of the structure of a training set construction device provided in an embodiment of the present application;

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

[0050] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0051] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0052] The embodiments of the present application provide a training set construction method, device, electronic device and storage medium, thereby providing a data basis for balancing the training efficiency of the model and the recommendation accuracy of the model.

[0053] The following first introduces a training set construction method provided by an embodiment of the present disclosure. A training set construction method provided by an embodiment of the present application can be applied to an electronic device. For example, the electronic device can be a server, a terminal device, etc. The present application does not limit the specific form of the electronic device.

[0054] Among them, a training set construction method provided in an embodiment of the present application may include:

[0055] Determine a plurality of designated time intervals; wherein the plurality of designated time intervals include a target designated time interval with the current time as the end time;

[0056] For each designated time interval, user behavior data is selected from each piece of user behavior data within the designated time interval to obtain at least one piece of user behavior data; wherein a selection weight of the user behavior data selection is positively correlated with an expected contribution of the user behavior data within the designated time interval to model training; the user behavior data within the target designated time interval is set to have the greatest expected contribution to model training;

[0057] Based on the selected user behavior data, a training set for training a video recommendation model is generated. An embodiment of the present application provides a training set construction method. When generating a training set, based on the expected contribution of user behavior data in each specified time interval to model training, user behavior data is selected from each specified time interval according to the selection ratio of the specified time interval. This can effectively streamline the amount of user behavior data under the premise of ensuring the diversity of the time period to which the user behavior data used to construct the training set belongs, so that the efficiency of training the model using the data set constructed by the selected user behavior data is higher. Since the expected contribution of each specified time interval is set in the present application, the limited number of user behavior data selected meets the data requirements for each specified time interval during model training, and since recent behavior data can better reflect the user's interests, the expected contribution of the target specified time interval is set to the maximum, which can increase the contribution of recent behavior data to model training. Therefore, the model trained using the data set constructed by the selected user behavior data has a high degree of match between the recommended content and the user's interests. It can be seen that the solution of the present application provides a data basis for balancing the training efficiency of the model and the recommendation accuracy of the model.

[0058] like Figure 1 As shown, a training set construction method provided by an embodiment of the present disclosure includes:

[0059] S101, determining a plurality of designated time intervals; wherein the plurality of designated time intervals include a target designated time interval with a current time as an end time.

[0060] In this application, the target specified time interval with the current time as the end time is the latest specified time interval. The user behavior data in this specified time interval can reflect the user's latest interests. Therefore, by setting multiple specified time intervals, user behavior data that matches the user's long-term interests can be selected from multiple specified time intervals. By setting multiple specified time intervals including a target specified time interval with the current time as the end time, user behavior data that highly matches the current user's interests can be selected from the target specified time intervals.

[0061] This application can determine the corresponding number of specified time intervals based on the specific application scenario. For example, in one implementation, three specified time intervals can be divided, the first specified time interval is N days before the current time to the current time, the second specified time interval is M days before the current time to N days before the current time, and the third specified time interval is X days before the current time to M days before the current time. In one implementation, two specified time intervals can be divided, the first specified time interval is 4 months before the current time to the current time, and the second specified time interval is 9 months before the current time to 4 months before the current time. In another implementation, four specified time intervals can be divided, the first specified time interval is 1 week before the current time to the current time, the second specified time interval is 4 weeks before the current time to 1 week before the current time, the third specified time interval is 8 weeks before the current time to 4 weeks before the current time, and the second specified time interval is 12 weeks before the current time to 8 weeks before the current time. In this application, the granularity of the specified time interval can be set according to the specific application scenario, for example, it can be days, weeks, months, etc.

[0062] The current time is the time when the training set construction method is executed. The granularity of time can be divided into seconds, minutes, hours, and days, etc., which is not limited in this application. For example, if the time granularity is days, the current time is the 29th, and the time interval is divided into weeks, then the 23rd to the 29th is the target designated time interval.

[0063] S102. For each specified time interval, user behavior data is selected from each piece of user behavior data within the specified time interval to obtain at least one piece of user behavior data; wherein the selection ratio of the user behavior data is positively correlated with the expected contribution of the user behavior data within the specified time interval to the model training; the user behavior data within the target specified time interval is set to have the greatest expected contribution to the model training.

[0064] The user behavior data described in this application is a record of the actions performed by each user on a specific video by the video platform. The specific video is a video recommended to the user when the user searches using a search term.

[0065] Any user behavior data record includes data related to any user's actions on a specific video. For example, it can record user actions such as playing, liking, adding to favorites, commenting, and / or sharing, as well as corresponding search terms and video information.

[0066] It's understandable that a user's interests in videos may change over time. For example, a user may have liked video type A six months ago, but currently prefers video type B. Therefore, to ensure that the recommendations from the trained model better match the user's current interests, the weighting of the user behavior data selection can be set to be positively correlated with the expected contribution of the user behavior data to model training within the specified time interval. In other words, the higher the expected contribution for a specified time interval, the more user behavior data items will be selected for that specified time interval.

[0067] This application selects user behavior data for each specified time interval, so that the model subsequently trained using the selected user behavior data can learn the user's long-term interests and effectively improve the generalization ability of the model.

[0068] Furthermore, user behavior data within the target time interval is set to have the highest expected contribution to model training, giving it the highest weight. A model trained using this selected user behavior data has a high accuracy rate for identifying user interests corresponding to that time interval, meaning it accurately identifies the user's current interests.

[0069] Optionally, the selection weight can be replaced by the selection quantity. A corresponding selection quantity can be set in advance for each specified time interval, and the corresponding number of user behavior data from each specified time interval is selected. If the number of user behavior data in a specified time interval is less than the selection quantity, all of them are selected. The selection quantity of user behavior data selected is positively correlated with the expected contribution of the user behavior data in the specified time interval to model training.

[0070] There are many ways to implement the method of selecting user behavior data from each piece of user behavior data within each specified time interval to obtain at least one piece of user behavior data.

[0071] In one implementation, for each designated time interval, selecting user behavior data from each piece of user behavior data within the designated time interval includes:

[0072] For each specified time interval, user behavior data is randomly selected from each piece of user behavior data in the specified time interval according to the selection proportion corresponding to the specified time interval.

[0073] The method of this embodiment can randomly select user behavior data from each user behavior data in any specified time interval according to the selection ratio corresponding to the specified time interval. For example, there are 100,000 user behavior data in the specified time interval A, and the predetermined number corresponding to the specified time interval A is 10%, then 10,000 user behavior data can be randomly selected from the 100,000 user behavior data.

[0074] In one implementation, for each specified time interval, selecting user behavior data from each piece of user behavior data within the specified time interval to obtain at least one piece of user behavior data includes:

[0075] Sort each piece of user behavior data in the specified time interval by the data recording time from recent to oldest to obtain a sorted sequence;

[0076] From the obtained sorting sequence, the user behavior data with the highest sorting is selected according to the selection proportion corresponding to the specified time interval.

[0077] The data recording time of each user behavior data may be the time when the user performs the behavior, or the time when the user behavior data corresponding to the behavior is generated after the user performs the behavior.

[0078] In one implementation, for each specified time interval, selecting user behavior data from each piece of user behavior data within the specified time interval to obtain at least one piece of user behavior data includes:

[0079] For each designated time interval, in response to the designated time interval being the target designated time interval, selecting all user behavior data from each piece of user behavior data within the designated time interval;

[0080] In response to the designated time interval not being a target designated time interval, dividing the user behavior data recorded with the same search term within the designated time interval into a group of user behavior data; and

[0081] For each group of user behavior data obtained by the division, select user behavior data from the group of user behavior data according to the selection proportion corresponding to the specified time interval;

[0082] For any two specified time intervals other than the target specified time interval,

[0083] The selection proportion corresponding to the specified time interval whose represented time is closer to the current time is greater than the selection proportion corresponding to the specified time interval whose represented time is farther from the current time; the selection proportion of each specified time interval is negatively correlated with the span of the time corresponding to the specified time interval from the current time.

[0084] The selection ratio used by this application when selecting user behavior data from each specified interval is based on the expected contribution of the user behavior data in each specified interval to model training. For any specified interval, the selection ratio of the user behavior data selected from the specified interval is higher, and the expected contribution of the user behavior data in the specified interval to model training is higher. Therefore, since the target time interval is a specified time interval with the current time as the end time, the user behavior data in the target time interval has the highest expected contribution to model training, and all user behavior data can be selected.

[0085] For any two specified time intervals other than the target time interval, the expected contribution of user behavior data in the earlier specified time interval to model training is greater than the expected contribution of user behavior data in the later specified time interval to model training. Therefore, the selection proportion corresponding to the earlier specified time interval is greater than the selection proportion corresponding to the later specified time interval.

[0086] The expected contribution of each specified time interval is negatively correlated with the distance from the current time to the specified time interval. The larger the distance from the current time to the specified time interval, the smaller the expected contribution, and thus the smaller the selected weight. The time corresponding to a specified time interval can be a time selected from the specified time interval, and the time corresponding to each specified time interval is selected in the same manner. For example, for time interval A (April 29, April 22), April 29 can be used as the time interval to determine the time span.

[0087] The division method and number of the specified time intervals can be determined according to the specific scenario, and this application does not limit this.

[0088] In order to make the information contained in the sample features of the training set more comprehensive and extensive, this application selects user behavior features based on the dimension of search terms for any specified time interval other than the target time interval. The user behavior data recorded with the same search term in the specified time interval can be divided into a group of user behavior data. From any group of user behavior data in the specified time interval, a predetermined number of user behavior data corresponding to the specified time interval can be selected. Thus, each selected user behavior data can involve all existing search terms. For example, the specified time interval 1 is: 10 days before the current time to 5 days before the current time, and the specified time interval 2 is: 20 days before the current time to 6 days before the current time. The predetermined number corresponding to the specified time interval 1 is 1000, and the number corresponding to the specified time interval 2 is 500. For search term A, 1000 user behavior data can be selected from the group of user behavior data corresponding to search term A in the specified time interval 1, and 500 user behavior data can be selected from the group of user behavior data corresponding to search term A in the specified time interval 2.

[0089] When the selection quantity of any set of user behavior data in any specified time interval, determined according to the selection proportion, is not greater than the predetermined quantity, all the user behavior data in the set of user behavior data may be selected.

[0090] S103: Generate a training set for training a video recommendation model based on the selected user behavior data.

[0091] The video recommendation model can be any conventional video recommendation model. Its input can be a feature vector constructed from the descriptive features of the candidate videos, search terms, and user features, and its output is a score for the candidate videos. The method for determining candidate videos and training the video recommendation model will be described in subsequent embodiments.

[0092] Each piece of user behavior data selected records the descriptive features of the video, search terms and user features, so that the descriptive features of the video, search terms and user features recorded in the selected piece of user behavior data can be used to generate sample features, so that each sample feature can be used as a training set for training a video recommendation model.

[0093] There are many ways to generate a training set for training a video recommendation model based on the selected user behavior data.

[0094] Optionally, in one implementation, generating a training set for training a video recommendation model based on the selected pieces of user behavior data includes:

[0095] For each piece of selected user behavior data, a positive sample feature is constructed based at least on a description feature of the video recorded by the user behavior data to obtain a training set for training a video recommendation model.

[0096] User behavior data can include video descriptive features and search terms. When constructing positive sample features, at least the video descriptive features can be used to construct positive sample features. Furthermore, the video descriptive features and search terms, as well as user descriptive features, can be used to construct positive sample features. For each piece of user behavior data, the user descriptive features are the user descriptive features of the user corresponding to the user behavior data.

[0097] Optionally, in one implementation, generating a training set for training a video recommendation model based on the selected pieces of user behavior data includes:

[0098] Determining sample user behavior data from the selected user behavior data; wherein the sample user behavior data at least includes: user behavior data whose recorded viewing time is greater than a first specified time;

[0099] Based on the sample user behavior data, a training set for training a video recommendation model is generated.

[0100] The sample behavior data may at least include user behavior data that characterizes the user's effective viewing. If the user has effectively watched any video, it means that the video matches the user's interests. The first specified duration can be used to determine whether the user has effectively watched the video. When the viewing time for any video is greater than the first specified duration, it means that the user has effectively watched the video. Usually, the viewing time can be the user's viewing time. However, in some cases, there may be a situation where the user clicks play and leaves the screen without watching. At this time, the user's actual viewing time can be identified through the existing solution for identifying the user's actual viewing time. The solution for identifying the user's actual viewing time is not the invention of this application. Any solution that can identify the user's actual viewing time can be applied to this application.

[0101] The setting of the first specified duration can be set according to the specific scenario. In addition, it is understandable that the video duration in the video platform may be different. For videos of different durations, a first specified duration corresponding to the video length can be set. For example, for a video of 5-10 minutes, the first specified duration can be set to 3 minutes, and for a video of 40-50 minutes, the first specified duration can be set to 30 minutes. This application does not limit the correspondence between the video duration and the first specified duration.

[0102] There are many ways to implement generating a training set for training a video recommendation model based on the sample user behavior data.

[0103] In one implementation, generating a training set for training a video recommendation model based on the sample user behavior data includes:

[0104] For each user behavior data in the sample user behavior data, a positive sample feature is constructed based on the description feature of the video recorded by the user behavior data, the search term, and the user feature.

[0105] The method of this embodiment can construct positive sample features to obtain a training set for training a video recommendation model. Using the training set constructed with each positive sample feature to train the video recommendation model allows the video recommendation model to learn the relationship between the user and the videos that the user is interested in.

[0106] In one implementation, generating a training set for training a video recommendation model based on the sample user behavior data includes:

[0107] Based on the sample user behavior data, a training set including positive sample features and negative sample features for training a video recommendation model is constructed according to a predetermined positive sample feature construction method and a negative sample feature construction method;

[0108] The positive sample feature construction method includes: for each user behavior data in the sample user behavior data, constructing a positive sample feature based on at least a description feature of a video recorded by the user behavior data;

[0109] The negative sample feature construction method includes: for each user behavior data in the sample user behavior data, determining the target user to which the user behavior data belongs and the target search term recorded in the user behavior data; determining the videos recommended when the target user searches using the target search term; determining, from the individual videos, videos that the target user has not played; and for each determined video, constructing a negative sample feature based at least on the descriptive features of the video. In this embodiment, the construction of positive sample features and negative sample features can also be constructed using descriptive features, search terms, and user features.

[0110] In this application, the video description features may include features related to information such as video type, video content, popularity, and duration. User description features may include features related to information such as user age, gender, video viewing frequency, and preferred categories. The video description features and user description features may be predetermined. This application does not limit the construction method and specific content of the video description features and user description features.

[0111] It is understandable that after a user searches using a search term, only a portion of the videos recommended to the user may be played, while the other portion may not be played by the user. The videos that are not played by the user can be considered as videos that the user is not interested in. Therefore, based on the videos that are not played, corresponding negative sample features can be generated. For example, a user searches for videos using search term A, and the videos recommended to the user are video 1, video 2, video 3, video 4, and video 5. If the user only watches video 1, the positive sample features are constructed using the descriptive features, search terms, and user features of video 1. For any of video 2, video 3, video 4, and video 5, the negative sample features are constructed using the descriptive features, search terms, and user features of the video.

[0112] User behavior data may include actions taken by users with respect to videos that were not played among the videos recommended to the target user when searching using the search term. In some cases, user behavior data may only be generated if the user has performed a corresponding action on the video. Therefore, information about videos that were not played among the videos recommended to the target user when searching using the search term can be obtained from data such as logs corresponding to the videos that the user searched for using the search term.

[0113] Optionally, the negative sample feature construction method further includes:

[0114] For each piece of user behavior data selected, other than the sample user behavior data, a negative sample feature is constructed based at least on a description feature of the video recorded by the user behavior data.

[0115] In the above embodiment, positive sample features are generated based on recorded user behavior data showing that the user's viewing time exceeds a first specified duration, while negative sample features are generated based on videos recommended to the user but not watched by the user. In the above embodiment, the included positive sample features are features that indicate a match between the user's interests and the video, while the included negative sample features are features that indicate a mismatch between the user's interests and the video.

[0116] Among the selected pieces of user behavior data other than the sample user behavior data, there are user behavior data corresponding to the user watching for a duration not exceeding the first specified duration, clicking, evaluating, or collecting the video. These user behavior data can represent that the user has performed behavioral operations on the video, but the viewing duration is not greater than the first specified duration, indicating that the user has a certain interest in the video, but the degree of match between the user interest and the video is not sufficient to achieve a matching degree. Therefore, each piece of user behavior data other than the sample user behavior data among the selected pieces of user behavior data can be used to construct negative sample features. When the training set is subsequently used to train the model, the model can learn more accurate multi-level matching relationships between user interests and videos, making the model's personalized recommendation capabilities more accurate.

[0117] The embodiment of the present application provides a method for constructing a training set. When generating a training set, based on the expected contribution of user behavior data in each specified time interval to model training, user behavior data is selected from each specified time interval according to the selection ratio of the specified time interval. This can effectively streamline the amount of user behavior data under the premise of ensuring the diversity of the time to which the user behavior data used to construct the training set belongs, so that the efficiency of training the model using the data set constructed by the selected user behavior data is higher. Since the expected contribution of each specified time interval is set in this application, the limited number of user behavior data selected meets the data requirements for each specified time interval during model training, and since recent behavior data can better reflect the user's interests, the expected contribution of the target specified time interval is set to the maximum, which can increase the contribution of recent behavior data to model training. Therefore, the model trained using the data set constructed by the selected user behavior data has a high degree of match between the recommended content and the user's interests. It can be seen that the solution of this application provides a data basis for balancing the training efficiency of the model and the recommendation accuracy of the model.

[0118] Optionally, there are multiple implementation methods for selecting a predetermined number of pieces of user behavior data corresponding to the specified time interval from the group of user behavior data.

[0119] In one implementation, selecting the user behavior data from the set of user behavior data according to the selection proportion corresponding to the specified time interval includes:

[0120] A predetermined number of pieces of user behavior data corresponding to the specified time interval are randomly selected from the set of user behavior data.

[0121] In one implementation, selecting the user behavior data from the set of user behavior data according to the selection proportion corresponding to the specified time interval includes:

[0122] Sort each piece of user behavior data in the set of user behavior data by sorting the data record time from recent to oldest to obtain a sorted sequence;

[0123] From the obtained sorting sequence, the user behavior data with the highest sorting is selected according to the selection proportion corresponding to the specified time interval.

[0124] In each specified time interval, the time span between the recording time of the user behavior data ranked higher and the current time is closer than the time span between the recording time of the user behavior data ranked lower and the current time, and the user behavior represented by the user behavior data ranked higher is more consistent with the user's interests at the current time. Therefore, this application can select a predetermined number of user behavior data corresponding to the top specified time interval from the obtained sorting sequence. The predetermined number in this application can be set according to the specific application scenario, and this application does not limit this. The various predetermined numbers involved in this application can be different.

[0125] Optionally, there are multiple ways to determine the sample user behavior data from the selected pieces of user behavior data.

[0126] In one implementation, determining sample user behavior data from the selected pieces of user behavior data may include:

[0127] From the selected pieces of user behavior data, user behavior data with a recorded viewing duration greater than the first specified duration is determined as sample user behavior data.

[0128] The function of the first specified duration here is the same as in the above embodiment, which is used to determine, for each piece of user behavior data, whether the user of the user behavior data record has effectively played the recorded video. If so, it indicates that the video matches the user's interests. The solution of this embodiment can use user behavior data records that indicate effective video playback as sample user behavior data, that is, select user behavior data that has a high degree of match with the current user's interests as sample user behavior data; in this way, when subsequently training a model using a training set generated from the sample user behavior data, both efficiency and accuracy of model training can be taken into account.

[0129] In one implementation, determining sample user behavior data from the selected pieces of user behavior data includes steps A1-A4;

[0130] Step A1: From the selected pieces of user behavior data, determine the user behavior data whose recorded viewing time is greater than a first specified time, and obtain the first category of user behavior data.

[0131] The role of the first specified duration here is the same as in the above embodiment, which is used to determine, for each user behavior data, whether the user recorded in the user behavior data has effectively played the recorded video. If it has been effectively played, it means that the video matches the interests of the user.

[0132] Step A2: Determine, from the selected user behavior data, user behavior data whose recorded viewing time is not greater than a first specified time, cluster the determined user behavior data according to the specified time interval to obtain at least one clustering result.

[0133] The specified time interval is the same as that in the above embodiment and will not be described in detail here.

[0134] Step A3, for each clustering result, select a predetermined proportion of user behavior data corresponding to the clustering result from the clustering result to obtain a selection result, and select user behavior data with a recorded viewing time greater than a second specified time from the selection result to obtain a second type of user behavior data; wherein the predetermined proportion corresponding to the clustering result is a predetermined proportion set for the specified time interval to which the user behavior data in the clustering result belongs.

[0135] The predetermined ratio corresponding to each clustering result can be set according to the specific application scenario. For example, the predetermined ratio corresponding to each clustering result can be set to 80%. This application does not limit the setting of the predetermined ratio corresponding to each clustering result. The predetermined ratio set for the specified time interval and the selection weight of the specified time interval can be the same or different. Both the predetermined ratio and the selection weight are used to filter user behavior data.

[0136] In this step, user behavior data is filtered using a predetermined ratio, which can streamline the sample user behavior data. The training set is generated based on the sample user behavior data, thereby streamlining the number of sample features in the training set and improving the efficiency of model training.

[0137] In one implementation, for each clustering result, any user behavior data in the clustering result may be screened according to a corresponding predetermined ratio to obtain a screening result corresponding to the clustering result.

[0138] In one implementation, for each clustering result, selecting a predetermined proportion of user behavior data corresponding to the clustering result from the clustering result, and obtaining the selected result includes:

[0139] For each clustering result, determining an interest quality evaluation value for each user behavior data in the clustering result; wherein the interest quality evaluation value is used to represent the user's interest in the video and is positively correlated with the viewing time recorded in the user behavior data;

[0140] Sort the user behavior data in the clustering result according to the interest quality evaluation value from high to low to obtain a sorted sequence;

[0141] From the obtained sorting sequence, user behavior data with a higher sorting order is selected according to a predetermined ratio corresponding to the clustering result to obtain a selection result corresponding to the clustering result.

[0142] For user behavior data whose recorded viewing time is no longer than a first specified time, an interest quality evaluation value for each piece of user behavior data can be calculated. Specifically, the interest quality evaluation value for each piece of user behavior data can be determined based on the viewing time. The longer the viewing time, the higher the interest quality evaluation value. Furthermore, due to the different lengths of long, medium, and short video types, the method for determining the interest quality evaluation value may vary. For example, if a long video A is 60 minutes long and the user watches 10 minutes, the interest quality evaluation value may be 16 points. If a medium video A is 20 minutes long and the user watches 10 minutes, the interest quality evaluation value may be 50 points.

[0143] It is understandable that while some user behavior data may record a viewing duration that is no longer than the first specified duration, some user behavior data may also record a user's playback, indicating a certain level of interest in the video being played. It is understandable that the longer a user watches a video, the higher their level of interest in the video. Therefore, the solution of this embodiment can filter out user behavior data with high interest quality evaluation values.

[0144] The user behavior data in the second category of user behavior data and the user behavior data in the first category of user behavior data represent different levels of interest in the video by the users, thereby increasing the diversity in the dimension of the degree of matching between users and videos in the user behavior data used to construct the training set.

[0145] Step A4: Determine sample user behavior data based on the obtained first category user behavior data and second category user behavior data.

[0146] This application determines, among the selected user behavior data, the user behavior data with recorded viewing time greater than the first specified time, without limiting the number, so that the sample user behavior data includes all the user behavior data with recorded viewing time greater than the first specified time, so that the generated training set can better reflect the relationship between user interests and videos, and improve the accuracy of model recommendations. For the user behavior data with recorded viewing time not greater than the first specified time, the corresponding data screening ratio is used for screening, which effectively streamlines the sample user behavior data, so that the sample features in the training set are also relatively streamlined, which can improve the training efficiency of the model.

[0147] The following is a specific example to describe the training set construction method. Figure 2 This is a flow chart of another training set construction method provided in the embodiments of the present application, such as Figure 2 A training set construction method provided in an embodiment of the present application may include the following steps:

[0148] S201, data collection and pipeline processing.

[0149] Data collection and stream processing involves acquiring individual user behavior data and segmenting it into specific time intervals. Specifically, stream processing technologies such as Kafka (an open source stream processing platform) and Flink (an open source stream processing framework) can be used to achieve real-time collection and processing of user behavior data.

[0150] S202, sliding window sampling.

[0151] Sliding or tumbling window sampling strategies can be used to extract samples from different time windows. Distributed databases (such as HBase) and distributed computing frameworks (such as Spark) can be used for efficient data sampling. Furthermore, this application can use time series analysis methods (such as moving average and exponential smoothing) to ensure the smoothness and representativeness of the sampled data. This allows for analysis of user behavior patterns based on trend changes in historical data.

[0152] Specifically, the behavioral sliding time window strategy refers to dynamically adjusting the time span of training data and dynamically selecting user behavior data in a sliding window manner, which can include the latest user behavior data as well as representative historical data. This strategy automatically samples and updates the model's training data over time, ensuring that the trained model can reflect the user's current interest trends. In specific implementation, the data can be divided into short-term, medium-term, and long-term periodic data. The time window of periodic data can be divided into: 0 to N days as a short-term time window, N to M days as a medium-term time window, and M to P days as a long-term time window.

[0153] S201-S202 correspond to the above S101, and the sliding time window corresponds to the above specified time interval.

[0154] In search scenarios, user search, click, and viewing behavior data is stored in HBase on an hourly basis using data collection and pipeline processing technologies such as Kafka and Flink. Using a sliding time window, short-term, medium-term, and long-term data are extracted from the HBase database as candidate data. For example, for data within 1-180 days, data from 1-7 days is considered short-term candidate data, data from 7-14 days is considered medium-term candidate data, and data from 14-180 days is considered long-term candidate data.

[0155] S203: Perform data fusion according to the screening conditions.

[0156] According to the short video search scenario and actual needs, the conditions for data screening in different periods are specifically defined. Through the screening conditions, the candidate data in different periods are dynamically introduced into the sample pool. The specific screening conditions are controlled by the number of times Q that the user search term appears. The parameter Q is set to control which candidate data can enter the sample pool. Specifically, for short-term candidate data, in order to ensure that the user's interest evolution can be dynamically tracked, all candidate data are usually added to the sample pool. This implementation method corresponds to the above-mentioned step of selecting each user behavior data in the specified time interval according to the data selection method that matches the specified time interval for each specified time interval.

[0157] For mid-term data, you can set the number of mid-term candidate data that enter the sample pool.

[0158] For long-term data, you can set the number of long-term candidate data that enter the sample pool.

[0159] This dynamic sample introduction mechanism can avoid the problems of time-consuming training with huge amounts of data and long time intervals between online launches. At the same time, it can ensure that diverse samples can be effectively utilized and improve the model's ability to perceive diverse samples.

[0160] The sampling strategy of S202 - S203 corresponds to the above S102 , and the time window corresponds to the above specified time interval.

[0161] S204, data preprocessing and dynamic feature selection.

[0162] User behavior data from different time periods is weighted and integrated. A weighting strategy is used to enhance the influence of short-term data while retaining representative long-term data, forming a comprehensive training dataset. Short-term data is weighted alpha, medium-term data is weighted beta, and long-term data is weighted gamma. Samples in the sample pool are subsampled using weights for different time periods. Sample quality is considered during the sampling process. Samples within each period are sorted by quality score, and a weighted number of samples for that period are selected as the final model training samples. Sample quality is not limited by period; valid plays are used as the standard. For example, if a video duration <= 1 minute is considered valid, a play duration > 6 seconds is considered valid; if the video duration is 1 minute <= 20 minutes, a play duration > video duration * 10% is considered valid; and if the video duration is > 20 minutes, a play duration > 2 minutes is considered valid. For example, if a user watches videos doc1 and doc2 under search term "A," and doc1 is considered a valid play while doc2 is not, doc1 will be prioritized as training data. Finally, the alpha* short-term data + beta* medium-term data + gamma* long-term data are processed and feature selected before being fed into the model for training. In practical scenarios, a strategy of alpha = beta = gamma = 1 can be used.

[0163] S204 corresponds to the step of determining sample user behavior data from the selected user behavior data. The short-term data weight alpha, the medium-term data weight beta, and the long-term data weight gamma correspond to the predetermined ratios. This embodiment can enhance the influence of short-term data while retaining representative long-term data by controlling the selected user behavior data of different time periods.

[0164] S205, model training.

[0165] The method for constructing the training set in this implementation corresponds to S103 above. For example, under the search term "A", a search behavior displays N videos to the user. If the user clicks on the N_1th video and watches it for more than S seconds, a positive sample is generated based on the N_1th video, and negative samples are generated based on other samples that were displayed but not clicked.

[0166] S206, model evaluation and verification.

[0167] The present application can use conventional methods to train the model using the training set. For example, the sample features in the training set can be divided into a target test set and a target training set. The target training set can then be used to train the model, and the model parameters can be adjusted through backpropagation to ultimately obtain a trained model. The target test set can then be used to evaluate the performance of the model, ultimately obtaining a video recommendation model with trained model performance that meets the requirements.

[0168] S207, model deployment.

[0169] The trained video recommendation model can be deployed online, so that videos that are personalized to the user can be recommended based on the user's search for the search term.

[0170] S208, real-time recommendation.

[0171] Personalized content can be recommended to users.

[0172] In a specific implementation, the process of recommending videos to users may include:

[0173] In response to a target search term of a target user, determining candidate videos that match the target search term;

[0174] Generate model input content using the video description features of each candidate video, the user description features of the target user, and the search term;

[0175] Inputting each model input content into a target recommendation model trained with a training set obtained by using any of the training set construction methods described above, so that the target recommendation model outputs a recommendation score for each candidate video;

[0176] Determine each recommended video based on the obtained recommendation score of each candidate video;

[0177] Recommend each recommended video to the target user.

[0178] Based on specific search scenarios and actual needs, we defined data screening criteria and developed a dynamic sample introduction mechanism for data from different periods to ensure effective utilization of samples from different periods and improve the model's ability to perceive data from different periods. We also used a sliding time window sampling strategy to ensure that the trained model reflects users' current interests. We also used a weighted data fusion strategy to perform a weighted fusion of data from different time windows. By adjusting the weights, we increased the influence of short-term data while retaining representative long-term data, improving the model's generalization capabilities.

[0179] Based on the above-mentioned embodiment of the training set construction method, the embodiment of the present application also provides a training set construction device. Figure 3 A schematic diagram of the structure of a training set construction device provided in an embodiment of the present disclosure is shown in FIG. Figure 3 As shown, the training set construction device may include:

[0180] The determination module 301 is configured to determine a plurality of designated time intervals, wherein the plurality of designated time intervals include a target time interval with the current time as the end time;

[0181] The selection module 302 is configured to select user behavior data from each piece of user behavior data within each specified time interval to obtain at least one piece of user behavior data; wherein the selection weight of the user behavior data is positively correlated with the expected contribution of the user behavior data within the specified time interval to model training; the user behavior data within the target specified time interval is set to have the greatest expected contribution to model training;

[0182] The generation module 303 is used to generate a training set for training a video recommendation model based on the selected user behavior data. The embodiment of the present application provides a training set construction method. When generating a training set, based on the expected contribution of user behavior data in each specified time interval to model training, user behavior data is selected from each specified time interval according to the selection ratio of the specified time interval. This can effectively streamline the amount of user behavior data while ensuring the diversity of the time periods to which the user behavior data used to construct the training set belongs, so that the efficiency of training the model using the data set constructed by the selected user behavior data is high. Since the expected contribution of each specified time interval is set in the present application, the limited number of user behavior data selected meets the data requirements for each specified time interval during model training. Since recent behavior data can better reflect the user's interests, the expected contribution of the target specified time interval is set to the maximum, which can increase the contribution of recent behavior data to model training. Therefore, the model trained using the data set constructed by the selected user behavior data has a high degree of match between the recommended content and the user's interests. It can be seen that the solution of the present application provides a data foundation for balancing the training efficiency of the model and the recommendation accuracy of the model.

[0183] Optionally, the generating module includes:

[0184] a determining unit, configured to determine sample user behavior data from the selected pieces of user behavior data; wherein the sample user behavior data at least includes user behavior data whose recorded viewing time is greater than a first specified time;

[0185] A generating unit is used to generate a training set for training a video recommendation model based on the sample user behavior data.

[0186] Optionally, the generating unit includes:

[0187] A construction subunit is used to construct a training set containing positive sample features and negative sample features for training a video recommendation model based on the sample user behavior data and in accordance with a predetermined positive sample feature construction method and a negative sample feature construction method;

[0188] The positive sample feature construction method includes: for each user behavior data in the sample user behavior data, constructing a positive sample feature based on at least a description feature of a video recorded by the user behavior data;

[0189] The negative sample feature construction method includes: for each user behavior data in the sample user behavior data, determining the target user to which the user behavior data belongs and the target search term recorded by the user behavior data; determining the videos recommended when the target user searches using the target search term; from the various videos, determining the videos that the target user has not played; for each determined video, constructing a negative sample feature based at least on the descriptive features of the video.

[0190] The selection module includes:

[0191] a selection unit configured to, for each designated time interval, select all pieces of user behavior data from each piece of user behavior data within the designated time interval in response to the designated time interval being the target designated time interval;

[0192] a dividing unit configured to, in response to the designated time interval not being a target designated time interval, divide the user behavior data recorded with the same search term within the designated time interval into a group of user behavior data; and

[0193] For each group of user behavior data obtained by the division, select user behavior data from the group of user behavior data according to the selection proportion corresponding to the specified time interval;

[0194] For any two specified time intervals other than the target specified time interval, the selection proportion corresponding to the specified time interval whose represented time is closer to the current time is greater than the selection proportion corresponding to the specified time interval whose represented time is farther from the current time; the selection proportion of each specified time interval is negatively correlated with the span of the time corresponding to the specified time interval from the current time.

[0195] Optionally, the division unit includes:

[0196] A sorting subunit is used to sort each piece of user behavior data in the set of user behavior data in a descending order of data recording time to obtain a sorting sequence;

[0197] The first selection subunit is configured to select the top-ranked user behavior data from the obtained ranking sequence according to the selection proportion corresponding to the specified time interval.

[0198] Optionally, the determining unit includes:

[0199] A first determining subunit is configured to determine, from the selected pieces of user behavior data, user behavior data whose recorded viewing time is greater than a first specified time, to obtain first-category user behavior data;

[0200] a second determining subunit, configured to determine, from the selected pieces of user behavior data, user behavior data whose recorded viewing duration is not greater than a first specified duration, and cluster the determined user behavior data according to the specified time interval to obtain at least one clustering result;

[0201] a second selection subunit configured to, for each clustering result, select, from the clustering result, a predetermined proportion of user behavior data corresponding to the clustering result to obtain a selection result, and select, from the selection result, user behavior data with a recorded viewing duration greater than a second specified duration to obtain second-category user behavior data; wherein the predetermined proportion corresponding to the clustering result is a predetermined proportion set for the specified time interval to which the user behavior data in the clustering result belongs;

[0202] The third determining subunit is configured to determine sample user behavior data based on the obtained first category user behavior data and second category user behavior data.

[0203] The second selection subunit is specifically configured to:

[0204] For each clustering result, determining an interest quality evaluation value for each user behavior data in the clustering result; wherein the interest quality evaluation value is used to represent the user's interest in the video and is positively correlated with the viewing time recorded in the user behavior data;

[0205] Sort the user behavior data in the clustering result according to the interest quality evaluation value from high to low to obtain a sorted sequence;

[0206] From the obtained sorting sequence, user behavior data with a higher sorting order is selected according to a predetermined ratio corresponding to the clustering result to obtain a selection result corresponding to the clustering result.

[0207] The negative sample feature construction method further includes:

[0208] For each piece of user behavior data selected, other than the sample user behavior data, a negative sample feature is constructed based at least on a description feature of the video recorded by the user behavior data.

[0209] The method of constructing negative sample features is the same as in the above embodiment and will not be described in detail here.

[0210] The present application also provides an electronic device, such as Figure 4 As shown, it includes a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404.

[0211] Memory 403, used for storing computer programs;

[0212] The processor 401 is configured to implement any of the above-mentioned training set construction methods when executing the program stored in the memory 403.

[0213] The communication bus mentioned in the terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.

[0214] The communication interface is used for communication between the above terminal and other devices.

[0215] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.

[0216] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0217] In another embodiment provided in the present application, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the training set construction method described in any of the above embodiments is implemented.

[0218] In another embodiment provided by the present application, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute the training set construction method described in any one of the above embodiments.

[0219] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

[0220] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants 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.

[0221] Each embodiment in this specification is described in a related manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.

[0222] The above description is only a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the scope of protection of the present application.

Claims

1. A training set construction method, characterized in that: The method comprises: Determine a plurality of designated time intervals; wherein the plurality of designated time intervals include a target designated time interval with the current time as the end time; For each designated time interval, user behavior data is selected from each piece of user behavior data within the designated time interval to obtain at least one piece of user behavior data; wherein a selection weight of the user behavior data selection is positively correlated with an expected contribution of the user behavior data within the designated time interval to model training; the user behavior data within the target designated time interval is set to have the greatest expected contribution to model training; Based on the selected user behavior data, a training set for training the video recommendation model is generated.

2. The method according to claim 1, characterized in that The step of generating a training set for training a video recommendation model based on the selected user behavior data includes: Determining sample user behavior data from the selected user behavior data; wherein the sample user behavior data at least includes: user behavior data whose recorded viewing time is greater than a first specified time; Based on the sample user behavior data, a training set for training a video recommendation model is generated.

3. The method according to claim 2, characterized in that Based on the sample user behavior data, a training set for training a video recommendation model is generated, including: Based on the sample user behavior data, a training set including positive sample features and negative sample features for training a video recommendation model is constructed according to a predetermined positive sample feature construction method and a negative sample feature construction method; The positive sample feature construction method includes: for each user behavior data in the sample user behavior data, constructing a positive sample feature based on at least a description feature of a video recorded by the user behavior data; The negative sample feature construction method includes: for each user behavior data in the sample user behavior data, determining the target user to which the user behavior data belongs and the target search term recorded by the user behavior data; determining the videos recommended when the target user searches using the target search term; from the various videos, determining the videos that the target user has not played; for each determined video, constructing a negative sample feature based at least on the descriptive features of the video.

4. The method according to any one of claims 1 to 3, characterized in that: For each specified time interval, user behavior data is selected from each piece of user behavior data within the specified time interval to obtain at least one piece of user behavior data, including: For each designated time interval, in response to the designated time interval being the target designated time interval, selecting all user behavior data from each piece of user behavior data within the designated time interval; In response to the designated time interval not being a target designated time interval, dividing the user behavior data recorded with the same search term within the designated time interval into a group of user behavior data; and For each group of user behavior data obtained by the division, select user behavior data from the group of user behavior data according to the selection proportion corresponding to the specified time interval; For any two specified time intervals other than the target specified time interval, the selection proportion corresponding to the specified time interval whose represented time is closer to the current time is greater than the selection proportion corresponding to the specified time interval whose represented time is farther from the current time; the selection proportion of each specified time interval is negatively correlated with the span of the time corresponding to the specified time interval from the current time.

5. The method according to claim 4, characterized in that From the set of user behavior data, user behavior data is selected according to the selection proportion corresponding to the specified time interval, including: Sort each piece of user behavior data in the set of user behavior data by sorting the data record time from recent to oldest to obtain a sorted sequence; From the obtained sorting sequence, the user behavior data with the highest sorting is selected according to the selection proportion corresponding to the specified time interval.

6. The method according to any one of claims 2-3, characterized in that: Determining sample user behavior data from the selected pieces of user behavior data includes: Determine, from the selected pieces of user behavior data, user behavior data whose recorded viewing duration is greater than a first specified duration, to obtain first-category user behavior data; Determining, from the selected pieces of user behavior data, user behavior data whose recorded viewing duration is no longer than a first specified duration, clustering the determined user behavior data according to the specified time interval to obtain at least one clustering result; For each clustering result, selecting a predetermined proportion of user behavior data corresponding to the clustering result from the clustering result to obtain a selected result, and selecting user behavior data with a recorded viewing duration greater than a second specified duration from the selected result to obtain second-category user behavior data; wherein the predetermined proportion corresponding to the clustering result is a predetermined proportion set for the specified time interval to which the user behavior data in the clustering result belongs; Based on the obtained first category user behavior data and second category user behavior data, sample user behavior data is determined.

7. The method according to claim 6, characterized in that For each clustering result, selecting a predetermined proportion of user behavior data corresponding to the clustering result from the clustering result, and obtaining the selected result includes: For each clustering result, determining an interest quality evaluation value for each user behavior data in the clustering result; wherein the interest quality evaluation value is used to represent the user's interest in the video and is positively correlated with the viewing time recorded in the user behavior data; Sort the user behavior data in the clustering result according to the interest quality evaluation value from high to low to obtain a sorted sequence; From the obtained sorting sequence, user behavior data with a higher sorting order is selected according to a predetermined ratio corresponding to the clustering result to obtain a selection result corresponding to the clustering result.

8. The method according to claim 3, characterized in that The negative sample feature construction method further includes: For each piece of user behavior data selected, other than the sample user behavior data, a negative sample feature is constructed based at least on a description feature of the video recorded by the user behavior data.

9. A training set construction device, characterized in that: The device comprises: a determination module, configured to determine a plurality of designated time intervals; wherein the plurality of designated time intervals include a target time interval with the current time as the end time; a selection module configured to select, for each specified time interval, user behavior data from each piece of user behavior data within the specified time interval to obtain at least one piece of user behavior data; wherein a weight of the selected user behavior data is positively correlated with an expected contribution of the user behavior data within the specified time interval to model training; and the user behavior data within the target specified time interval is set to have the greatest expected contribution to model training; The generation module is used to generate a training set for training a video recommendation model based on the selected user behavior data.

10. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory for storing computer programs; A processor, configured to implement the method according to any one of claims 1 to 8 when executing a program stored in a memory.

11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.