Video recommendation model training method, video recommendation method, device, and storage medium

By pre-training and parameter tuning of the video recommendation model, and utilizing unlabeled video samples and user feedback, the problem of poor recommendation results in existing models has been solved, achieving higher-quality video recommendations.

CN117669687BActive Publication Date: 2026-07-28TENCENT MUSIC ENTERTAINMENT TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT MUSIC ENTERTAINMENT TECH (SHENZHEN) CO LTD
Filing Date
2023-12-11
Publication Date
2026-07-28

AI Technical Summary

Technical Problem

Existing video recommendation models struggle to quickly acquire videos that match the user's preferences, resulting in poor recommendation quality.

Method used

The semantic feature extraction module in the initial video recommendation model is pre-trained using multiple unlabeled video samples. The semantic features of video retrieval prompts are obtained through the semantic feature extraction module, and the model parameters are adjusted according to user feedback behavior until the training termination condition is met, resulting in a trained video recommendation model.

Benefits of technology

By fully utilizing large-scale video data and user feedback, the semantic understanding ability of the video recommendation model and the adaptability of the recommendation results were improved, thereby enhancing the quality of the recommended videos.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117669687B_ABST
    Figure CN117669687B_ABST
Patent Text Reader

Abstract

The application relates to a video recommendation model training method, a video recommendation method, equipment and a storage medium, relates to the technical field of video recommendation, and can improve the quality of a video recommendation result. The method comprises the following steps: using a plurality of unlabeled video samples to pre-train a semantic feature extraction module in an initial video recommendation model, so as to obtain a pre-trained video recommendation model; inputting a video search prompt of a user into the pre-trained video recommendation model, acquiring semantic features corresponding to the video search prompt through the semantic feature extraction module, and providing a recommended video to the user according to the semantic features corresponding to the video search prompt and a video recommendation strategy provided by the pre-trained video recommendation model; and adjusting parameters of the pre-trained video recommendation model according to feedback behaviors of the user on the recommended video until a training end condition is met, so as to obtain a trained video recommendation model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the development of computer technology and the increasing popularity of video applications, the number of videos on the Internet has exploded. In related technologies, to enable users to quickly browse content they are interested in or interested in, models can be trained based on a large number of labeled samples, and the trained models can then be used for video retrieval and recommendation.

[0003] However, models trained in the above manner often struggle to quickly acquire videos that are suitable for users, resulting in poor video recommendation quality. Summary of the Invention

[0004] Therefore, it is necessary to provide a video recommendation model training method, video recommendation method, computer equipment, and storage medium that can improve the quality of video recommendation results, addressing the aforementioned technical problems.

[0005] Firstly, this application provides a method for training a video recommendation model. The method includes:

[0006] By using multiple unlabeled video samples, the semantic feature extraction module in the initial video recommendation model is pre-trained to obtain a pre-trained video recommendation model.

[0007] The user's video search suggestions are input into the pre-trained video recommendation model. The semantic feature extraction module obtains the semantic features corresponding to the video search suggestions. Based on the semantic features corresponding to the video search suggestions and the video recommendation strategy provided by the pre-trained video recommendation model, recommended videos are provided to the user.

[0008] Based on the user's feedback on the recommended videos, the parameters of the pre-trained video recommendation model are adjusted until the training termination condition is met, resulting in a well-trained video recommendation model.

[0009] In one embodiment, providing recommended videos to the user based on the semantic features corresponding to the video retrieval prompt and the video recommendation strategy provided by the pre-trained video recommendation model includes:

[0010] Based on the similarity between the semantic features corresponding to the video retrieval prompt and the semantic features of each pre-acquired candidate video, multiple recommended videos related to the video retrieval prompt are determined from multiple candidate videos; the semantic features of the candidate videos are obtained by feature extraction of each candidate video through the semantic feature extraction module;

[0011] The pre-trained video recommendation model sorts the multiple recommended videos according to the video recommendation strategy and provides the sorted multiple recommended videos to the user.

[0012] In one embodiment, adjusting the parameters of the pre-trained video recommendation model based on the user's feedback behavior on the recommended video until the training termination condition is met to obtain a trained video recommendation model includes:

[0013] Based on the user's feedback behavior on the sorted recommended videos, the video browsing data of the user for each recommended video is obtained;

[0014] Using a pre-acquired reward function, the video browsing data is converted into reward values ​​for the corresponding recommended videos;

[0015] The parameters of the pre-trained video recommendation model are adjusted according to the corresponding reward value of each recommended video.

[0016] Based on the video recommendation strategy currently provided by the video recommendation model after parameter adjustment, recommended videos are provided to the user again until the training termination condition is met, thus obtaining a trained video recommendation model.

[0017] In one embodiment, the step of providing recommended videos to the user again based on the video recommendation strategy currently provided by the parameter-adjusted video recommendation model includes:

[0018] Based on the video recommendation strategy currently provided by the video recommendation model with adjusted parameters, the multiple recommended videos are rearranged, and the rearranged multiple recommended videos are provided to the user.

[0019] In one embodiment, the step of pre-training the semantic feature extraction module in the initial video recommendation model using multiple unlabeled video samples includes:

[0020] Obtain multiple unlabeled video samples; each unlabeled video sample includes a video and video text paired with the video.

[0021] The unlabeled video samples are input into the initial video recommendation model, and the semantic feature extraction module in the initial video recommendation model extracts features from the video to obtain video semantic features, and extracts features from the video text to obtain text semantic features;

[0022] The semantic feature extraction module is trained unsupervised based on the video semantic features and text semantic features corresponding to each unlabeled video sample.

[0023] In one embodiment, the step of performing unsupervised training on the semantic feature extraction module based on the video semantic features and text semantic features corresponding to each of the unlabeled video samples includes:

[0024] For each video, based on the similarity between the video semantic features corresponding to the video and the semantic features of each text, predictive paired texts that match the video are determined from all video texts;

[0025] For each unlabeled video sample, determine the similarity between the video semantic features corresponding to the unlabeled video sample and the text semantic features corresponding to the unlabeled video sample;

[0026] Based on the difference between the predicted paired text of each video and the paired video text, and the similarity between the video semantic features and the text semantic features, a model loss value is determined, and the module parameters of the semantic feature extraction module are adjusted based on the model loss value.

[0027] In one embodiment, the plurality of unlabeled video samples includes unlabeled video samples in which some video frames or some text characters are masked.

[0028] The step of determining the model loss value based on the difference between the predicted paired text of each video and the paired video text, and the similarity between the video semantic features and the text semantic features, includes:

[0029] Based on the video semantic features, the hidden video frames are predicted to obtain the predicted video frames; and based on the text semantic features, the hidden text characters are predicted to obtain the predicted text characters.

[0030] The model loss value is determined based on the differences between the predicted video frame and the hidden video frame, the differences between the predicted text characters and the hidden text characters, the differences between the predicted paired text of the video and the paired video text, and the similarity between the video semantic features and the text semantic features.

[0031] Secondly, this application also provides a video recommendation method. The method includes:

[0032] Obtain a video recommendation request for the user; the video recommendation request carries a target video search suggestion;

[0033] The target video retrieval prompt is input into the video recommendation model corresponding to the user, and the output of the video recommendation model is used as the video recommendation result;

[0034] The video recommendation model corresponding to the user is pre-trained according to the video recommendation model training method described in any of the above items.

[0035] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0036] By using multiple unlabeled video samples, the semantic feature extraction module in the initial video recommendation model is pre-trained to obtain a pre-trained video recommendation model.

[0037] The user's video search suggestions are input into the pre-trained video recommendation model. The semantic feature extraction module obtains the semantic features corresponding to the video search suggestions. Based on the semantic features corresponding to the video search suggestions and the video recommendation strategy provided by the pre-trained video recommendation model, recommended videos are provided to the user.

[0038] Based on the user's feedback on the recommended videos, the parameters of the pre-trained video recommendation model are adjusted until the training termination condition is met, resulting in a well-trained video recommendation model.

[0039] Fourthly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0040] Obtain a video recommendation request for the user; the video recommendation request carries a target video search suggestion;

[0041] The target video retrieval prompt is input into the video recommendation model corresponding to the user, and the output of the video recommendation model is used as the video recommendation result;

[0042] The video recommendation model corresponding to the user is pre-trained according to the video recommendation model training method described in any of the above items.

[0043] Fifthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0044] By using multiple unlabeled video samples, the semantic feature extraction module in the initial video recommendation model is pre-trained to obtain a pre-trained video recommendation model.

[0045] The user's video search suggestions are input into the pre-trained video recommendation model. The semantic feature extraction module obtains the semantic features corresponding to the video search suggestions. Based on the semantic features corresponding to the video search suggestions and the video recommendation strategy provided by the pre-trained video recommendation model, recommended videos are provided to the user.

[0046] Based on the user's feedback on the recommended videos, the parameters of the pre-trained video recommendation model are adjusted until the training termination condition is met, resulting in a well-trained video recommendation model.

[0047] Sixthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0048] Obtain a video recommendation request for the user; the video recommendation request carries a target video search suggestion;

[0049] The target video retrieval prompt is input into the video recommendation model corresponding to the user, and the output of the video recommendation model is used as the video recommendation result;

[0050] The video recommendation model corresponding to the user is pre-trained according to the video recommendation model training method described in any of the above items.

[0051] Seventhly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0052] By using multiple unlabeled video samples, the semantic feature extraction module in the initial video recommendation model is pre-trained to obtain a pre-trained video recommendation model.

[0053] The user's video search suggestions are input into the pre-trained video recommendation model. The semantic feature extraction module obtains the semantic features corresponding to the video search suggestions. Based on the semantic features corresponding to the video search suggestions and the video recommendation strategy provided by the pre-trained video recommendation model, recommended videos are provided to the user.

[0054] Based on the user's feedback on the recommended videos, the parameters of the pre-trained video recommendation model are adjusted until the training termination condition is met, resulting in a well-trained video recommendation model.

[0055] Eighthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0056] Obtain a video recommendation request for the user; the video recommendation request carries a target video search suggestion;

[0057] The target video retrieval prompt is input into the video recommendation model corresponding to the user, and the output of the video recommendation model is used as the video recommendation result;

[0058] The video recommendation model corresponding to the user is pre-trained according to the video recommendation model training method described in any of the above items.

[0059] The aforementioned video recommendation model training method, video recommendation method, computer equipment, and storage medium can utilize multiple unlabeled video samples to pre-train the semantic feature extraction module in the initial video recommendation model, resulting in a pre-trained video recommendation model. Then, user video search suggestions can be input into the pre-trained video recommendation model. The semantic feature extraction module obtains the semantic features corresponding to the video search suggestions, and based on these semantic features and the video recommendation strategy provided by the pre-trained model, recommended videos are offered to the user. Furthermore, the parameters of the pre-trained model can be adjusted based on user feedback on the recommended videos until the training termination condition is met, resulting in a well-trained video recommendation model. In this embodiment, on the one hand, by training the semantic feature extraction module in the video recommendation model using multiple unlabeled video samples, it is possible to fully utilize and mine large-scale video data, enabling the semantic feature extraction module to learn rich semantic information and acquire excellent basic representation capabilities. This allows it to accurately understand the semantics of video retrieval prompts and provide recommended videos. On the other hand, by adjusting the parameters of the pre-trained video recommendation model based on user feedback behavior towards recommended videos, it is possible to obtain a recommendation method that suits the user and obtain matching recommended videos using a small amount of user feedback data, thereby efficiently improving the quality of recommended videos. Attached Figure Description

[0060] Figure 1 This is a flowchart illustrating a video recommendation model training method in one embodiment;

[0061] Figure 2 This is a flowchart illustrating one step in adjusting the parameters of a video recommendation model in one embodiment;

[0062] Figure 3 This is a schematic diagram of a reinforced chemical architecture in one embodiment;

[0063] Figure 4 This is a schematic diagram of the structure of a semantic feature extraction module in one embodiment;

[0064] Figure 5 This is a flowchart illustrating a video recommendation method in one embodiment;

[0065] Figure 6 This is a schematic diagram of a training video recommendation model in one embodiment;

[0066] Figure 7 This is an internal structural diagram of a computer device in one embodiment;

[0067] Figure 8 This is an internal structural diagram of another computer device in one embodiment. Detailed Implementation

[0068] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0069] In one embodiment, such as Figure 1 As shown, a video recommendation model training method is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, or to a system including both a terminal and a server, and implemented through the interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, etc.; the server can be a standalone server or a server cluster consisting of multiple servers.

[0070] In this embodiment, the method includes the following steps:

[0071] S101. Using multiple unlabeled video samples, the semantic feature extraction module in the initial video recommendation model is pre-trained to obtain a pre-trained video recommendation model.

[0072] The semantic feature extraction module provides basic representation capabilities for video content. For example, it can extract features from the video to obtain semantic features that express the semantics of the video. Furthermore, the semantic feature extraction module can understand the mapping relationship between video and text in the feature space. When receiving relevant text, it can determine the corresponding semantic features in the feature space of the video based on the semantic features of the text in the feature space.

[0073] In this step, multiple unlabeled video samples can be pre-acquired. Unlabeled video samples can be understood as video samples without manually labeled information. In some optional embodiments, a large number of videos and related information can be crawled from video applications or video platforms. Both the videos and related information can be directly obtained from the video applications or video platforms, and the crawled videos and related information can then be used as unlabeled video samples. In specific implementations, hundreds of millions or more unlabeled video samples can be crawled.

[0074] After obtaining multiple unlabeled video samples, the initial video recommendation model can be further trained unsupervised using these samples. More specifically, this step utilizes multiple unlabeled video samples to perform unsupervised pre-training of the semantic feature extraction module. In this embodiment, using unlabeled video samples for pre-training saves manual annotation time and fully utilizes and mines large-scale video data from the internet. During pre-training, the semantic feature extraction module learns rich semantic representations, as well as the features and structures of these representations, based on a large number of video samples. This results in a general feature pattern for video semantics, effectively strengthening the module's ability to acquire accurate semantic features and providing strong support for the video recommendation model to perform subsequent tasks.

[0075] S102, the user's video search prompts are input into the pre-trained video recommendation model. The semantic feature extraction module obtains the semantic features corresponding to the video search prompts. Based on the semantic features corresponding to the video search prompts and the video recommendation strategy provided by the pre-trained video recommendation model, recommended videos are provided to the user.

[0076] Specifically, after pre-training on a large number of unlabeled video samples, the pre-trained video recommendation model can accurately perform semantic understanding and determine the semantic features of the videos. While the pre-trained model can be used for video retrieval and recommendation, the results may not meet the needs of some users. For example, the model might retrieve relevant videos and then rank them according to factors such as video popularity and interaction frequency (e.g., likes) before recommending them to users. However, in this application, the recommendations obtained in this way may not meet the needs of some users.

[0077] In this embodiment, the pre-trained video recommendation model can be further fine-tuned using reinforcement learning. Specifically, video search suggestions associated with the user can be obtained. In some embodiments, these video search suggestions can be provided by the user in real time, or determined by the terminal based on the user's historical behavior. For example, the user can input video search suggestions in the search suggestion input area, and subsequent processing can be performed based on the currently input video search suggestions. Alternatively, video search suggestions can be obtained based on the videos the user has previously viewed or their video search history. In some embodiments, the video search suggestions can be videos or text.

[0078] After obtaining video search suggestions, the suggestions can be input into a pre-trained video recommendation model. The semantic feature extraction module in the video recommendation model can then extract the semantic features of the video search suggestions to obtain the corresponding semantic features.

[0079] On the other hand, the pre-trained video recommendation model can also provide a video recommendation strategy, which can be understood as a method of recommending videos. For example, it can include a recommendation method used when recommending videos to users, such as a video ranking method. In some optional embodiments, the video recommendation model can include a strategy providing unit for providing the video recommendation strategy, which may be part of the semantic feature extraction module.

[0080] Furthermore, the pre-trained video recommendation model can retrieve relevant videos by using the semantic features corresponding to the video retrieval prompts, determine the video recommendation strategy currently provided by the video recommendation model, and then provide recommended videos to users based on the video recommendation strategy and the identified relevant videos.

[0081] S103, adjust the parameters of the pre-trained video recommendation model based on user feedback on recommended videos until the training termination condition is met, and obtain the trained video recommendation model.

[0082] After recommending videos to users, each user will exhibit corresponding feedback behavior. For example, for a recommended video, a user can choose to either browse the recommended video or not. Furthermore, the browsing behavior of recommended videos can be further refined based on the user's browsing history.

[0083] In this step, after providing recommended videos to users, feedback behavior of the same user on the recommended videos can be obtained. Based on the user's feedback behavior, it can be predicted whether the recommended videos are suitable for the user's focus or interests. Thus, the parameters of the pre-trained video recommendation model can be adjusted according to the feedback behavior. During the parameter adjustment process, the video recommendation strategy provided by the video recommendation model can be gradually adapted to the current user, increasing the fit between the obtained recommended videos and the user.

[0084] In this embodiment, multiple unlabeled video samples can be used to pre-train the semantic feature extraction module in the initial video recommendation model, resulting in a pre-trained video recommendation model. Then, user video search prompts can be input into the pre-trained model. The semantic feature extraction module extracts the semantic features corresponding to the video search prompts, and based on these features and the video recommendation strategy provided by the pre-trained model, recommended videos are offered to the user. Furthermore, the parameters of the pre-trained model can be adjusted based on user feedback on the recommended videos until the training termination condition is met, resulting in a well-trained video recommendation model. In this embodiment, on the one hand, by using multiple unlabeled video samples to train the semantic feature extraction module in the video recommendation model, large-scale video data can be fully utilized and mined, enabling the semantic feature extraction module to learn rich semantic information and acquire excellent basic representation capabilities. This allows it to accurately understand the semantics of video search prompts and provide recommended videos. On the other hand, by adjusting the parameters of the pre-trained model based on user feedback on the recommended videos, a recommendation method adapted to the user can be obtained using a small amount of user feedback data, resulting in matched recommended videos and thus efficiently improving the quality of recommended videos.

[0085] In one embodiment, step S102, which involves providing recommended videos to the user based on the semantic features corresponding to the video retrieval prompts and the video recommendation strategy provided by the pre-trained video recommendation model, may include the following steps:

[0086] Based on the similarity between the semantic features corresponding to the video retrieval prompt and the semantic features of each pre-acquired candidate video, multiple recommended videos related to the video retrieval prompt are determined from multiple candidate videos; the pre-trained video recommendation model sorts the multiple recommended videos according to the video recommendation strategy and provides the sorted multiple recommended videos to the user.

[0087] The semantic features of the candidate videos are obtained by extracting features from each candidate video through the semantic feature extraction module.

[0088] Specifically, after obtaining the pre-trained video recommendation model, its semantic feature extraction model has acquired excellent basic representation capabilities based on a large number of unlabeled video samples. It can accurately understand the semantics of the video and obtain the corresponding semantic features. In this embodiment, the semantic feature extraction module in the pre-trained video recommendation model can obtain the semantic features of each candidate video in the video library, i.e., the candidate video semantic features. For example, candidate videos can be input into the pre-trained video recommendation model, and the semantic feature extraction model can determine the corresponding candidate video semantic features. Then, the semantic features of each candidate video can be pre-stored.

[0089] After obtaining the video search prompts and their corresponding semantic features, the semantic features corresponding to the video search prompts can be compared with the semantic features of each candidate video obtained in advance to obtain the similarity between the semantic features corresponding to the video search prompts and the semantic features of each candidate video. Then, based on the similarity, related videos can be searched among multiple candidate videos to obtain multiple recommended videos related to the video search prompts.

[0090] In some embodiments, the semantic features output by the semantic feature extraction module are embedding vectors. These vectors can be dense vectors that include information in multiple dimensions, which can accurately and meticulously express the semantics of the video. When determining the similarity between the semantic features corresponding to the video retrieval prompt and the semantic features of the candidate video, the similarity between the two semantic features can be obtained, for example, by calculating the cosine similarity.

[0091] In some embodiments, when determining multiple related recommended videos based on similarity, if the video search prompt is a video (such as a video that the user has watched), then the candidate videos with similarity within a preset numerical range can be used as recommended videos, while the candidate videos with similarity higher than the upper limit of the preset numerical range can be filtered out. This provides a variety of videos while achieving video deduplication, accurately locating videos with highly repetitive content, and effectively filtering videos with overly similar content.

[0092] After receiving multiple recommended videos, due to the limited area for displaying recommended video information on the terminal display interface, it may be impossible to display multiple recommended videos (such as all recommended videos) at once. In addition, within the same display interface, users may pay different attention to the content displayed in different areas, affecting the likelihood of users browsing recommended videos.

[0093] In response, a pre-trained video recommendation model can determine the current video recommendation strategy, which can indicate the display order of recommended videos so that users can browse videos that they may be interested in or follow first. Then, multiple recommended videos can be sorted according to the video recommendation strategy to obtain sorted recommended videos and provide them to users.

[0094] In this embodiment, on the one hand, by comparing the semantic features corresponding to the video retrieval prompts with the semantic features of the candidate videos, multiple related recommended videos can be accurately obtained based on the excellent basic representation capabilities of the semantic feature extraction module. On the other hand, by sorting the multiple recommended videos according to the video recommendation strategy, users can browse the videos they are interested in first, thereby improving the quality of the video recommendation results.

[0095] In one embodiment, such as Figure 2 As shown, step S103 involves adjusting the parameters of the pre-trained video recommendation model based on user feedback on the recommended videos until the training termination condition is met, resulting in a trained video recommendation model. This includes:

[0096] S201: Based on the user's feedback behavior on the sorted recommended videos, obtain the user's video browsing data for each recommended video.

[0097] In this embodiment, the video recommendation model can be fine-tuned using reinforcement learning. Specifically, as follows: Figure 3 As shown, the video recommendation model can be viewed as an agent, and the user as an environment. An agent is an entity that can observe the environment, take action, and make decisions based on feedback. The environment can be understood as the external world that the agent faces. The agent learns strategies by interacting with the environment and based on the feedback information received.

[0098] In practical applications, after providing users with multiple recommended videos, the user's feedback behavior for each recommended video can be recorded. This feedback behavior can be understood as the environmental state, which is the agent's observation of the environment. The agent can choose appropriate actions to perform under different environmental states, and the environment provides feedback on the agent's actions to create a new environmental state. In this step, after obtaining the user's feedback behavior for each sorted recommended video, the user's video browsing data for each recommended video can be determined based on the feedback behavior. In some optional examples, the video browsing data may include at least one of the following: the number of times the recommended video was looped, the viewing duration of the recommended video, and the number of times the recommended video was completed.

[0099] S202, using a pre-acquired reward function, converts video browsing data into reward values ​​for corresponding recommended videos.

[0100] In reinforcement learning, the reward value can be determined based on the environmental feedback, and the relevant video recommendation strategy can be adjusted according to the reward value to maximize the agent's benefit throughout the entire interaction with the environment.

[0101] In this step, a reward function can be obtained. For each recommended video, the video view data based on this reward function can be converted into a reward value, thus obtaining the reward value for each recommended video. It's understandable that the reward value can change accordingly when the user's feedback behavior changes.

[0102] S203, adjust the parameters of the pre-trained video recommendation model according to the corresponding reward value of each recommended video.

[0103] After obtaining the reward value for each recommended video, maximizing the reward value can be the optimization objective. The parameters of the pre-trained video recommendation model can then be optimized and adjusted. The pre-trained video recommendation model with adjusted parameters can provide new video recommendation strategies. In one example, the optimization algorithm used when adjusting the parameters could be Proximal Policy Optimization (PPO).

[0104] S204. Based on the video recommendation strategy provided by the video recommendation model with adjusted parameters, recommend videos to the user again until the training termination condition is met, and the trained video recommendation model is obtained.

[0105] After adjusting the parameters, a new video recommendation strategy can be obtained from the video recommendation model, the method of providing recommended videos can be determined, and the videos can be provided to the user again. Steps S201 to S203 are repeated until the training termination condition is met, and a trained video recommendation model is obtained.

[0106] In this embodiment, by determining the corresponding reward value based on the user's feedback behavior on the recommended videos, and adjusting the parameters of the pre-trained video recommendation model according to the reward value, it is possible to quickly determine the video recommendation strategy suitable for each user when different users have different interests in the videos they follow. This increases the suitability of recommended videos for the corresponding users. Furthermore, user behavior data can directly and clearly provide positive and negative feedback to the model through reward values, thus optimizing the model's output results.

[0107] In one embodiment, providing recommended videos to the user again based on the video recommendation strategy currently provided by the video recommendation model with adjusted parameters may include the following steps:

[0108] Based on the video recommendation strategy provided by the video recommendation model after parameter adjustment, multiple recommended videos are rearranged, and the rearranged recommended videos are provided to the user.

[0109] Specifically, after adjusting the parameters of the pre-trained video recommendation model, the display order of multiple recommended videos can be further refined according to the video recommendation strategy currently provided by the video recommendation model, resulting in multiple recommended videos with a rearranged display order. Then, the multiple recommended videos with the rearranged display order can be used as recommended videos to be displayed to users.

[0110] In this embodiment, by using the video recommendation strategy provided by the video recommendation model with adjusted parameters, multiple recommended videos are further refined. The recommendation method of the video recommendation model can be adjusted according to user feedback to achieve personalized video recommendations and improve the quality of video recommendation results obtained by different users.

[0111] In one embodiment, step S101, which involves pre-training the semantic feature extraction module in the initial video recommendation model using multiple unlabeled video samples, may include the following steps:

[0112] S301, Obtain multiple unlabeled video samples; each unlabeled video sample includes the video and the video text paired with the video.

[0113] In practice, multiple unlabeled video samples can be pre-collected, for example, by crawling from the internet. Each unlabeled video sample includes the video and its paired video text. The video text can be understood as text information paired with the video. For example, the video text may include any one or more of the following: the title of the video, text in the video, and introductory information of the video.

[0114] S302, input the unlabeled video samples into the initial video recommendation model, and the semantic feature extraction module in the initial video recommendation model extracts features from the video to obtain video semantic features, and extracts features from the video text to obtain text semantic features.

[0115] After obtaining unlabeled video samples, each unlabeled video sample can be input into the initial video recommendation model. The semantic feature extraction module in the initial video recommendation model extracts semantic features from the videos in the unlabeled video samples to obtain video semantic features, and extracts semantic features from the video text to obtain text semantic features.

[0116] In some optional embodiments, part of the structure of the semantic feature extraction module can be as follows: Figure 4As shown, the semantic feature extraction module can include a video semantic feature extraction network for processing video and a text semantic feature extraction network for processing video text. The video and video samples are used as inputs to the two networks, respectively. After being processed by the corresponding networks, the inputs are encoded into a feature vector of a specified length (e.g., 2048 dimensions).

[0117] Specifically, the video semantic feature extraction network processes the output video through two encoders and a multi-layer perceptron (MLP), including an image encoder and a video encoder. In some optional embodiments, the image encoder and / or video encoder can be pre-trained based on a ResNet-152 network, which can be pre-trained using the ImageNet dataset. The text semantic feature extraction network may include a text encoder and a multi-layer perceptron, and the text semantic feature extraction network is constructed based on a Chinese pre-trained model (such as RoBERTa).

[0118] In some embodiments, the video semantic features output by the video semantic feature extraction network and the text semantic feature extraction network can be merged at a low level, for example, by inputting them into a 6-layer Transformer module (such as a Cross-Attention Transformer module) to further fuse video information. This helps the model determine the mapping relationship between video semantic features and text semantic features, understand how to convert visual information in the video and linguistic information in the text, and improve its multimodal understanding ability and performance.

[0119] S303, based on the video semantic features and text semantic features corresponding to each unlabeled video sample, the semantic feature extraction module is trained in an unsupervised manner.

[0120] After obtaining the video semantic features and text semantic features corresponding to each unlabeled video sample, the semantic features extracted from the two modalities can be utilized.

[0121] In this embodiment, by utilizing the semantic features corresponding to the two modalities, the semantic feature extraction module is trained in an unsupervised manner. On the one hand, this can significantly reduce the annotation time during the training process and make full use of the existing massive video samples. On the other hand, it can also enhance the semantic feature extraction module's ability to understand videos and text, thereby improving the video recommendation model's ability to correctly understand the semantic information of the input content and retrieve relevant videos.

[0122] In one embodiment, step S303, which involves unsupervised training of the semantic feature extraction module based on the video semantic features and text semantic features corresponding to each unlabeled video sample, may include the following steps:

[0123] For each video, based on the similarity between the video semantic features corresponding to the video and the semantic features of each text, the predicted paired text is determined from all video texts; for each unlabeled video sample, the similarity between the video semantic features corresponding to the unlabeled video sample and the text semantic features corresponding to the unlabeled video sample is determined; based on the difference between the predicted paired text and the paired video text for each video, and the similarity between the video semantic features and the text semantic features, the model loss value is determined, and the module parameters of the semantic feature extraction module are adjusted based on the model loss value.

[0124] Specifically, the semantic features of a video and its paired video text should be as close and similar as possible to each other, due to their similar semantics.

[0125] To address this, on the one hand, for each video, the semantic features corresponding to that video can be compared with the semantic features corresponding to the text texts of each video to determine the similarity between the video semantic features and the text semantic features. Then, based on this similarity, the video texts that may pair with the current video can be identified from among the multiple video texts as predicted pairing texts, thus obtaining the video pairing result. This process can be understood as predicting the video text paired with the video based on the similarity between the video semantic features and the text semantic features output by the semantic feature extraction module, without ignoring the pairing relationship between the video and the video text.

[0126] On the other hand, for each unlabeled video sample, the similarity between the video semantic features corresponding to the unlabeled video sample and the text semantic features corresponding to the unlabeled video sample can be determined.

[0127] Then, the model loss value can be determined based on the difference between the predicted paired text of each video and the pre-determined paired video text, as well as the similarity between the video semantic features and the text semantic features of each video. The similarity between the video semantic features and the text semantic features of each video refers to the similarity between the video semantic features and the corresponding text semantic features for each video.

[0128] The model loss value is positively correlated with the difference between the predicted paired text and the pre-determined paired video text; that is, the smaller the difference between the predicted paired text and the pre-determined paired video text, the smaller the model loss value. For the same unlabeled video sample, the video semantic features and text semantic features need to be close to each other in the feature space. Therefore, the model loss value can be negatively correlated with similarity; that is, the higher the similarity, the smaller the model loss value. Subsequently, the module parameters of the semantic feature extraction module can be adjusted based on the model loss value.

[0129] In this embodiment, by pairing videos and video texts based on video semantic features and text semantic features, and by determining the similarity between video semantic features and text semantic features of the same sample, the semantic feature extraction model can determine the mapping relationship between text semantic features and video semantic features. This allows for accurate video retrieval based on prompts in video or text form.

[0130] In one embodiment, the multiple unlabeled video samples include unlabeled video samples in which some video frames or some text characters are masked. For example, some video samples can be selected from multiple unlabeled video samples, and the video frames or video text of the selected video samples can be randomly masked so that some text characters in some video frames or video text are masked. For example, the same number (such as 0) can be used to fill the features corresponding to the video frames so that the values ​​in each dimension are the same.

[0131] Accordingly, determining the model loss value based on the difference between the predicted paired text and the paired video text for each video, and the similarity between the video semantic features and the text semantic features, may include the following steps:

[0132] The model loss value is determined by predicting the hidden video frames based on the video semantic features, obtaining the predicted video frames, and predicting the hidden text characters based on the text semantic features. The predictions are based on the differences between the predicted video frames and the hidden video frames, the differences between the predicted text characters and the hidden text characters, the differences between the predicted paired text and the paired video text, and the similarity between the video semantic features and the text semantic features.

[0133] In practical applications, since there are connections between multiple video frames in a video, the context information corresponding to the hidden video frame can be determined based on the extracted video semantic features, and the content of the hidden video frame can be predicted based on the context information to obtain the predicted video frame.

[0134] Similarly, text characters in adjacent positions in video text are related. After obtaining the text semantic features, the context information corresponding to the hidden text characters can be determined based on the text semantic features, and the hidden text characters can be predicted based on the context information to obtain the predicted text characters.

[0135] Then, the model loss value can be determined based on the differences between the predicted video frames and the hidden video frames, the differences between the predicted text characters and the hidden text characters, the differences between the predicted paired text of the video and the paired video text, and the similarity between the video semantic features and the text semantic features of the video.

[0136] Specifically, when determining the model loss value for the difference between the predicted video frame and the hidden video frame, the concept of contrastive learning can be adopted. The goal is to make the predicted video frame and the hidden video frame as similar as possible among multiple video frames corresponding to the video (such as the multiple video frames input into the model). Correspondingly, the smaller the difference between the predicted and hidden video frames, the lower the model loss value. In some embodiments, a first loss value can be determined based on this difference and the NCE (Noise-contrastive estimation) loss function to maximize the mutual information between the hidden and predicted video frames.

[0137] For predicted text characters, a second loss value can be determined based on the difference between the predicted text characters and the hidden text characters, according to the corresponding loss function. For the predicted paired text and the paired video text, a third loss value can be determined based on the difference between the two and the cross-entropy loss function. For the similarity between the video semantic features and text semantic features of unlabeled video samples, a fourth loss value can be determined based on this similarity and the contrastive learning loss function. Finally, the first, second, third, and fourth loss values ​​can be summed to obtain the model loss value.

[0138] In this embodiment, by masking the video or video text and predicting the hidden content, the difficulty of prediction can be increased, enabling the semantic feature extraction module to learn more robust and generalizable feature representations.

[0139] In one embodiment, such as Figure 5 As shown, a video recommendation method is provided. This embodiment illustrates the application of this method to a server. It is understood that this method can also be applied to a terminal, or to a system that includes both a terminal and a server.

[0140] This embodiment includes the following steps:

[0141] S501, Obtain a video recommendation request for the user; the video recommendation request carries a target video search suggestion.

[0142] In practice, video recommendation requests can be triggered by the user. For example, after detecting that a user has performed a corresponding triggering operation on the terminal, the terminal can send a video recommendation request carrying a target video search suggestion to the server. Alternatively, the server or other business modules can proactively obtain video recommendation requests for the user, such as obtaining video recommendation requests for that user during the process of pushing multimedia content to the user.

[0143] The target video search suggestions can be provided by the user in real time, or they can be obtained based on the videos the user has previously viewed or the video search history. For example, the text content or video entered by the user in the search suggestion input area can be used as the target video search suggestion, or the target video search suggestion can be obtained based on the videos the user has recently viewed, videos viewed multiple times, or video search suggestions entered by the user in the past.

[0144] S502, input the target video retrieval prompt into the user's corresponding video recommendation model, and use the output of the video recommendation model as the video recommendation result.

[0145] The video recommendation model corresponding to the user is pre-trained according to the video recommendation model training method in any of the above embodiments.

[0146] In practical applications, a video recommendation model for a user can be pre-trained based on the user's browsing behavior. For example... Figure 6 As shown, in the pre-training stage, the initial video recommendation model can be pre-trained based on a large number of unlabeled video samples to obtain a pre-trained video recommendation model. This model can serve as the basis for training the video recommendation model corresponding to each user. The pre-trained video recommendation model has strong versatility. Subsequently, it only needs to be fine-tuned on a small amount of labeled data for specific tasks to complete the learning of related downstream tasks, making full use of labeled data and achieving high utilization of labeled data.

[0147] After the fine-tuning phase, the pre-trained video recommendation model can be fine-tuned using reinforcement learning. Specifically, the relevant parameters of the video recommendation model can be adjusted based on the user's feedback behavior on the recommended videos provided by the model. When the termination condition is met, the video recommendation model corresponding to that user is obtained.

[0148] Furthermore, after obtaining the target video search prompt, the target video search prompt can be input into the video recommendation model corresponding to the user, and the output of the video recommendation model can be used as the video recommendation result.

[0149] In this embodiment, a video recommendation request for a user can be obtained, carrying a target video retrieval prompt. This prompt can then be input into the user's corresponding video recommendation model, and the model's output becomes the recommended video. By combining user feedback on recommended videos and fine-tuning the pre-trained video recommendation model, a video recommendation model with strong semantic feature extraction capabilities and adapted to the user's video browsing habits can be quickly obtained. This model can then quickly retrieve recommended videos that the user is interested in, meeting personalized user needs and effectively improving the quality of video recommendation results.

[0150] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0151] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores video data and user feedback behavior data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a video recommendation model training method or a video recommendation method.

[0152] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a video recommendation model training method or a video recommendation method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0153] Those skilled in the art will understand that Figure 7 and Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0154] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0155] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0156] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0157] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0158] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0159] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0160] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for training a video recommendation model, characterized in that, The method includes: Obtain multiple unlabeled video samples; each unlabeled video sample includes a video and video text paired with the video. For each video, based on the similarity between the video semantic features corresponding to the video and the text semantic features of each video text, a predicted paired text is determined from all video texts; the video semantic features and the text semantic features are extracted by the semantic feature extraction module in the initial video recommendation model; For each unlabeled video sample, determine the similarity between the video semantic features corresponding to the unlabeled video sample and the text semantic features corresponding to the unlabeled video sample; Based on the difference between the predicted paired text of each video and the paired video text, and the similarity between the video semantic features and the text semantic features corresponding to the same unlabeled video samples, the model loss value is determined, and the module parameters of the semantic feature extraction module are adjusted according to the model loss value to obtain a pre-trained video recommendation model. The user's video search suggestions are input into the pre-trained video recommendation model. The semantic feature extraction module obtains the semantic features corresponding to the video search suggestions. Based on the semantic features corresponding to the video search suggestions and the video recommendation strategy provided by the pre-trained video recommendation model, recommended videos are provided to the user. Based on the user's feedback on the recommended videos, the parameters of the pre-trained video recommendation model are adjusted until the training termination condition is met, resulting in a well-trained video recommendation model.

2. The method according to claim 1, characterized in that, The step of providing recommended videos to the user based on the semantic features corresponding to the video retrieval prompts and the video recommendation strategy provided by the pre-trained video recommendation model includes: Based on the similarity between the semantic features corresponding to the video retrieval prompt and the semantic features of each pre-acquired candidate video, multiple recommended videos related to the video retrieval prompt are determined from multiple candidate videos; the semantic features of the candidate videos are obtained by feature extraction of each candidate video through the semantic feature extraction module; The pre-trained video recommendation model sorts the multiple recommended videos according to the video recommendation strategy and provides the sorted multiple recommended videos to the user.

3. The method according to claim 2, characterized in that, The step of adjusting the parameters of the pre-trained video recommendation model based on the user's feedback behavior on the recommended videos until the training termination condition is met, thereby obtaining a trained video recommendation model, includes: Based on the user's feedback behavior on the sorted recommended videos, the video browsing data of the user for each recommended video is obtained; Using a pre-acquired reward function, the video browsing data is converted into reward values ​​for the corresponding recommended videos; The parameters of the pre-trained video recommendation model are adjusted according to the corresponding reward value of each recommended video. Based on the video recommendation strategy currently provided by the video recommendation model after parameter adjustment, recommended videos are provided to the user again until the training termination condition is met, thus obtaining a trained video recommendation model.

4. The method according to claim 3, characterized in that, The step of providing recommended videos to the user again based on the video recommendation strategy currently provided by the video recommendation model after parameter adjustment includes: Based on the video recommendation strategy currently provided by the video recommendation model with adjusted parameters, the multiple recommended videos are rearranged, and the rearranged multiple recommended videos are provided to the user.

5. The method according to any one of claims 1 to 4, characterized in that, After acquiring multiple unlabeled video samples, the process also includes: The unlabeled video samples are input into the initial video recommendation model, where the semantic feature extraction module extracts features from the video to obtain video semantic features, and extracts features from the video text to obtain text semantic features.

6. The method according to any one of claims 1 to 4, characterized in that, The plurality of unlabeled video samples include unlabeled video samples in which some video frames or some text characters have been masked. The step of determining the model loss value based on the difference between the predicted paired text of each video and the paired video text, and the similarity between the video semantic features and the text semantic features, includes: Based on the video semantic features, the hidden video frames are predicted to obtain the predicted video frames; and based on the text semantic features, the hidden text characters are predicted to obtain the predicted text characters. The model loss value is determined based on the differences between the predicted video frame and the hidden video frame, the differences between the predicted text characters and the hidden text characters, the differences between the predicted paired text of the video and the paired video text, and the similarity between the video semantic features and the text semantic features.

7. A video recommendation method, characterized in that, The method includes: Obtain a video recommendation request for the user; the video recommendation request carries a target video search suggestion; The target video retrieval prompt is input into the video recommendation model corresponding to the user, and the output of the video recommendation model is used as the video recommendation result; The video recommendation model corresponding to the user is pre-trained according to the video recommendation model training method as described in any one of claims 1 to 6.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6 or the steps of the method according to claim 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6 or the steps of the method according to claim 7.