Video recommendation method and device, computer equipment, storage medium and program product

By acquiring and integrating the characteristics of source videos, historical playback videos and candidate videos, using the video recommendation model to generate long-term and short-term interest characteristics, the problem of insufficient user interest representation is solved and the accuracy of video recommendation is improved.

CN120448587APending Publication Date: 2025-08-08TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510579463.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-06
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing video recommendation methods have insufficient user interest representation, which leads to the mismatch of recommended videos with user interest and poor accuracy.

Method used

By obtaining the characteristics of the source video, historical playback video sequences and candidate videos, using the video recommendation model for encoding and attention processing, long-term and short-term interest characteristics are generated, and fused to determine user interest characteristics, and then the recommendation decision results of candidate videos are determined.

Benefits of technology

Improve the accuracy of video recommendations, making the recommended video more in line with users' interests and preferences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448587A_ABST
    Figure CN120448587A_ABST
Patent Text Reader

Abstract

The invention relates to a video recommendation method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: acquiring a first feature of a source video, a second feature of each historically played video in a historically played video sequence, a third feature of a sub-video sequence in the historically played video sequence and a fourth feature of a candidate video; coding based on the first feature and the second feature to obtain a long-term behavior sequence representation, and generating a long-term interest feature based on the long-term behavior sequence representation and a fourth feature; performing attention processing on the third feature and the long-term behavior sequence representation to obtain a short-term behavior sequence representation, and generating a short-term interest feature based on the short-term behavior sequence representation and the fourth feature; fusing the long-term interest features and the short-term interest features to obtain user interest features corresponding to the candidate videos; and determining a recommendation decision result of the candidate video according to the user interest characteristics. By adopting the method, the accuracy of the video recommendation method can be improved.
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 video recommendation method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] With the rapid development of mobile Internet technology and the widespread popularity of smart terminal devices, online video platforms have become an important channel for people to entertain, learn, and socialize. The video libraries of online video platforms often contain massive amounts of video content. Therefore, it is necessary to filter out videos that users are interested in from the massive amount of video content in order to achieve accurate recommendations for users.

[0003] In traditional technologies, recommended videos are mostly determined based on the user's historical viewing records, or based on the video the user is currently watching.

[0004] However, existing video recommendation methods have the problem of insufficient representation of user interests, which makes the recommended videos mismatch with user interests, resulting in poor accuracy of video recommendation methods. Summary of the Invention

[0005] Based on this, it is necessary to provide a video recommendation method, apparatus, computer device, computer-readable storage medium and computer program product that can improve the accuracy of the video recommendation method in response to the above technical problems.

[0006] In a first aspect, the present application provides a video recommendation method, comprising:

[0007] Obtaining a first feature of a source video, a second feature of each historically played video in a historically played video sequence, a third feature of a sub-video sequence in the historically played video sequence, and a fourth feature of a candidate video;

[0008] Encoding is performed based on the first feature and the second feature to obtain a long-term behavior sequence representation, and generating a long-term interest feature based on the long-term behavior sequence representation and the fourth feature;

[0009] Performing attention processing on the third feature and the long-term behavior sequence representation to obtain a short-term behavior sequence representation, and generating a short-term interest feature based on the short-term behavior sequence representation and the fourth feature;

[0010] The long-term interest feature and the short-term interest feature are integrated to obtain the user interest feature corresponding to the candidate video;

[0011] The recommendation decision result of the candidate video is determined based on the user's interest characteristics.

[0012] In a second aspect, the present application also provides a video recommendation model training method, comprising:

[0013] Obtaining a first training feature of a training source video, a second training feature of each training history playback video in a training history playback video sequence, a third training feature of a training sub-video sequence in the training history playback video sequence, and a fourth training feature of a training candidate video;

[0014] By using the video recommendation model to be trained, encoding is performed based on the first training feature and the second training feature to obtain a training long-term behavior sequence representation, and a training long-term interest feature is generated based on the training long-term behavior sequence representation and the fourth training feature;

[0015] Performing attention processing on the third training feature and the training long-term behavior sequence representation through the video recommendation model to be trained to obtain a training short-term behavior sequence representation, and generating a training short-term interest feature based on the training short-term behavior sequence representation and the fourth training feature;

[0016] By using a relational attention network, the training long-term interest feature and the training short-term interest feature are updated based on the dependency relationship between the training long-term behavior sequence representation and the training short-term behavior sequence representation to obtain an updated long-term interest feature and an updated short-term interest feature;

[0017] Determining a target loss value according to the training long-term interest feature, the training short-term interest feature, the updated long-term interest feature, and the updated short-term interest feature;

[0018] The video recommendation model to be trained is adjusted based on the target loss value.

[0019] In a third aspect, the present application further provides a video recommendation device, comprising:

[0020] An acquisition module, configured to acquire a first feature of a source video, a second feature of each historically played video in a historically played video sequence, a third feature of a sub-video sequence in the historically played video sequence, and a fourth feature of a candidate video;

[0021] A first execution module is configured to perform encoding based on the first feature and the second feature to obtain a long-term behavior sequence representation, and generate a long-term interest feature based on the long-term behavior sequence representation and the fourth feature;

[0022] a second execution module, configured to perform attention processing on the third feature and the long-term behavior sequence representation to obtain a short-term behavior sequence representation, and generate a short-term interest feature based on the short-term behavior sequence representation and the fourth feature;

[0023] A third execution module is configured to fuse the long-term interest feature with the short-term interest feature to obtain a user interest feature corresponding to the candidate video;

[0024] The determination module is used to determine the recommendation decision result of the candidate video based on the user's interest characteristics.

[0025] In one embodiment, the first execution module is specifically used to determine a first query vector based on the first feature, and input the first query vector into the attention encoder; determine a first key vector and a first value vector based on the second feature respectively, and input the first key vector and the first value vector into the attention encoder; encode the first query vector, the first key vector and the first value vector through the attention encoder to obtain a long-term behavior sequence representation; the long-term behavior sequence representation indicates the degree of relevance between each historical playback video in the historical playback video sequence and the source video.

[0026] In one embodiment, the first execution module is specifically configured to determine a second query vector based on the fourth feature; and determine a second key vector and a second value vector based on the long-term behavior sequence representation respectively;

[0027] Attention processing is performed based on the second query vector, the second key vector, and the second value vector to obtain a long-term interest feature.

[0028] In one embodiment, the sub-video sequence is a video sequence composed of some historical videos in the historical playback video sequence up to the current time; the second execution module is specifically used to determine a third query vector based on the third feature, and input the third query vector into the interest attention network; determine a third key vector and a third value vector based on the long-term behavior sequence representation, respectively, and input the third key vector and the third value vector into the interest attention network; perform attention processing on the third query vector, the third key vector and the third value vector through the interest attention network to obtain a short-term behavior sequence representation; the short-term behavior sequence representation indicates the degree of correlation between each historical playback video in the historical playback video sequence and each video in the sub-video sequence.

[0029] In one embodiment, the second execution module is specifically used to determine a fourth query vector based on the fourth feature; determine a fourth key vector and a fourth value vector based on the short-term behavior sequence representation respectively; perform attention processing based on the fourth query vector and the fourth value vector to obtain a short-term interest feature.

[0030] In one embodiment, the third execution module is specifically used to determine the first fusion coefficient of the long-term interest feature based on the first feature, the fourth feature, the long-term interest feature and the short-term interest feature; determine the second fusion coefficient of the short-term interest feature based on the first fusion coefficient; and fuse the long-term interest feature and the short-term interest feature based on the first fusion coefficient and the second fusion coefficient to obtain the user interest feature corresponding to the candidate video.

[0031] In one embodiment, the third execution module is specifically used to perform a connection operation on the first feature, the fourth feature, the long-term interest feature and the short-term interest feature based on a connection function to obtain a fusion vector; perform a nonlinear transformation on the fusion vector based on a multi-perception layer function to obtain a fusion feature of the fusion vector; and compress the range of the fusion feature based on a compression function to obtain a first fusion coefficient of the long-term interest feature.

[0032] In one embodiment, the first fusion coefficient is a positive number less than 1, and the second fusion coefficient is the difference between the value 1 and the first fusion coefficient; the third execution module is specifically used to weight the long-term interest feature based on the first fusion coefficient, and weight the short-term interest feature based on the second fusion coefficient; the weighted long-term interest feature and the weighted short-term interest feature are summed to obtain the user interest feature corresponding to the candidate video.

[0033] In one embodiment, the determining module is specifically configured to obtain object features and context features representing a playback scenario of the source video;

[0034] The first feature, the fourth feature, the context feature, the object feature and the user interest feature are input into a multi-target network to obtain multiple scores of the candidate video under multiple preset indicators output by the multi-target network; a target score of the candidate video is determined according to the multiple scores of the candidate video under the multiple preset indicators, and a recommendation decision result of the candidate video is determined according to the target score.

[0035] In one embodiment, the acquisition module is also used to obtain the first original feature of the source video, the second original feature of each historical playback video in the historical playback video sequence, the third original feature of the sub-video sequence in the historical playback video sequence, the fourth original feature of the candidate video, the object original feature and the context original feature; and perform vector embedding on the first original feature, the second original feature, the third original feature, the fourth original feature, the object original feature and the context original feature respectively to obtain the first feature, the second feature, the third feature, the fourth feature, the object feature and the context feature respectively.

[0036] In one embodiment, the acquisition module is also used to obtain historical playback records, which are used to record historical playback videos; determine the information of the historical playback video based on the historical playback records; obtain the source video information; and use the information of the historical playback video and the information of the source video to construct a historical playback video sequence.

[0037] In a fourth aspect, the present application further provides a video recommendation model training device, comprising:

[0038] A second acquisition module is used to obtain a first training feature of a training source video, a second training feature of each training history playback video in a training history playback video sequence, a third training feature of a training sub-video sequence in the training history playback video sequence, and a fourth training feature of a training candidate video;

[0039] The fourth execution module is used to encode the first training feature and the second training feature through the video recommendation model to be trained to obtain a training long-term behavior sequence representation, and generate a training long-term interest feature based on the training long-term behavior sequence representation and the fourth training feature.

[0040] a fifth execution module, configured to perform attention processing on the third training feature and the training long-term behavior sequence representation through the video recommendation model to be trained to obtain a training short-term behavior sequence representation, and generate a training short-term interest feature based on the training short-term behavior sequence representation and the fourth training feature;

[0041] a sixth execution module, configured to update the trained long-term interest feature and the trained short-term interest feature based on the dependency relationship between the trained long-term behavior sequence representation and the trained short-term behavior sequence representation through a relational attention network, to obtain an updated long-term interest feature and an updated short-term interest feature;

[0042] A second determining module is configured to determine a target loss value based on the training long-term interest feature, the training short-term interest feature, the updated long-term interest feature, and the updated short-term interest feature;

[0043] An adjustment module is used to adjust the video recommendation model to be trained based on the target loss value.

[0044] In one embodiment, after the video recommendation model is trained, the trained long-term interest features are similar to the updated long-term interest features, the trained short-term interest features are similar to the updated short-term interest features, the trained long-term interest features are different from the updated short-term interest features, and the trained short-term interest features are different from the updated long-term interest features.

[0045] In one embodiment, the second determination module is specifically used to determine the first similarity difference between the training long-term interest feature and the updated long-term interest feature and the updated short-term interest feature, and determine the first loss value based on the first similarity difference; determine the second similarity difference between the updated long-term interest feature and the training long-term interest feature and the training short-term interest feature, and determine the second loss value based on the second similarity difference; determine the third similarity difference between the training short-term interest feature and the updated short-term interest feature and the updated long-term interest feature, and determine the third loss value based on the third similarity difference; determine the fourth similarity difference between the updated short-term interest feature and the training short-term interest feature and the training long-term interest feature, and determine the fourth loss value based on the fourth similarity difference; determine the target loss value based on the first loss value, the second loss value, the third loss value and the fourth loss value.

[0046] In a fifth aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method described in any one of the embodiments of the first and second aspects are implemented.

[0047] In a sixth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any one of the embodiments of the first and second aspects above.

[0048] In a seventh aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method described in any one of the embodiments of the first and second aspects above.

[0049] The above-mentioned video recommendation method, apparatus, computer equipment, computer-readable storage medium and computer program product first obtain the first feature of the source video, the second feature of each historical playback video in the historical playback video sequence, the third feature of the sub-video sequence in the historical playback video sequence and the fourth feature of the candidate video; then encode based on the first feature and the second feature to obtain a long-term behavior sequence representation, and generate a long-term interest feature based on the long-term behavior sequence representation and the fourth feature; perform attention processing on the third feature and the long-term behavior sequence representation to obtain a short-term behavior sequence representation, and generate a short-term interest feature based on the short-term behavior sequence representation and the fourth feature; then, fuse the long-term interest feature and the short-term interest feature to obtain the user interest feature corresponding to the candidate video; and then determine the recommendation decision result of the candidate video based on the user interest feature. The video recommendation method provided by the present application, in the process of determining long-term interest features, is based on the second features of each historically played video in the historically played video sequence, as well as the first features of the source video; and in the process of determining short-term interest features, is based on the third features of the sub-video sequence in the historically played video sequence, as well as the long-term behavior sequence representation, so that the user interest features determined based on the long-term interest features and the short-term interest features can fully represent the user interest, thereby making the recommendation decision results of the candidate videos determined based on the user interest features more accurate, thereby improving the accuracy of the video recommendation method. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.

[0051] Figure 1 A diagram illustrating an application environment of a video recommendation method according to an embodiment;

[0052] Figure 2 1 is a flow chart of a video recommendation method according to an embodiment;

[0053] Figure 3 A schematic diagram of a playback page in one embodiment;

[0054] Figure 4 is a schematic diagram of a process for obtaining a long-term behavior sequence representation in one embodiment;

[0055] Figure 5 is a schematic diagram of a process of obtaining long-term interest features in one embodiment;

[0056] Figure 6is a schematic diagram of a process for obtaining a short-term behavior sequence representation in one embodiment;

[0057] Figure 7 is a schematic diagram of a process of obtaining short-term interest features in one embodiment;

[0058] Figure 8 is a schematic diagram of a process for obtaining user interest features in one embodiment;

[0059] Figure 9 is a schematic diagram of a multi-target network in one embodiment;

[0060] Figure 10 Schematic diagram of a flow chart of a video recommendation method in another embodiment;

[0061] Figure 11 is a schematic diagram of a video recommendation model in one embodiment;

[0062] Figure 12 Schematic diagram of a process for training a video recommendation model in one embodiment;

[0063] Figure 13 Schematic diagram of a video recommendation model to be trained in one embodiment;

[0064] Figure 14 is a schematic diagram of a relational attention network in one embodiment;

[0065] Figure 15 is a structural block diagram of a video recommendation device in one embodiment;

[0066] Figure 16 This is a structural block diagram of a video recommendation model training device in one embodiment;

[0067] Figure 17 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment.

[0068] 101. First feature; 102. Second feature; 103. Third feature; 104. Fourth feature;

[0069] 105. Long-term behavior sequence representation; 106. Long-term interest characteristics;

[0070] 107. Short-term behavioral sequence representation; 108. Short-term interest characteristics;

[0071] 109. User interest characteristics; 110. Recommendation decision results of candidate videos;

[0072] 301, play page; 302, play video; 303, recommended video;

[0073] 401, attention encoder; 601, interest attention network; 801, adaptive fusion network model;

[0074] 901, splicing features; 902, multi-target network; 903, expert network layer; 904, perception layer;

[0075] 905, random network layer; 9031, expert network sublayer;

[0076] 1101. Video recommendation model; 1102. Vector embedding layer; 1103. Object features and context features;

[0077] 1301. Video recommendation model to be trained;

[0078] 1302. A vector embedding layer in a video recommendation model to be trained;

[0079] 1303. Train the first feature; 1304. Train the second feature; 1305. Train the third feature;

[0080] 1306. Training the fourth feature; 1307. Training the object feature and the training context feature;

[0081] 1308. Training long-term behavior sequence representation; 1309. Training long-term interest characteristics;

[0082] 1310. Training short-term behavioral sequence representation; 1311. Training short-term interest characteristics;

[0083] 1312. Relational attention network; 1313. Updated long-term interest features;

[0084] 1314. Updated short-term interest features; 1315. Long-term and short-term interest comparison learning model. DETAILED DESCRIPTION

[0085] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0086] In order to clearly describe the technical solution of this application and facilitate understanding of the technical solution of this application, the key concepts involved in this application are explained below.

[0087] The source video refers to the video currently being played. The first feature of the source video can be used to indicate multi-dimensional attribute information of the source video.

[0088] Historically played videos refer to videos that have been played by users through video applications installed on computer devices within a historical period of time.

[0089] The historical playback video sequence refers to an ordered set of historical playback videos. The second feature of each historical playback video in the historical playback video sequence can be used to indicate multi-dimensional attribute information of each historical playback video.

[0090] The sub-video sequence refers to a set of historically played videos in the historically played video sequence that meet preset conditions. The third feature of the sub-video sequence in the historically played video sequence can be used to indicate multi-dimensional attribute information of the sub-video sequence in the historically played video sequence.

[0091] A candidate video is any video in a candidate video sequence. The candidate video sequence is a collection of videos selected from the video library of a video application based on source videos and historically played video sequences. The fourth feature of a candidate video can be used to indicate multi-dimensional attribute information of the candidate video.

[0092] The long-term behavior sequence representation can be used to indicate the relevance between each historical video in the historical video sequence and the source video. The short-term behavior sequence representation can be used to indicate the relevance between each historical video in the historical video sequence and each video in the sub-video sequence.

[0093] The long-term interest feature can be used to characterize the user's long-term interest preference for videos, while the short-term interest feature can be used to characterize the user's short-term interest preference for videos.

[0094] The user interest features corresponding to the candidate videos can be used to represent the user's interest level in the candidate videos.

[0095] The recommendation decision result of a candidate video is used to indicate whether the candidate video is recommended.

[0096] Attention encoder refers to a neural network structure based on the self-attention mechanism.

[0097] The first query vector refers to the vector used as retrieval information for the attention encoder. The first key vector refers to the vector used by the attention encoder for feature matching and feature comparison. The first value vector refers to the vector used by the attention encoder for feature extraction and feature fusion.

[0098] The second query vector refers to the vector used as retrieval information for attention processing. The second key vector refers to the vector used for feature matching and feature comparison during the attention processing. The second value vector refers to the vector used for feature extraction and feature fusion during the attention processing.

[0099] The third query vector refers to a vector used as retrieval information for the interest attention network. The third key vector refers to a vector used by the interest attention network for feature matching and feature comparison. The third value vector refers to a vector used by the interest attention network for feature extraction and feature fusion.

[0100] The fourth query vector refers to a vector used as retrieval information for attention processing. The fourth key vector refers to a vector used for feature matching and feature comparison during attention processing. The fourth value vector refers to a vector used for feature extraction and feature fusion during attention processing.

[0101] The first fusion coefficient is used to indicate the weight value of the long-term interest feature in the process of fusing the long-term interest feature and the short-term interest feature.

[0102] The second fusion coefficient is used to indicate the weight value of the short-term interest feature in the process of fusing the long-term interest feature and the short-term interest feature.

[0103] The object features can be used to indicate multi-dimensional attribute information of the user. The context features of the playback scene of the source video can be used to indicate multi-dimensional attribute information of the playback scene of the source video.

[0104] The preset indicators may be indicators used to measure the effects of users on candidate videos in multiple dimensions.

[0105] Vector embedding refers to a method that can convert high-dimensional sparse vectors into low-dimensional dense vectors.

[0106] The video recommendation method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown.

[0107] Exemplarily, the computer device may first obtain a first feature of the source video, a second feature of each historically played video in a historically played video sequence, a third feature of a sub-video sequence in the historically played video sequence, and a fourth feature of the candidate video.

[0108] Furthermore, after obtaining the first feature 101, the second feature 102, the third feature 103 and the fourth feature 104, the computer device can encode based on the first feature 101 and the second feature 102 to obtain a long-term behavior sequence representation 105, generate a long-term interest feature 106 based on the long-term behavior sequence representation 105 and the fourth feature 104, and perform attention processing on the third feature 103 and the long-term behavior sequence representation 105 to obtain a short-term behavior sequence representation 107, generate a short-term interest feature 108 based on the short-term behavior sequence representation 107 and the fourth feature 104, and then fuse the long-term interest feature 106 and the short-term interest feature 108 to obtain a user interest feature 109 corresponding to the candidate video, and then determine the recommendation decision result 110 of the candidate video based on the user interest feature 109.

[0109] Computer devices can be terminals or servers. Terminals include, but are not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices include smart TVs, smart car devices, and projectors. Portable wearable devices include smart watches, smart bracelets, and head-mounted devices. Head-mounted devices can include virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. Servers can be standalone physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing cloud computing services.

[0110] In an exemplary embodiment, Figure 2 As shown, a video recommendation method is provided, which is executed by a computer device and includes the following steps:

[0111] Step 201: Obtain a first feature of a source video, a second feature of each historically played video in a historically played video sequence, a third feature of a sub-video sequence in the historically played video sequence, and a fourth feature of a candidate video.

[0112] The source video refers to the video that is currently playing.

[0113] For example, when a user watches a video through a video application installed on a computer device, the video played by the video application is the source video.

[0114] For example, a user can open a video application installed on a computer device and enter keywords in the search bar of the video application according to actual needs. The video application can then display search results based on the keyword, that is, videos related to the keyword. The user can click on any of these videos according to actual needs to play the video through the video application, and the video played by the video application based on the user's click operation is the source video.

[0115] The first feature of the source video can be used to indicate multi-dimensional attribute information of the source video. For example, the first feature of the source video can be used to indicate attribute information of the source video content form dimension, attribute information of the subject matter dimension, attribute information of the production background dimension, etc.

[0116] The attribute information of the content format dimension may include movies, TV series, short dramas, variety shows, documentaries, animations, short videos, etc. The attribute information of the subject type dimension may include comedy, action, suspense, romance, science fiction, thriller, martial arts, history, workplace, campus, etc. The attribute information of the production background dimension may include the director's name, starring lineup, production company, shooting location, production year, etc.

[0117] Historically played videos refer to videos that have been played by users through video applications installed on computer devices within a historical period of time.

[0118] The historical video sequence refers to an ordered set of historical videos. For example, the historical video sequence can be arranged in the order of the time when the user played the historical videos.

[0119] The second feature of each historically played video in the historically played video sequence can be used to indicate multi-dimensional attribute information of each historically played video.

[0120] Exemplarily, the second feature of each historical playback video in the historical playback video sequence can be used to indicate the attribute information of the content form dimension, the attribute information of the subject type dimension, the attribute information of the production background dimension, etc. of each historical playback video in the historical playback video sequence.

[0121] A sub-video sequence is a set of historically played videos in a historically played video sequence that meet preset conditions, such as time, number of plays, content format, or subject matter.

[0122] Exemplarily, a sub-video sequence may be a set consisting of historical playback videos in a historical playback video sequence that meet a time condition. The time condition may indicate a time range, and the sub-video sequence may be a set consisting of historical playback videos in a historical playback video sequence whose playback time is within a certain time range. The time condition may be a time span of days, such as the past 3 days, the past 7 days, the past 15 days, etc., and the sub-video sequence may be a set consisting of historical playback videos in the historical playback video sequence that were played by the user in the past 3 days, the past 7 days, or the past 15 days. The time condition may also be a time span of months, such as the past 1 month, the past 3 months, the past 6 months, etc., and the sub-video sequence may be a set consisting of historical playback videos in the historical playback video sequence that were played by the user in the past 1 month, the past 3 months, or the past 6 months.

[0123] A sub-video sequence can also be a set of historically played videos in a historically played video sequence that meet a play count condition. The play count condition can be greater than 1, greater than 2, or greater than 3 times, and the sub-video sequence can be a set of historically played videos in a historically played video sequence that have been played greater than 1, greater than 2, or greater than 3 times.

[0124] The sub-video sequence can also be a set of historically played videos in the historically played video sequence that meet the content form condition. The content form indicated by the content form condition can be the same as the content form of the source video, that is, the content form condition can be determined based on the content form of the source video. The content form condition indicates the same content form as the source video. The content form can specifically include movies, TV series, short dramas, variety shows, documentaries, animation, and short videos. For example, when the content form of the source video is a movie, the content form condition indicates the content form is a movie. The sub-video sequence can then be a set of historically played videos in the historically played video sequence that have a movie content form.

[0125] The sub-video sequence can also be a collection of historically played videos in the historically played video sequence that meet the subject type condition. The subject type indicated by the subject type condition can be the same as the subject type of the source video, that is, the subject type condition can be determined based on the subject type of the source video. The subject type indicated by the subject type condition is the same as the subject type of the source video. The subject types can specifically include comedy, action, suspense, romance, science fiction, thriller, martial arts, history, workplace, and campus. For example, when the subject type of the source video is suspense, the subject type indicated by the subject type condition is suspense. In this case, the sub-video sequence can be a collection of historically played videos in the historically played video sequence that have a suspense subject type.

[0126] The third feature of a sub-video sequence in a historically played video sequence can be used to indicate multi-dimensional attribute information of the sub-video sequence in the historically played video sequence. For example, the third feature of a sub-video sequence in a historically played video sequence can be used to indicate attribute information of the content format dimension, attribute information of the subject matter type dimension, attribute information of the production background dimension, etc.

[0127] A candidate video refers to any video in a candidate video sequence. The candidate video sequence is a collection of videos selected from the video library of a video application based on source videos and historically played video sequences. Exemplarily, the relevance can include content format relevance, subject matter type relevance, production background relevance, and so on.

[0128] The fourth feature of the candidate video can be used to indicate multi-dimensional attribute information of the candidate video. For example, the fourth feature of the candidate video can be used to indicate attribute information of the candidate video's content form dimension, attribute information of the subject type dimension, attribute information of the production background dimension, etc.

[0129] In some exemplary embodiments, when a user has a need to watch a video, the user can watch the video through a video application installed on a computer device. Specifically, the user can first trigger the video application installed on the computer device. In response to the user's triggering operation, the computer device displays a function page of the video application. The user can select a video to play based on the function page and click on the video. In response to the user's click on the video, the computer device will display the video's play page, play the video in thumbnail form on the play page, and display recommended videos on the play page.

[0130] The playback page can be Figure 3 As shown, Figure 3 The video 302 played in the play page 301 shown is the source video in this application, and the recommended video 303 displayed in the play page 301 is determined by the video recommendation method provided in this application. Specifically, in the case where the computer device is a terminal, the computer device can directly determine the recommended video based on the video recommendation method provided in this application, and display it in the play page. In the case where the computer device is a server, the computer device can first determine the recommended video based on the video recommendation method provided in this application, and then send the recommended video to the terminal, so that the terminal displays the recommended video in the play page.

[0131] Furthermore, the computer device may first obtain the first feature of the source video, the second feature of each historically played video in the historically played video sequence, the third feature of the sub-video sequence in the historically played video sequence, and the fourth feature of the candidate video.

[0132] Specifically, the computer device can directly obtain the first feature of the source video, the second feature of each historical video in the historical video sequence, the third feature of the sub-video sequence in the historical video sequence, and the fourth feature of the candidate video from the video feature library.

[0133] The computer device can pre-parse the metadata of each video in the video library of the video application to obtain the features of each video, and store the features of each video in the video feature library. The metadata parsing can be achieved with the help of a natural language model.

[0134] With respect to the first feature of the source video, the computer device may first determine the video currently being played on the video playback page as the source video, and then obtain the first feature of the source video from the video feature library. With respect to the second feature of each historically played video in the historically played video sequence, the computer device may first obtain a historically played video sequence composed of the user's historically played videos from the user's historical playback record information, and then obtain the second feature of each historically played video in the historically played video sequence from the video feature library. With respect to the third feature of the sub-video sequence in the historically played video sequence, the computer device may first determine the videos that meet the preset conditions from the historically played video sequence, and then construct a sub-video sequence based on these videos that meet the preset conditions, and then obtain the third feature of the sub-video sequence from the video feature library. With respect to the fourth feature of the candidate video, the computer device may first use a candidate video engine to filter out the candidate video sequence from the video library of the video application based on the source video and the historically played video sequence, and then obtain the fourth feature of the candidate video in the candidate video sequence from the video feature library.

[0135] Step 202: Encode based on the first feature and the second feature to obtain a long-term behavior sequence representation, and generate a long-term interest feature based on the long-term behavior sequence representation and the fourth feature.

[0136] Encoding refers to the method of extracting and integrating the first feature and the second feature.

[0137] The long-term behavior sequence representation can be used to indicate the degree of relevance between each historical video in the historical video sequence and the source video. Specifically, the long-term behavior sequence representation can be a representation of the features that make each historical video in the historical video sequence more relevant to the source video.

[0138] Long-term interest features can be used to characterize users' long-term interest preferences for videos.

[0139] In some exemplary embodiments, after acquiring the first feature, the second feature, the third feature, and the fourth feature, the computer device may first perform encoding based on the first feature and the second feature to obtain a long-term behavior sequence representation.

[0140] Specifically, the computer device can encode the first feature and the second feature based on a pre-trained encoding model in the video recommendation model to obtain a long-term behavior sequence representation. The encoding model can be a long short-term memory network model, an attention model, a random forest model, etc.

[0141] Furthermore, after the computer device performs encoding based on the first feature and the second feature to obtain a long-term behavior sequence representation, it can generate a long-term interest feature based on the long-term behavior sequence representation and the fourth feature.

[0142] Specifically, the computer device may perform feature extraction and feature fusion processing on the long-term behavior sequence representation and the fourth feature based on the video recommendation model to obtain the long-term interest feature.

[0143] Step 203: Perform attention processing on the third feature and the long-term behavior sequence representation to obtain a short-term behavior sequence representation, and generate a short-term interest feature based on the short-term behavior sequence representation and the fourth feature.

[0144] Attention processing refers to a method that can integrate third features and related features in the representation of long-term behavioral sequences.

[0145] The short-term behavior sequence representation can be used to indicate the degree of relevance between each historical video in the historical video sequence and each video in the sub-video sequence. Specifically, the short-term behavior sequence representation can be a representation of the features that make each historical video in the historical video sequence more relevant to each video in the sub-video sequence.

[0146] Short-term interest features can be used to characterize users' short-term interest preferences for videos.

[0147] In some exemplary embodiments, after obtaining the first feature, the second feature, the third feature, and the fourth feature, the computer device may first encode the first feature and the second feature based on the video recommendation model to obtain a long-term behavior sequence representation.

[0148] Furthermore, the computer device may also perform attention processing on the third feature and the long-term behavior sequence representation to obtain a short-term behavior sequence representation.

[0149] Specifically, the computer device can implement attention processing on the third feature and the long-term behavior sequence representation based on a pre-trained attention model in the video recommendation model to obtain a short-term behavior sequence representation. The attention model can be a self-attention model, a multi-head attention model, an attention model based on a recurrent neural network, etc.

[0150] Furthermore, after the computer device performs attention processing on the third feature and the long-term behavior sequence representation to obtain a short-term behavior sequence representation, it can also generate a short-term interest feature based on the short-term behavior sequence representation and the fourth feature.

[0151] Specifically, the computer device may perform feature extraction and feature fusion processing on the short-term behavior sequence representation and the fourth feature based on the video recommendation model to obtain a short-term interest feature.

[0152] Step 204: The long-term interest feature and the short-term interest feature are integrated to obtain the user interest feature corresponding to the candidate video.

[0153] The user interest features corresponding to the candidate videos can be used to represent the user's interest level in the candidate videos.

[0154] In some exemplary embodiments, after obtaining the first feature, the second feature, the third feature, and the fourth feature, the computer device may first encode the first feature and the second feature based on the video recommendation model to obtain a long-term behavior sequence representation, and generate a long-term interest feature based on the long-term behavior sequence representation and the fourth feature.

[0155] Furthermore, the computer device can also perform attention processing on the third feature and the long-term behavior sequence representation to obtain a short-term behavior sequence representation, and generate a short-term interest feature based on the short-term behavior sequence representation and the fourth feature, and then fuse the long-term interest feature and the short-term interest feature to obtain the user interest feature corresponding to the candidate video.

[0156] Specifically, the computer device can fuse long-term interest features and short-term interest features based on a pre-trained fusion model in the video recommendation model to obtain user interest features corresponding to the candidate video. The fusion model can be a convolutional neural network model, a linear regression model, a multi-layer perceptron model, etc.

[0157] Step 205: Determine a recommendation decision result for the candidate video based on the user interest characteristics.

[0158] The recommendation decision result of the candidate video is used to indicate whether to recommend the candidate video, that is, whether to display the candidate video as a recommended video on the above-mentioned playback page.

[0159] In some exemplary embodiments, after the computer device fuses the long-term interest feature and the short-term interest feature to obtain the user interest feature corresponding to the candidate video, it can determine the recommendation decision result of the candidate video based on the user interest feature.

[0160] Specifically, the computer device may determine the user's level of interest in the candidate video based on the video recommendation model and the user's interest characteristics corresponding to the candidate video. Furthermore, after determining the user's level of interest in the candidate video based on the video recommendation model, the computer device may obtain a preset interest threshold, compare the user's level of interest in the candidate video with the interest threshold, and determine a recommendation decision for the candidate video based on the comparison result.

[0161] If the computer device determines that the user's interest in the candidate video is greater than or equal to the interest level threshold, the computer device may determine that the candidate video recommendation decision result is to recommend the candidate video. If the computer device determines that the user's interest in the candidate video is less than the interest level threshold, the computer device may determine that the candidate video recommendation decision result is not to recommend the candidate video.

[0162] The above-mentioned video recommendation method first obtains the first feature of the source video, the second feature of each historical playback video in the historical playback video sequence, the third feature of the sub-video sequence in the historical playback video sequence, and the fourth feature of the candidate video; then encodes based on the first feature and the second feature to obtain a long-term behavior sequence representation, and generates a long-term interest feature based on the long-term behavior sequence representation and the fourth feature; performs attention processing on the third feature and the long-term behavior sequence representation to obtain a short-term behavior sequence representation, and generates a short-term interest feature based on the short-term behavior sequence representation and the fourth feature; then, the long-term interest feature and the short-term interest feature are fused to obtain the user interest feature corresponding to the candidate video; and then the recommendation decision result of the candidate video is determined based on the user interest feature. The video recommendation method provided by the present application, in the process of determining long-term interest features, is based on the second features of each historically played video in the historically played video sequence, as well as the first features of the source video; and in the process of determining short-term interest features, is based on the third features of the sub-video sequence in the historically played video sequence, as well as the long-term behavior sequence representation, so that the user interest features determined based on the long-term interest features and the short-term interest features can fully represent the user interest, thereby making the recommendation decision results of the candidate videos determined based on the user interest features more accurate, thereby improving the accuracy of the video recommendation method.

[0163] In an exemplary embodiment, encoding is performed based on the first feature and the second feature to obtain a long-term behavior sequence representation, including: determining a first query vector based on the first feature, and inputting the first query vector into an attention encoder; determining a first key vector and a first value vector based on the second feature, respectively, and inputting the first key vector and the first value vector into the attention encoder; encoding the first query vector, the first key vector, and the first value vector through the attention encoder to obtain a long-term behavior sequence representation.

[0164] An attention encoder is a neural network structure based on a self-attention mechanism that can extract and fuse features from the first and second features. Specifically, the attention encoder can be a Transformer encoder.

[0165] The first query vector refers to the vector used as retrieval information for the attention encoder. The first key vector refers to the vector used by the attention encoder for feature matching and feature comparison. The first value vector refers to the vector used by the attention encoder for feature extraction and feature fusion.

[0166] In some exemplary embodiments, Figure 4 As shown, after obtaining the first feature 101 and the second feature 102 , the computer device may first determine a first query vector according to the first feature 101 , and determine a first key vector and a first value vector according to the second feature 102 .

[0167] Specifically, the computer device may perform a linear transformation on the first feature through the video recommendation model to obtain a first query vector, and perform a linear transformation on the second feature to obtain a first key vector and a first value vector.

[0168] Furthermore, after obtaining the first query vector, the first key vector and the first value vector, the computer device can input the first query vector, the first key vector and the first value vector into the attention encoder 401 in the video recommendation model, so as to encode the first query vector, the first key vector and the first value vector through the attention encoder 401 to obtain the long-term behavior sequence representation 105.

[0169] Specifically, the long-term behavior sequence representation can be expressed as s global , then the first query vector, the first key vector and the first value vector are encoded through the attention encoder to obtain the long-term behavior sequence representation, which can be expressed as ,in, is the first bond vector, is the first value vector, is the first query vector, T is the matrix transpose symbol, d1 is the dimension of the first key vector, and softmax is the function.

[0170] The above method determines the first query vector according to the first feature, and inputs the first query vector into the attention encoder; determines the first key vector and the first value vector according to the second feature respectively, and inputs the first key vector and the first value vector into the attention encoder; encodes the first query vector, the first key vector and the first value vector through the attention encoder to obtain the long-term behavior sequence representation, and uses the attention encoder to determine the long-term behavior sequence representation based on the first feature and the second feature, thereby effectively improving the accuracy of the long-term behavior sequence representation.

[0171] In an exemplary embodiment, generating a long-term interest feature based on the long-term behavior sequence representation and the fourth feature includes: determining a second query vector based on the fourth feature; determining a second key vector and a second value vector based on the long-term behavior sequence representation respectively; performing attention processing based on the second query vector, the second key vector and the second value vector to obtain the long-term interest feature.

[0172] The second query vector refers to the vector used as retrieval information for attention processing. The second key vector refers to the vector used for feature matching and feature comparison during the attention processing. The second value vector refers to the vector used for feature extraction and feature fusion during the attention processing. The attention processing here refers to the attention processing performed on the second query vector, the second key vector, and the second value vector.

[0173] In some exemplary embodiments, after obtaining the first feature, the second feature, the third feature, and the fourth feature, the computer device may first determine a long-term behavior sequence representation based on the first feature and the second feature based on the video recommendation model. Figure 5 As shown, after obtaining the long-term behavior sequence representation, the computer device can also determine the second query vector according to the fourth feature 104 , and determine the second key vector and the second value vector according to the long-term behavior sequence representation 105 .

[0174] Specifically, the computer device may perform a linear transformation on the fourth feature through the video recommendation model to obtain a second query vector, and determine the long-term behavior sequence representation as a second key vector and a second value vector.

[0175] Furthermore, after obtaining the second query vector, the second key vector, and the second value vector, the computer device may perform attention processing on the second query vector, the second key vector, and the second value vector based on the video recommendation model to obtain the long-term interest feature 106 .

[0176] Specifically, the long-term interest feature can be expressed as e global , then based on the second query vector, the second key vector and the second value vector, attention processing is performed to obtain the long-term interest feature which can be expressed as ,in, is the second query vector, s global are the second key vector and the second value vector, T is the matrix transpose symbol, d2 is the dimension of the second key vector, and softmax is the function.

[0177] The above method determines the second query vector based on the fourth feature; determines the second key vector and the second value vector respectively according to the long-term behavior sequence representation; performs attention processing based on the second query vector, the second key vector and the second value vector to obtain the long-term interest feature. Based on the attention processing, the long-term interest feature is determined using the fourth feature and the long-term behavior sequence representation, so that the accuracy of the determined long-term interest feature is higher, and thus the recommendation decision result of the candidate video determined based on the long-term interest feature is higher, thereby improving the accuracy of the video recommendation method.

[0178] In an exemplary embodiment, the third feature and the long-term behavior sequence representation are subjected to attention processing to obtain a short-term behavior sequence representation, including: determining a third query vector based on the third feature, and inputting the third query vector into the interest attention network; determining a third key vector and a third value vector based on the long-term behavior sequence, respectively, and inputting the third key vector and the third value vector into the interest attention network; and performing attention processing on the third query vector, the third key vector, and the third value vector through the interest attention network to obtain a short-term behavior sequence representation.

[0179] The sub-video sequence may be a video sequence consisting of a portion of historical videos in the historical playback video sequence up to the current time. For example, the video sequence consisting of a portion of historical videos may be a video sequence consisting of historical videos that meet a preset condition. In an optional embodiment, the preset condition may be a time condition, specifically, the time condition may be the past 7 days, the past 15 days, etc.

[0180] Interest Attention Network refers to a neural architecture based on the attention mechanism, which can perform feature extraction and feature fusion of third features and long-term behavior sequence representation.

[0181] The third query vector refers to a vector used as retrieval information for the interest attention network. The third key vector refers to a vector used by the interest attention network for feature matching and feature comparison. The third value vector refers to a vector used by the interest attention network for feature extraction and feature fusion.

[0182] In some exemplary embodiments, after obtaining the first feature, the second feature, the third feature, and the fourth feature, the computer device may first determine the long-term behavior sequence representation based on the first feature and the second feature. Figure 6As shown, after obtaining the long-term behavior sequence representation, the computer device can also determine a third query vector according to the third feature 103 and determine a third key vector and a third value vector according to the long-term behavior sequence representation 105 .

[0183] Specifically, the computer device may perform a linear transformation on the third feature through the video recommendation model to obtain a third query vector, and determine the long-term behavior sequence representation as a third key vector and a third value vector.

[0184] Furthermore, after obtaining the third query vector, the third key vector and the third value vector, the computer device can also input the third query vector, the third key vector and the third value vector into the interest attention network 601 in the video recommendation model, and perform attention processing on the third query vector, the third key vector and the third value vector through the interest attention network 601 to obtain a short-term behavior sequence representation 107.

[0185] Specifically, the short-term behavior sequence representation can be expressed as s local , then the third query vector, the third key vector and the third value vector are processed by the interest attention network to obtain the short-term behavior sequence representation, which can be expressed as ,in, is the third query vector, s global are the third key vector and the third value vector, T is the matrix transpose symbol, d3 is the dimension of the third key vector, and softmax is the function.

[0186] The above method determines the third query vector based on the third feature, and inputs the third query vector into the interest attention network; determines the third key vector and the third value vector respectively according to the long-term behavior sequence representation, and inputs the third key vector and the third value vector into the interest attention network; performs attention processing on the third query vector, the third key vector and the third value vector through the interest attention network to obtain a short-term behavior sequence representation. Based on the interest attention network, the short-term behavior sequence representation is determined using the third feature and the long-term behavior sequence representation, so that the accuracy of the determined short-term behavior sequence representation is higher, thereby effectively improving the accuracy of the video recommendation method.

[0187] In an exemplary embodiment, generating a short-term interest feature based on the short-term behavior sequence representation and the fourth feature includes: determining a fourth query vector based on the fourth feature; determining a fourth key vector and a fourth value vector based on the short-term behavior sequence representation respectively; performing attention processing based on the fourth query vector and the fourth value vector to obtain the short-term interest feature.

[0188] The fourth query vector refers to a vector used as retrieval information for attention processing. The fourth key vector refers to a vector used for feature matching and feature comparison during attention processing. The fourth value vector refers to a vector used for feature extraction and feature fusion during attention processing. The attention processing here refers to the attention processing performed on the fourth query vector, the fourth key vector, and the fourth value vector.

[0189] In some exemplary embodiments, after obtaining the first feature, the second feature, the third feature, and the fourth feature, the computer device may first determine the long-term behavior sequence representation based on the first feature and the second feature, and then determine the short-term behavior sequence representation based on the long-term behavior sequence representation and the third feature. Figure 7 As shown, after obtaining the short-term behavior sequence representation, the computer device may further determine a fourth query vector according to the fourth feature 104 , and determine a fourth key vector and a fourth value vector according to the short-term behavior sequence representation 107 .

[0190] Specifically, the computer device may perform a linear transformation on the fourth feature through the video recommendation model to obtain a fourth query vector, and perform a linear transformation on the short-term behavior sequence representation to obtain a fourth key vector and a fourth value vector.

[0191] Furthermore, after obtaining the fourth query vector, the fourth key vector and the fourth value vector, the computer device may perform attention processing on the fourth query vector, the fourth key vector and the fourth value vector based on the video recommendation model to obtain the short-term interest feature 108.

[0192] Specifically, the short-term interest feature can be expressed as e local , then based on the fourth query vector, the fourth key vector and the fourth value vector, attention processing is performed to obtain the short-term interest feature which can be expressed as ,in, is the fourth query vector, s locall are the fourth key vector and the fourth value vector, T is the matrix transpose symbol, d4 is the dimension of the fourth key vector, and softmax is the function.

[0193] The above method determines the fourth query vector based on the fourth feature; determines the fourth key vector and the fourth value vector respectively according to the short-term behavior sequence representation; performs attention processing based on the fourth query vector and the fourth value vector to obtain the short-term interest feature. Based on the attention processing, the short-term interest feature is determined using the fourth feature and the short-term behavior sequence representation, so that the accuracy of the determined short-term interest feature is higher, and thus the recommendation decision result of the candidate video determined based on the short-term interest feature is higher, thereby improving the accuracy of the video recommendation method.

[0194] In an exemplary embodiment, the long-term interest feature and the short-term interest feature are fused to obtain the user interest feature corresponding to the candidate video, including: determining a first fusion coefficient of the long-term interest feature based on the first feature, the fourth feature, the long-term interest feature and the short-term interest feature; determining a second fusion coefficient of the short-term interest feature based on the first fusion coefficient; and fusing the long-term interest feature and the short-term interest feature based on the first fusion coefficient and the second fusion coefficient to obtain the user interest feature corresponding to the candidate video.

[0195] The first fusion coefficient is used to indicate the weight value of the long-term interest feature in the process of fusing the long-term interest feature and the short-term interest feature.

[0196] The second fusion coefficient is used to indicate the weight value of the short-term interest feature in the process of fusing the long-term interest feature and the short-term interest feature.

[0197] In some exemplary embodiments, after obtaining the first feature, the second feature, the third feature, and the fourth feature, the computer device may first determine the long-term interest feature and the short-term interest feature based on the first feature, the second feature, the third feature, and the fourth feature. Figure 8 As shown, after determining the long-term interest feature and the short-term interest feature, the computer device can determine the first fusion coefficient of the long-term interest feature based on the pre-trained adaptive fusion network model 801, the first feature 101, the fourth feature 104, the long-term interest feature 106 and the short-term interest feature 108.

[0198] Specifically, the computer device can input the first feature, the fourth feature, the long-term interest feature and the short-term interest feature into the adaptive fusion network model pre-trained in the video recommendation model, and determine the first fusion coefficient based on the first feature, the fourth feature, the long-term interest feature and the short-term interest feature through the adaptive fusion network model.

[0199] Furthermore, after determining the first fusion coefficient, the computer device can determine the second fusion coefficient of the short-term interest feature based on the first fusion coefficient, and fuse the long-term interest feature 106 and the short-term interest feature 108 based on the first fusion coefficient and the second fusion coefficient to obtain the user interest feature 109 corresponding to the candidate video.

[0200] Specifically, the computer device can process the long-term interest features based on the first fusion coefficient through the video recommendation model, and process the short-term interest features based on the second fusion coefficient through the video recommendation model, and then determine the user interest features corresponding to the candidate video based on the processed long-term interest features and the processed short-term interest features based on the video recommendation model.

[0201] The above method determines the first fusion coefficient of the long-term interest feature based on the first feature, the fourth feature, the long-term interest feature and the short-term interest feature; determines the second fusion coefficient of the short-term interest feature based on the first fusion coefficient; and fuses the long-term interest feature and the short-term interest feature based on the first fusion coefficient and the second fusion coefficient to obtain the user interest feature corresponding to the candidate video. Since the long-term interest feature and the short-term interest feature have high accuracy, the user interest feature obtained by fusing the long-term interest feature and the short-term interest feature has high accuracy, thereby improving the accuracy of the recommendation decision of the candidate video determined based on the user interest feature.

[0202] In an exemplary embodiment, the first fusion coefficient of the long-term interest feature is determined based on the first feature, the fourth feature, the long-term interest feature and the short-term interest feature, including: performing a connection operation on the first feature, the fourth feature, the long-term interest feature and the short-term interest feature based on a connection function to obtain a fusion vector; performing a nonlinear transformation processing on the fusion vector based on a multi-perception layer function to obtain a fusion feature of the fusion vector; and compressing the range of the fusion feature based on a compression function to obtain the first fusion coefficient of the long-term interest feature.

[0203] The multi-layer perceptron function refers to a function corresponding to a multi-layer perceptron. Specifically, the function may be an MLP (Multilayer Perceptron) function.

[0204] The compression function can be used to convert the fused feature into a value within a specific range. Specifically, the compression function can be a sigmoid function, and the feature range can be 0-1.

[0205] In some exemplary embodiments, after obtaining the first feature, the second feature, the third feature, and the fourth feature, the computer device may first determine the long-term interest feature and the short-term interest feature based on the first feature, the second feature, the third feature, and the fourth feature.

[0206] Furthermore, the computer device may perform a connection operation on the first feature, the fourth feature, the long-term interest feature, and the short-term interest feature based on a connection function through a video recommendation model to obtain a fusion vector.

[0207] Specifically, the connection function can be a concat function, and the fusion vector can be expressed as .

[0208] After the computer device performs a connection operation on the first feature, the fourth feature, the long-term interest feature and the short-term interest feature based on the connection function to obtain a fusion vector, the computer device can also use a video recommendation model to perform nonlinear transformation processing on the fusion vector based on a multi-perception layer function to obtain a fusion feature of the fusion vector.

[0209] Specifically, the multi-perception layer function can be expressed as , then the fusion vector is processed nonlinearly based on the multi-perception layer function, and the fusion feature of the fusion vector can be expressed as .

[0210] Furthermore, after obtaining the fusion feature of the fusion vector, the computer device may also compress the range of the fusion feature based on the compression function through the video recommendation model to obtain the first fusion coefficient of the long-term interest feature.

[0211] Specifically, the compression function can be expressed as , the first fusion coefficient can be expressed as , then based on the compression function, the range of the fusion feature is compressed, and the first fusion coefficient of the long-term interest feature is obtained, which can be expressed as .

[0212] The above-mentioned method connects the first feature, the fourth feature, the long-term interest feature and the short-term interest feature based on the connection function to obtain a fusion vector; performs nonlinear transformation processing on the fusion vector based on the multi-perception layer function to obtain the fusion feature of the fusion vector; compresses the range of the fusion feature based on the compression function to obtain the first fusion coefficient of the long-term interest feature. The fusion vector is first determined by the first feature, the fourth feature, the long-term interest feature and the short-term interest feature, and then the first fusion coefficient is determined based on the fusion vector, so that the reliability of the determined first fusion coefficient is higher, and thus the accuracy of the user interest feature determined based on the first fusion coefficient is higher.

[0213] In an exemplary embodiment, the first fusion coefficient is a positive number less than 1, and the second fusion coefficient is the difference between the value 1 and the first fusion coefficient; the long-term interest feature and the short-term interest feature are fused based on the first fusion coefficient and the second fusion coefficient to obtain the user interest feature corresponding to the candidate video, including: weighting the long-term interest feature based on the first fusion coefficient, and weighting the short-term interest feature based on the second fusion coefficient; summing the weighted long-term interest feature and the weighted short-term interest feature to obtain the user interest feature corresponding to the candidate video.

[0214] For example, as mentioned above, the first fusion coefficient can be expressed as , the second fusion coefficient can be expressed as , since the second fusion coefficient is the difference between the value 1 and the first fusion coefficient, then .

[0215] In some exemplary embodiments, after determining the first fusion coefficient and the second fusion coefficient, the computer device may perform weighted processing on the long-term interest feature based on the first fusion coefficient through a video recommendation model, and perform weighted processing on the short-term interest feature based on the second fusion coefficient through a video recommendation model.

[0216] Specifically, the long-term interest feature can be expressed as e global , the short-term interest feature can be expressed as e local , then the weighted processing of the long-term interest feature based on the first fusion coefficient can be expressed as , the weighted processing of the short-term interest feature based on the second fusion coefficient can be expressed as .

[0217] Furthermore, after the computer device performs weighted processing on the long-term interest feature based on the first fusion coefficient through the video recommendation model, and performs weighted processing on the short-term interest feature based on the second fusion coefficient through the video recommendation model, it can also sum the weighted long-term interest feature and the weighted short-term interest feature based on the video recommendation model to obtain the user interest feature corresponding to the candidate video.

[0218] Specifically, user interest features can be expressed as e fusion , then the weighted long-term interest features and weighted short-term interest features are summed to obtain the user interest features corresponding to the candidate video, which can be expressed as .

[0219] The above method performs weighted processing on the long-term interest feature based on the first fusion coefficient, and performs weighted processing on the short-term interest feature based on the second fusion coefficient; summing the weighted long-term interest feature and the weighted short-term interest feature to obtain the user interest feature corresponding to the candidate video, determines the user interest feature based on the first fusion coefficient, the second fusion coefficient, the long-term interest feature and the short-term interest feature, so that the determined user interest feature has higher accuracy, and thus the recommendation decision result of the candidate video determined based on the user interest feature has higher accuracy.

[0220] In an exemplary embodiment, determining a recommendation decision result for the candidate video based on the user interest feature includes: obtaining an object feature and a context feature characterizing the playback scenario of the source video; inputting the first feature, the fourth feature, the context feature, the object feature, and the user interest feature into a multi-target network to obtain multiple scores of the candidate video under multiple preset indicators output by the multi-target network; determining a target score for the candidate video based on the multiple scores of the candidate video under the multiple preset indicators, and determining a recommendation decision result for the candidate video based on the target score.

[0221] The object feature can be used to indicate the multi-dimensional attribute information of the user. For example, the multi-dimensional attribute information may include the user's ID attribute information, the user's age attribute information, the user's address attribute information, the user's playback device attribute information, etc.

[0222] The contextual features of the playback scenario of the source video can be used to indicate multi-dimensional attribute information of the playback scenario of the source video. Exemplarily, the multi-dimensional attribute information may include playback time attribute information of the playback scenario, playback address attribute information of the playback scenario, network environment attribute information of the playback scenario, and trigger event attribute information of the playback scenario.

[0223] Specifically, the play time attribute information of the playback scenario can be used to indicate the play time of the source video, the play address attribute information of the playback scenario can be used to indicate the address of the user's location when the source video is played, the network environment attribute information of the playback scenario can be used to indicate the network environment of the computer device when the source video is played, and the trigger event attribute information of the playback scenario can be used to indicate the path of the source video. For example, the user can search for the source video through the search bar in the video application and trigger the computer device to play the source video. For another example, after the user opens the video application, the video application can also recommend some videos to the user. The user triggers one of the videos based on actual needs to play the video on the computer device.

[0224] A multi-objective network refers to a neural network model that can handle multiple target tasks simultaneously. Exemplarily, the multiple target tasks correspond to multiple preset indicators.

[0225] The preset indicators can be indicators pre-set by technical personnel based on actual needs, and are used to measure the effects of users on candidate videos in multiple dimensions. For example, the preset indicators can measure the effects of users on candidate videos in dimensions such as user engagement, recommendation effect evaluation, and user loyalty. Specifically, user engagement may include click-through rate, playback time, completion rate, like rate, comment rate, and collection rate. The recommendation effect evaluation may include the recommendation recall rate, that is, whether the recommended candidate video can meet the user's potential interests and be accepted by the user. User loyalty includes user retention rate, that is, whether the user will continue to use the video application after playing the recommended candidate video.

[0226] In some exemplary embodiments, after determining the user interest feature, the computer device may obtain an object feature and a context feature that can characterize the playback scenario of the source video. The computer device may input the first feature, the fourth feature, the context feature, the object feature, and the user interest feature into a multi-objective network in a video recommendation model to obtain multiple scores for the candidate videos output by the multi-objective network under multiple preset indicators.

[0227] Specifically, such as Figure 9 As shown, Figure 9 The structure of the multi-target network is shown. The computer device can first splice the first feature, the fourth feature, the context feature, the object feature and the user interest feature, and then input the spliced features 901 into the expert network layer 903 in the multi-target network 902. The expert network layer 903 includes multiple expert network sublayers 9031, each of which includes three expert networks and two gating networks. Figure 9 In the multi-objective network 902, there are expert network A, expert sharing network, and expert network B. Expert network A is connected to one of the gating networks, expert network B is connected to the other gating network, and the expert sharing network is connected to both gating networks. The computer inputs the spliced features 901 into the expert network layer 903 in the multi-objective network 902. Specifically, the spliced features 901 are input into the expert network A, the expert sharing network, and the expert network B. The output of expert network A will serve as the input of the gating network connected to expert network A, the output of expert network B will serve as the input of the gating network connected to expert network B, the output of the expert sharing network will serve as the input of the two gating networks, and the output of the two gating networks will serve as the input of the next expert network sublayer 9031. The above steps are repeated.

[0228] The multi-target network 902 also includes a perception layer 904 and a random network layer 905. The random network layer 905 includes two activation function layers and an operation layer. The activation function layers are respectively a relu activation function layer and a sigmoid activation function layer. The operation layer indicates a multiplication operation with 2. The input of the random network layer 905 is also the splicing feature 903. The perception layer 904 includes two groups of multi-layer perceptron layers. The output of the expert network layer 903 includes a first output based on the expert network A and the expert sharing network, a second output based on the expert network B and the expert sharing network, and the output of the random network layer 905. The first output and the output of the random network layer 905 can be used as inputs to the multi-layer perceptron layer, and the second output and the output of the random network layer 905 can be used as inputs to the multi-layer perceptron layer to obtain two scores of the candidate video under two preset indicators.

[0229] Among them, the output of the random network layer can be expressed as RP out ,Should ,and ,in, , input is the concatenated feature, W1 is the weight matrix for input, b is the bias vector, ReLU is the relu function in the rectified linear unit function, and W2 is the weight matrix for x. is a hyperparameter and Sigmoid is an activation function.

[0230] Furthermore, after obtaining the multiple scores of the candidate video under multiple preset indicators output by the multi-objective network, the computer device can determine a target score for the candidate video based on the multiple scores of the candidate video under the multiple preset indicators. Specifically, the computer device fuses the multiple scores using an index to obtain the target score for the candidate video.

[0231] Furthermore, after obtaining the target score, the computer device may determine a recommendation decision result for the candidate video based on the target score. Specifically, the computer device may first obtain other scores of other candidate videos, and then sort the candidate video and the other candidate videos in descending order of scores based on the target score and the other scores to obtain sorting information for the candidate video. If the sorting information indicates that the sequence number of the candidate video is less than or equal to the preset sequence number, the recommendation decision result for the candidate video is determined to be recommended; otherwise, the recommendation decision result for the candidate video is determined to be not recommended.

[0232] The above-mentioned method obtains object features and context features that characterize the playback scenario of the source video; inputs the first feature, the fourth feature, the context feature, the object feature and the user interest feature into a multi-target network to obtain multiple scores of the candidate video under multiple preset indicators output by the multi-target network; determines the target score of the candidate video according to the multiple scores of the candidate video under the multiple preset indicators, and determines the recommendation decision result of the candidate video according to the target score. Since the target score is determined according to the multiple scores of the candidate video under the multiple preset indicators, the reliability and accuracy of the target score are improved, thereby improving the accuracy of the video recommendation method.

[0233] In an exemplary embodiment, the method further includes: obtaining a first original feature of a source video, a second original feature of each historical playback video in a historical playback video sequence, a third original feature of a sub-video sequence in the historical playback video sequence, a fourth original feature of a candidate video, an object original feature, and a context original feature; and performing vector embedding on the first original feature, the second original feature, the third original feature, the fourth original feature, the object original feature, and the context original feature, respectively, to obtain a first feature, a second feature, a third feature, a fourth feature, an object feature, and a context feature, respectively.

[0234] Vector embedding refers to a method that can convert high-dimensional sparse vectors into low-dimensional dense vectors.

[0235] In some exemplary embodiments, when there is a need for video recommendation, the computer device may first obtain the first original features of the source video, the second original features of each historical playback video in the historical playback video sequence, the third original features of the sub-video sequence in the historical playback video sequence, the fourth original features of the candidate video, the object original features and the context original features.

[0236] Furthermore, after obtaining the first original feature, the second original feature, the third original feature, the fourth original feature, the object original feature and the context original feature, the computer device can perform vector embedding on the first original feature, the second original feature, the third original feature, the fourth original feature, the object original feature and the context original feature based on the video recommendation model to obtain the first feature, the second feature, the third feature, the fourth feature, the object feature and the context feature, respectively.

[0237] Specifically, the computer device can use a search method to build a key embedding table and randomly initialize learnable parameters for each key. These parameters eventually constitute a dense embedding vector corresponding to the original features, that is, the first feature, the second feature, the third feature, the fourth feature, the object feature, and the context feature.

[0238] The above method obtains the first original feature of the source video, the second original feature of each historical playback video in the historical playback video sequence, the third original feature of the sub-video sequence in the historical playback video sequence, the fourth original feature of the candidate video, the object original feature and the context original feature; and respectively performs vector embedding on the first original feature, the second original feature, the third original feature, the fourth original feature, the object original feature and the context original feature to obtain the first feature, the second feature, the third feature, the fourth feature, the object feature and the context feature, respectively. Through vector embedding, the original features can be converted into low-dimensional dense vectors that can be better processed by the model, thereby improving the processing efficiency of the model.

[0239] In an exemplary embodiment, the method further includes: obtaining historical playback records; determining information of historical playback videos based on the historical playback records; obtaining the source video information; and constructing a historical playback video sequence using the information of the historical playback videos and the information of the source video.

[0240] The historical playback record is used to record historical playback videos.

[0241] In some exemplary embodiments, the computer device needs to construct the historical playback video sequence before obtaining the second feature of the historical playback video sequence.

[0242] Specifically, the computer device may first obtain the user's historical playback records, and obtain information about the historically played videos recorded in the historical playback records.

[0243] Furthermore, the computer device needs to obtain source video information of the source video and construct a historical playback video sequence based on the source video information and information of the historical playback video.

[0244] The above method of obtaining historical playback records; determining the information of historical playback videos based on the historical playback records; obtaining the source video information; and constructing a historical playback video sequence using the information of the historical playback videos and the information of the source video, because the constructed historical playback video sequence includes both historical playback videos and source videos, introduces the user's real-time behavior into the historical playback video sequence, enhances timeliness, and thereby effectively improves the accuracy of the video recommendation method.

[0245] In an exemplary embodiment, Figure 10 As shown, another video recommendation method is provided, which is executed by a computer device and includes the following steps:

[0246] S1001. Obtain historical playback records; determine the information of historical playback videos based on the historical playback records; obtain the source video information; use the information of the historical playback videos and the information of the source video to construct a historical playback video sequence; obtain the first original feature of the source video, the second original feature of each historical playback video in the historical playback video sequence, the third original feature of the sub-video sequence in the historical playback video sequence, the fourth original feature of the candidate video, the object original feature and the context original feature; perform vector embedding on the first original feature, the second original feature, the third original feature, the fourth original feature, the object original feature and the context original feature, respectively, to obtain the first feature, the second feature, the third feature, the fourth feature, the object feature and the context feature, respectively.

[0247] The historical playback record is used to record historical playback videos; the sub-video sequence is a video sequence composed of a portion of historical videos in the historical playback video sequence up to the current time.

[0248] In some exemplary embodiments, when there is a demand for video recommendation, the computer device can first obtain the user's historical playback records, and obtain the information of the historical playback videos recorded in the historical playback records, as well as the source video information of the source video, and construct a historical playback video sequence based on the source video information and the information of the historical playback videos.

[0249] Further, if Figure 11 As shown, the computer device can obtain the first original feature of the source video, the second original feature of each historical playback video in the historical playback video sequence, the third original feature of the sub-video sequence in the historical playback video sequence, the fourth original feature of the candidate video, the object original feature and the context original feature, and input the first original feature, the second original feature, the third original feature, the fourth original feature, the object original feature and the context original feature into the video recommendation model 1101. The video recommendation model 1101 can perform vector embedding on the first original feature, the second original feature, the third original feature, the fourth original feature, the object original feature and the context original feature based on the vector embedding layer 1102, and obtain the first feature 101, the second feature 102, the third feature 103, the fourth feature 104, the object feature and the context feature 1103 respectively.

[0250] S1002. Determine a first query vector based on the first feature, and input the first query vector into the attention encoder; determine a first key vector and a first value vector based on the second feature, respectively, and input the first key vector and the first value vector into the attention encoder; encode the first query vector, the first key vector, and the first value vector through the attention encoder to obtain a long-term behavior sequence representation.

[0251] The long-term behavior sequence representation indicates the degree of relevance between each historically played video in the historically played video sequence and the source video.

[0252] In some exemplary embodiments, Figure 11 As shown, the computer device can determine the first feature as the first query vector Q1 and the second feature as the first key vector K1 and the first value vector V1 through the video recommendation model 1101, and input the first query vector Q1, the first key vector K1 and the first value vector V1 into the attention encoder 401 of the video recommendation model 1101, so as to encode the first query vector Q1, the first key vector K1 and the first value vector V1 through the attention encoder 401 to obtain the long-term behavior sequence representation 105.

[0253] S1003. Determine a second query vector based on the fourth feature; determine a second key vector and a second value vector based on the long-term behavior sequence representation; perform attention processing based on the second query vector, the second key vector and the second value vector to obtain a long-term interest feature.

[0254] In some exemplary embodiments, Figure 11 As shown, the computer device can determine the fourth feature as the second query vector Q2 and determine the long-term behavior sequence representation as the second key vector K2 and the second value vector V2 through the video recommendation model 1101.

[0255] Furthermore, the computer device may also perform attention processing based on the second query vector Q2, the second key vector K2 and the second value vector V2 through the video recommendation model 1101 to obtain the long-term interest feature 106.

[0256] S1004. Determine a third query vector based on the third feature, and input the third query vector into the interest attention network; determine a third key vector and a third value vector based on the long-term behavior sequence representation, respectively, and input the third key vector and the third value vector into the interest attention network; perform attention processing on the third query vector, the third key vector, and the third value vector through the interest attention network to obtain a short-term behavior sequence representation.

[0257] The short-term behavior sequence representation indicates the degree of correlation between each historically played video in the historically played video sequence and each video in the sub-video sequence.

[0258] In some exemplary embodiments, Figure 11As shown, the computer device can determine the third feature as the third query vector Q3 through the video recommendation model 1101, and determine the long-term behavior sequence representation as the third key vector K3 and the third value vector V3, and input the third query vector Q3, the third key vector K3 and the third value vector V3 into the interest attention network 601 in the video recommendation model 1101, so as to perform attention processing on the third query vector Q3, the third key vector K3 and the third value vector V3 through the interest attention network 601 to obtain the short-term behavior sequence representation 107.

[0259] S1005 , determining a fourth query vector based on the fourth feature; determining a fourth key vector and a fourth value vector based on the short-term behavior sequence representation respectively; performing attention processing based on the fourth query vector and the fourth value vector to obtain a short-term interest feature.

[0260] In some exemplary embodiments, Figure 11 As shown, the computer device can determine the fourth feature as a fourth query vector Q4 and determine the short-term behavior sequence representation as a fourth key vector K4 and a fourth value vector V4 through the video recommendation model 1101.

[0261] Furthermore, the computer may perform attention processing based on the fourth query vector Q4, the fourth key vector K4 and the fourth value vector V4 through the video recommendation model 1101 to obtain the short-term interest feature 108.

[0262] S1006. Perform a connection operation on the first feature, the fourth feature, the long-term interest feature and the short-term interest feature based on a connection function to obtain a fusion vector; perform a nonlinear transformation on the fusion vector based on a multi-perception layer function to obtain a fusion feature of the fusion vector; compress the range of the fusion feature based on a compression function to obtain a first fusion coefficient of the long-term interest feature; determine a second fusion coefficient of the short-term interest feature based on the first fusion coefficient; perform weighted processing on the long-term interest feature based on the first fusion coefficient, and perform weighted processing on the short-term interest feature based on the second fusion coefficient; sum the weighted long-term interest feature and the weighted short-term interest feature to obtain a user interest feature corresponding to the candidate video.

[0263] The first fusion coefficient is a positive number less than 1, and the second fusion coefficient is the difference between the value 1 and the first fusion coefficient.

[0264] In some exemplary embodiments, the computer device connects the first feature, the fourth feature, the long-term interest feature and the short-term interest feature through the adaptive fusion network 801 in the video recommendation model 1101 based on the connection function to obtain a fusion vector, and performs nonlinear transformation processing on the fusion vector based on a multi-perception layer function to obtain a fusion feature of the fusion vector, and then compresses the range of the fusion feature based on a compression function to obtain a first fusion coefficient of the long-term interest feature.

[0265] Furthermore, the computer device determines the second fusion coefficient of the short-term interest feature based on the first fusion coefficient through the adaptive fusion network 801 in the video recommendation model 1101, performs weighted processing on the long-term interest feature based on the first fusion coefficient, and performs weighted processing on the short-term interest feature based on the second fusion coefficient, and then sums the weighted long-term interest feature and the weighted short-term interest feature to obtain the user interest feature corresponding to the candidate video.

[0266] S1007. Obtain object features and context features that characterize the playback scenario of the source video; input the first feature, the fourth feature, the context feature, the object feature, and the user interest feature into a multi-target network to obtain multiple scores of the candidate video under multiple preset indicators output by the multi-target network; determine a target score for the candidate video based on the multiple scores of the candidate video under the multiple preset indicators, and determine a recommendation decision result for the candidate video based on the target score.

[0267] In some exemplary embodiments, Figure 11 As shown, the computer device can input the first feature, the fourth feature, the context feature, the object feature and the user interest feature into the multi-target network 902 in the video recommendation model 1101 to obtain multiple scores of the candidate video output by the multi-target network 902 under multiple preset indicators.

[0268] Furthermore, the computer device can determine the target score of the candidate video according to the multiple scores of the candidate video under the multiple preset indicators through the multi-target network 902 in the video recommendation model 1101, and determine the recommendation decision result of the candidate video according to the target score.

[0269] In a video recommendation application scenario, when a user has a need to watch a video, the video application installed on the computer device can be triggered first. The computer device responds to the user's triggering operation and displays the function page of the video application. The user can select the video to be played based on the function page and click on the video. The computer device responds to the user's click operation on the video and displays the playback page of the video, plays the video in the form of a thumbnail on the playback page, and displays the recommended video determined based on the video recommendation method on the playback page.

[0270] Specifically, the computer device can first obtain the user's historical playback records, and obtain the information of the historical playback videos recorded in the historical playback records, as well as the source video information of the source video played on the playback page, and construct a historical playback video sequence based on the source video information and the information of the historical playback videos. The computer device can then obtain the first original feature of the source video, the second original feature of each historical playback video in the historical playback video sequence, the third original feature of the sub-video sequence in the historical playback video sequence, the fourth original feature of the candidate video, the object original feature and the context original feature, and input the first original feature, the second original feature, the third original feature, the fourth original feature, the object original feature and the context original feature into the video recommendation model. The video recommendation model can perform vector embedding on the first original feature, the second original feature, the third original feature, the fourth original feature, the object original feature and the context original feature based on the vector embedding layer, and obtain the first feature, the second feature, the third feature, the fourth feature, the object feature and the context feature respectively.

[0271] Furthermore, the computer device can determine the first feature as a first query vector through the video recommendation model, and determine the second feature as a first key vector and a first value vector, and input the first query vector, the first key vector and the first value vector into the attention encoder of the video recommendation model, so as to encode the first query vector, the first key vector and the first value vector through the attention encoder to obtain a long-term behavior sequence representation.

[0272] Next, the computer device determines the fourth feature as a second query vector through the video recommendation model, and determines the long-term behavior sequence representation as a second key vector and a second value vector, and performs attention processing based on the second query vector, the second key vector and the second value vector through the video recommendation model to obtain a long-term interest feature.

[0273] Furthermore, the computer device can also determine the third feature as a third query vector through the video recommendation model, and determine the long-term behavior sequence representation as a third key vector and a third value vector, and input the third query vector, the third key vector and the third value vector into the interest attention network in the video recommendation model, so as to perform attention processing on the third query vector, the third key vector and the third value vector through the interest attention network to obtain the short-term behavior sequence representation.

[0274] Then, the computer device can determine the fourth feature as a fourth query vector through the video recommendation model, and determine the short-term behavior sequence representation as a fourth key vector and a fourth value vector, and perform attention processing based on the fourth query vector and the fourth value vector through the video recommendation model to obtain short-term interest features.

[0275] Furthermore, after obtaining the long-term interest feature and the short-term interest feature, the computer device can connect the first feature, the fourth feature, the long-term interest feature, and the short-term interest feature through an adaptive fusion network in the video recommendation model based on a connection function to obtain a fusion vector, perform nonlinear transformation processing on the fusion vector based on a multi-perceptual layer function to obtain a fusion feature of the fusion vector, and then compress the range of the fusion feature based on a compression function to obtain a first fusion coefficient of the long-term interest feature. The computer device determines a second fusion coefficient of the short-term interest feature based on the first fusion coefficient through the adaptive fusion network in the video recommendation model, performs weighted processing on the long-term interest feature based on the first fusion coefficient, and performs weighted processing on the short-term interest feature based on the second fusion coefficient. Then, the computer device sums the weighted long-term interest feature and the weighted short-term interest feature to obtain the user interest feature corresponding to the candidate video.

[0276] Next, the computer device may input the first feature, the fourth feature, the context feature, the object feature, and the user interest feature into a multi-objective network in the video recommendation model to obtain multiple scores for the candidate video under multiple preset indicators output by the multi-objective network. The computer device then determines a target score for the candidate video based on the multiple scores of the candidate video under the multiple preset indicators using the multi-objective network in the video recommendation model.

[0277] Finally, the computer device can execute the above steps for each candidate video to obtain the target score of each candidate video, and then sort each candidate video based on the target score of each candidate video in descending order of score to obtain the sorting information of each candidate video. If the sorting information indicates that the serial number of the corresponding candidate video is less than or equal to the preset serial number, the recommendation decision result of the candidate video is determined to be recommended; otherwise, the recommendation decision result of the candidate video is determined to be not recommended.

[0278] It should be noted that the video recommendation method provided by this application is not only applicable to video recommendation scenarios, but can also be applied to game recommendation scenarios, music recommendation scenarios, and novel recommendation scenarios. The following will take the music recommendation scenario as an example for detailed description.

[0279] In a music recommendation application scenario, the user can first trigger a visual music application installed on a computer device. The computer device responds to the user's triggering operation by displaying a function page of the music application. The user can select the music to be played based on the function page and click on the music. The computer device responds to the user's click operation on the music by displaying a playback page of the music and displaying recommended music determined based on the music recommendation method on the playback page.

[0280] Specifically, the computer device can first obtain the user's historical playback records, and obtain the information of the historically played music recorded in the historical playback records, as well as the source music information of the source music played on the playback page, and construct a historically played music sequence based on the source music information and the information of the historically played music. The computer device can then obtain the first original feature of the source music, the second original feature of each historically played music in the historically played music sequence, the third original feature of the sub-music sequence in the historically played music sequence, the fourth original feature of the candidate music, the object original feature, and the context original feature, and input the first original feature, the second original feature, the third original feature, the fourth original feature, the object original feature, and the context original feature into the music recommendation model. The music recommendation model can perform vector embedding on the first original feature, the second original feature, the third original feature, the fourth original feature, the object original feature, and the context original feature based on the vector embedding layer, and obtain the first feature, the second feature, the third feature, the fourth feature, the object feature, and the context feature, respectively.

[0281] Furthermore, the computer device can determine the first feature as a first query vector through the music recommendation model, and determine the second feature as a first key vector and a first value vector, and input the first query vector, the first key vector and the first value vector into the attention encoder of the music recommendation model, so as to encode the first query vector, the first key vector and the first value vector through the attention encoder to obtain a long-term behavior sequence representation.

[0282] Next, the computer device determines the fourth feature as a second query vector through the music recommendation model, and determines the long-term behavior sequence representation as a second key vector and a second value vector, and performs attention processing based on the second query vector, the second key vector and the second value vector through the music recommendation model to obtain long-term interest features.

[0283] Furthermore, the computer device can also determine the third feature as a third query vector through the music recommendation model, and determine the long-term behavior sequence representation as a third key vector and a third value vector, and input the third query vector, the third key vector and the third value vector into the interest attention network in the music recommendation model, so as to perform attention processing on the third query vector, the third key vector and the third value vector through the interest attention network to obtain a short-term behavior sequence representation.

[0284] Then, the computer device can determine the fourth feature as a fourth query vector through the music recommendation model, and determine the short-term behavior sequence representation as a fourth key vector and a fourth value vector, and perform attention processing based on the fourth query vector and the fourth value vector through the music recommendation model to obtain short-term interest features.

[0285] Furthermore, after obtaining the long-term interest feature and the short-term interest feature, the computer device can connect the first feature, the fourth feature, the long-term interest feature, and the short-term interest feature through the adaptive fusion network in the music recommendation model based on a connection function to obtain a fusion vector, perform nonlinear transformation processing on the fusion vector based on a multi-perceptual layer function to obtain a fusion feature of the fusion vector, and then compress the range of the fusion feature based on a compression function to obtain a first fusion coefficient of the long-term interest feature. The computer device determines the second fusion coefficient of the short-term interest feature based on the first fusion coefficient through the adaptive fusion network in the music recommendation model, performs weighted processing on the long-term interest feature based on the first fusion coefficient, and performs weighted processing on the short-term interest feature based on the second fusion coefficient. Then, the computer device sums the weighted long-term interest feature and the weighted short-term interest feature to obtain the user interest feature corresponding to the candidate music.

[0286] Next, the computer device may input the first feature, the fourth feature, the context feature, the object feature, and the user interest feature into a multi-objective network in the music recommendation model to obtain multiple scores for the candidate music under multiple preset indicators output by the multi-objective network. The computer device then determines a target score for the candidate music based on the multiple scores for the candidate music under the multiple preset indicators using the multi-objective network in the music recommendation model.

[0287] Finally, the computer device can execute the above steps for each candidate music to obtain the target score of each candidate music, and then sort each candidate music based on the target score of each candidate music in descending order to obtain the sorting information of each candidate music. If the sorting information indicates that the serial number of the corresponding candidate music is less than or equal to the preset serial number, the recommendation decision result of the candidate music is determined to be recommended; otherwise, the recommendation decision result of the candidate music is determined to be not recommended.

[0288] In an exemplary embodiment, Figure 12 As shown, the method is performed by a computer device, which may be the same as or different from the computer device that performs the video recommendation method. A video recommendation model training method is provided, which includes the following steps:

[0289] S1201. Obtain a first training feature of a training source video, a second training feature of each training history playback video in a training history playback video sequence, a third training feature of a training sub-video sequence in the training history playback video sequence, and a fourth training feature of a training candidate video.

[0290] The training source video refers to a video used as a source video in the training process of the video recommendation model. The first feature of the training source video can be used to indicate multi-dimensional attribute information of the training source video.

[0291] Exemplarily, the first feature of the training source video can be used to indicate attribute information of the training source video content form dimension, attribute information of the subject matter type dimension, attribute information of the production background dimension, etc.

[0292] The training history playback video sequence refers to a sequence used as a history playback video sequence during the training process of the video recommendation model.

[0293] The second feature of each training history playback video in the training history playback video sequence can be used to indicate multi-dimensional attribute information of each training history playback video.

[0294] Exemplarily, the second feature of each training history playback video in the training history playback video sequence can be used to indicate the attribute information of the content form dimension, the attribute information of the subject type dimension, the attribute information of the production background dimension, etc. of each training history playback video in the training history playback video sequence.

[0295] The training history playback videos refer to videos that are played as history playback videos during the training process of the video recommendation model.

[0296] The training sub-video sequence refers to a sequence used as a sub-video sequence in the training process of the video recommendation model.

[0297] For example, the training sub-video sequence refers to a set of training history playback videos in the training history playback video sequence that meet preset conditions, such as time conditions, playback times conditions, content form conditions, and subject matter type conditions.

[0298] The third feature of the training sub-video sequence in the training history playback video sequence can be used to indicate multi-dimensional attribute information of the training sub-video sequence in the training history playback video sequence. For example, the third feature of the training sub-video sequence in the training history playback video sequence can be used to indicate attribute information of the content form dimension, attribute information of the subject matter type dimension, attribute information of the production background dimension, etc. of the training sub-video sequence in the training history playback video sequence.

[0299] A training candidate video refers to a video that serves as a candidate video during the training process of a video recommendation model.

[0300] The fourth feature of the candidate training video can be used to indicate multi-dimensional attribute information of the candidate training video. For example, the fourth feature of the candidate training video can be used to indicate attribute information of the content form dimension, attribute information of the subject type dimension, attribute information of the production background dimension, etc.

[0301] In some exemplary embodiments, Figure 13 As shown, the computer device can obtain the first training original feature of the training source video, the second training original feature of each training historical playback video in the training historical playback video sequence, the third training original feature of the training sub-video sequence in the training historical playback video sequence, the fourth training original feature of the training candidate video, the training object original feature and the training context original feature, and input the first training original feature, the second training original feature, the third training original feature, the fourth training original feature, the training object original feature and the training context original feature into the video recommendation model 1301 to be trained. The video recommendation model 1301 can perform vector embedding on the first training original feature, the second training original feature, the third training original feature, the fourth training original feature, the training object original feature and the training context original feature based on the vector embedding layer 1302, and obtain the training first feature 1303, the training second feature 1304, the training third feature 1305, the training fourth feature 1306, the training object feature and the training context feature 1307 respectively.

[0302] S1202: Encoding is performed based on the first training feature and the second training feature through the video recommendation model to be trained to obtain a training long-term behavior sequence representation, and generating a training long-term interest feature based on the training long-term behavior sequence representation and the fourth training feature.

[0303] The training long-term behavior sequence representation can be used to indicate the degree of relevance between each training history playback video in the training history playback video sequence and the training source video.

[0304] The trained long-term interest features can be used to characterize the user's long-term interest preferences for videos during the training process.

[0305] In some exemplary embodiments, Figure 13 As shown, the computer device encodes the video recommendation model to be trained 1301 based on the first training feature and the second training feature to obtain a training long-term behavior sequence representation 1308.

[0306] Specifically, the computer device may perform encoding based on the first training feature and the second training feature through the attention encoder in the video recommendation model 1301 to be trained to obtain a training long-term behavior sequence representation.

[0307] Furthermore, the computer device may also generate a training long-term interest feature based on the training long-term behavior sequence representation and the fourth training feature through the video recommendation model 1301 to be trained.

[0308] Specifically, the computer device may also perform attention processing based on the training long-term behavior sequence representation and the fourth training feature through the video recommendation model to be trained 1301 to obtain the training long-term interest feature 1309 .

[0309] S1203. Perform attention processing on the third training feature and the training long-term behavior sequence representation through the video recommendation model to be trained to obtain a training short-term behavior sequence representation, and generate a training short-term interest feature based on the training short-term behavior sequence representation and the fourth training feature.

[0310] The training short-term behavior sequence representation can be used to indicate the degree of relevance between each training history playback video in the training history playback video sequence and each video in the training sub-video sequence.

[0311] The trained short-term interest features can be used to characterize the user's short-term interest preferences for videos during the training process.

[0312] In some exemplary embodiments, Figure 13 As shown, the computer device performs attention processing on the third training feature and the training long-term behavior sequence representation through the video recommendation model to be trained 1301 to obtain the training short-term behavior sequence representation 1310.

[0313] Specifically, the computer device can perform attention processing on the third training feature and the training long-term behavior sequence representation through the interest attention network in the video recommendation model 1301 to be trained to obtain the training short-term behavior sequence representation.

[0314] Furthermore, the computer device may also generate a training short-term interest feature 1311 based on the training short-term behavior sequence representation and the fourth training feature through the video recommendation model 1301 to be trained.

[0315] Specifically, the computer device may also perform attention processing based on the training short-term behavior sequence representation and the fourth training feature through the video recommendation model 1301 to be trained to obtain the training short-term interest feature.

[0316] S1204. Using a relational attention network, update the training long-term interest feature and the training short-term interest feature based on the dependency relationship between the training long-term behavior sequence representation and the training short-term behavior sequence representation to obtain updated long-term interest features and updated short-term interest features.

[0317] The relational attention network is part of the video recommendation model to be trained.

[0318] In some exemplary embodiments, Figure 13 As shown, the computer device can update the training long-term interest features and the training short-term interest features based on the dependency relationship between the training long-term behavior sequence representation and the training short-term behavior sequence representation through the relational attention network 1312 in the video recommendation model 1301 to be trained, and obtain the updated long-term interest features 1313 and the updated short-term interest features 1314.

[0319] In an optional embodiment, the training long-term interest feature and the training short-term interest feature are updated based on the dependency relationship between the training long-term behavior sequence representation and the training short-term behavior sequence representation through a relational attention network to obtain updated long-term interest features and updated short-term interest features, including: constructing a relation matrix using the training long-term behavior sequence representation and the training short-term behavior sequence representation, and the relation matrix is used to obtain the dependency relationship between the training long-term behavior sequence representation and the training short-term behavior sequence representation; determining the hidden layer representation of the training long-term interest feature and the hidden layer representation of the training short-term interest feature based on the training long-term behavior sequence representation, the training short-term behavior sequence representation, the first training feature and the relation matrix; determining the updated long-term interest feature that integrates the long-term and short-term interest dependency relationship based on the hidden layer representation of the training long-term interest feature, the training long-term behavior sequence representation and the first feature; determining the updated short-term interest feature that integrates the long-term and short-term interest dependency relationship based on the hidden layer representation of the short-term interest feature, the short-term behavior sequence representation and the first feature.

[0320] For example, the structure of the relational attention network can be as follows Figure 14 As shown, where s global To train long-term behavior sequence representation, s local To train short-term behavior sequence representation, e global To train long-term interest features, e local To train short-term interest features, p global is the updated long-term interest feature, plocal is the updated short-term interest feature, M A is the relationship matrix, W2, W3 and W4 are learnable weight matrices, tanh is the hyperbolic tangent function, e src is the first training feature of the training source video, e tar H is the fourth training feature for training candidate videos. g is the hidden layer representation of long-term interest features, H l is the latent representation of long-term interest features.

[0321] Specifically, the computer device can use the training long-term behavior sequence representation and the training short-term behavior sequence representation to construct a relationship matrix through the relational attention network. The relationship matrix can be expressed as , where T is the matrix transpose symbol, W 1 is a learnable weight matrix.

[0322] Furthermore, the computer device can determine the hidden layer representation of the training long-term interest feature and the hidden layer representation of the training short-term interest feature based on the training long-term behavior sequence representation, the training short-term behavior sequence representation, the first training feature and the relationship matrix. The hidden layer representation of the training long-term interest feature can be expressed as , the hidden layer representation of the short-term interest feature can be expressed as .

[0323] The computer device can determine an updated long-term interest feature that integrates the long-term and short-term interest dependencies based on the hidden layer representation of the training long-term interest feature, the training long-term behavior sequence representation, and the first feature. The updated long-term interest feature can be expressed as ,in, , W5 is the learnable weight matrix, w g is the learnable weight vector.

[0324] The computer device can also determine an updated short-term interest feature that integrates the long-term and short-term interest dependency relationship based on the latent representation of the short-term interest feature, the short-term behavior sequence representation, and the first feature. The updated short-term interest feature can be expressed as ,in, , W6 is the learnable weight matrix, w l is the learnable weight vector.

[0325] S1205: Determine a target loss value according to the trained long-term interest feature, the trained short-term interest feature, the updated long-term interest feature, and the updated short-term interest feature.

[0326] In some exemplary embodiments, the computer device may determine the target loss value based on the trained long-term interest feature, the trained short-term interest feature, the updated long-term interest feature, and the updated short-term interest feature through the long-term and short-term interest comparison learning model 1315 in the video recommendation model to be trained.

[0327] S1206: Adjust the video recommendation model to be trained based on the target loss value.

[0328] In some exemplary real-time scenarios, the parameters of various parts of the video recommendation model to be trained can be adjusted using a stochastic gradient descent algorithm based on the target loss value until the evaluation result indicates that the video recommendation model to be trained has passed the training, thereby obtaining a trained video recommendation model. The trained video recommendation model can be used to perform video recommendations in various video recommendation method embodiments of the present application.

[0329] Specifically, for high-dimensional sparse vectors in the features, a stochastic gradient descent algorithm optimizer with adaptive learning rate can be used, and for low-dimensional dense vectors in the features, an adaptive moment estimation optimizer can be used.

[0330] The above-mentioned first training feature of the training source video, the second training feature of each training history playback video in the training history playback video sequence, the third training feature of the training sub-video sequence in the training history playback video sequence and the fourth training feature of the training candidate video are obtained; through the video recommendation model to be trained, encoding is performed based on the first training feature and the second training feature to obtain a training long-term behavior sequence representation, and a training long-term interest feature is generated based on the training long-term behavior sequence representation and the fourth training feature; through the video recommendation model to be trained, the third training feature and the training long-term behavior sequence representation are subjected to attention processing to obtain a training short-term behavior sequence representation, and a training short-term interest feature is generated based on the training short-term behavior sequence representation and the fourth training feature; through the relational attention network, the training long-term interest feature and the training short-term interest feature are subjected to attention processing based on the dependency relationship between the training long-term behavior sequence representation and the training short-term behavior sequence representation. The method is as follows: the method updates the features to obtain updated long-term interest features and updated short-term interest features; determines the target loss value according to the trained long-term interest features, the trained short-term interest features, the updated long-term interest features and the updated short-term interest features; and adjusts the video recommendation model to be trained based on the target loss value. Since the target loss value is determined according to the trained long-term interest features, the trained short-term interest features, the updated long-term interest features and the updated short-term interest features, the trained short-term interest features can be made closer to the updated trained short-term interest features, and the trained long-term interest features can be made closer to the updated trained long-term interest features. The updated trained short-term interest features and the updated trained long-term interest features are features that integrate long-term and short-term interest dependencies, so that the long-term interest features and short-term interest features output by the trained video recommendation model can integrate long-term and short-term interest dependencies, thereby improving the accuracy of the video recommendation method.

[0331] In an optional embodiment of the present application, the video recommendation model to be trained also includes an adaptive fusion model and a multi-objective network model, and the determination of the loss function of this part is explained using the preset indicators of the multi-objective network model as click-through rate and playback time.

[0332] Among them, the loss function corresponding to the click-through rate can adopt the classification loss function, and the loss function corresponding to the playback time can adopt the regression loss function. Since there is a causal relationship between the click-through rate and the playback time, that is, the user will only generate the playback time behavior after clicking first, therefore, the loss function corresponding to the playback time can be adopted The estimated click multiplied by the estimated time.

[0333] In an exemplary embodiment, after the video recommendation model is trained, the training long-term interest features are similar to the updated long-term interest features, the training short-term interest features are similar to the updated short-term interest features, the training long-term interest features are different from the updated short-term interest features, and the training short-term interest features are different from the updated long-term interest features.

[0334] In some exemplary embodiments, the similarity between the trained long-term interest feature and the updated long-term interest feature, the similarity between the trained short-term interest feature and the updated short-term interest feature, the difference between the trained long-term interest feature and the updated short-term interest feature, and the difference between the trained short-term interest feature and the updated long-term interest feature can be determined based on preset similarity rules.

[0335] Specifically, the preset similarity rules may include 、 、 as well as .

[0336] After the above-mentioned video recommendation model is trained, the training long-term interest feature is similar to the updated long-term interest feature, the training short-term interest feature is similar to the updated short-term interest feature, the training long-term interest feature is different from the updated short-term interest feature, and the training short-term interest feature is different from the updated long-term interest feature. The training short-term interest feature can be closer to the updated training short-term interest feature, and the training long-term interest feature can be closer to the updated training long-term interest feature. The updated training short-term interest feature and the updated training long-term interest feature are features that integrate long-term and short-term interest dependencies, so that the long-term interest features and short-term interest features output by the trained video recommendation model can integrate long-term and short-term interest dependencies, thereby improving the accuracy of the video recommendation method.

[0337] In an exemplary embodiment, the target loss value is determined based on the training long-term interest feature, the training short-term interest feature, the updated long-term interest feature and the updated short-term interest feature, including: determining a first similarity difference between the training long-term interest feature and the updated long-term interest feature and the updated short-term interest feature, and determining a first loss value based on the first similarity difference; determining a second similarity difference between the updated long-term interest feature and the training long-term interest feature and the training short-term interest feature, and determining a second loss value based on the second similarity difference; determining a third similarity difference between the training short-term interest feature and the updated short-term interest feature and the updated long-term interest feature, and determining a third loss value based on the third similarity difference; determining a fourth similarity difference between the updated short-term interest feature and the training short-term interest feature and the training long-term interest feature, and determining a fourth loss value based on the fourth similarity difference; and determining a target loss value based on the first loss value, the second loss value, the third loss value and the fourth loss value.

[0338] In some exemplary embodiments, the computer device may be based on the above-mentioned preset similarity rules. , determine the first similarity difference between the training long-term interest feature and the updated long-term interest feature and the updated short-term interest feature respectively according to the training long-term interest feature, the updated long-term interest feature and the updated short-term interest feature. Specifically, the first similarity difference can be expressed as L1, then .

[0339] The computer device is based on the above preset similarity rules , according to the updated long-term interest feature, the training long-term interest feature and the training short-term interest feature, determine the second similarity difference between the updated long-term interest feature and the training long-term interest feature and the training short-term interest feature. Specifically, the second similarity difference can be expressed as L2, then .

[0340] The computer device is based on the above preset similarity rules , according to the training short-term interest feature, the updated short-term interest feature and the updated long-term interest feature, determine the third similarity difference between the training short-term interest feature and the updated short-term interest feature and the updated long-term interest feature. Specifically, the third similarity difference can be expressed as L3, then .

[0341] The computer device is based on the above preset similarity rules , according to the updated short-term interest feature, the training short-term interest feature and the training long-term interest feature, determine the fourth similarity difference between the updated short-term interest feature and the training short-term interest feature and the training long-term interest feature. Specifically, the fourth similarity difference can be expressed as L4, then .

[0342] Furthermore, the computer device may determine the first similarity difference as a first loss value, the second similarity difference as a second loss value, the third similarity difference as a third loss value, and the fourth similarity difference as a fourth loss value. After determining the first loss value, the second loss value, the third loss value, and the fourth loss value, the computer device may determine a target loss value based on the first loss value, the second loss value, the third loss value, and the fourth loss value.

[0343] Specifically, the maximum value among the first loss value, the second loss value, the third loss value and the fourth loss value can be determined as the target loss value, and the average value of the first loss value, the second loss value, the third loss value and the fourth loss value can also be determined as the target loss value.

[0344] The above-mentioned method of determining the first similarity difference between the training long-term interest feature and the updated long-term interest feature and the updated short-term interest feature, and determining the first loss value according to the first similarity difference; determining the second similarity difference between the updated long-term interest feature and the training long-term interest feature and the training short-term interest feature, and determining the second loss value according to the second similarity difference; determining the third similarity difference between the training short-term interest feature and the updated short-term interest feature and the updated long-term interest feature, and determining the third loss value according to the third similarity difference; determining the fourth similarity difference between the updated short-term interest feature and the training short-term interest feature and the training long-term interest feature, and determining the fourth loss value according to the fourth similarity difference; determining the target loss value according to the first loss value, the second loss value, the third loss value and the fourth loss value, can make the long-term interest features and short-term interest features output by the video recommendation model adjusted based on the target loss value integrate the long-term and short-term interest dependency relationship, thereby improving the accuracy of the video recommendation method.

[0345] It should be noted that the inventors of this application conducted relevant experiments based on the video recommendation method provided in this application. The experimental results show that the video recommendation method provided in this application can effectively improve the accuracy of video recommendation methods. Specifically, as shown in Table 1, Table 1 shows the relevant data of the experimental results. Among them, the offline AUC, also known as the area under the offline curve, is an indicator used to evaluate the performance of video models.

[0346] Table 1

[0347]

[0348] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0349] Based on the same inventive concept, embodiments of the present application also provide a video recommendation device for implementing the aforementioned video recommendation method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more video recommendation device embodiments provided below can be found in the above-mentioned limitations of the video recommendation method and will not be further elaborated here.

[0350] In an exemplary embodiment, Figure 15 As shown, a video recommendation device 1500 is provided, comprising: a first acquisition module 1501, a first execution module 1502, a second execution module 1503, a third execution module 1504 and a first determination module 1505, wherein:

[0351] A first acquisition module 1501 is configured to acquire a first feature of a source video, a second feature of each historically played video in a historically played video sequence, a third feature of a sub-video sequence in the historically played video sequence, and a fourth feature of a candidate video;

[0352] A first execution module 1502 is configured to perform encoding based on the first feature and the second feature to obtain a long-term behavior sequence representation, and generate a long-term interest feature based on the long-term behavior sequence representation and the fourth feature;

[0353] The second execution module 1503 is configured to perform attention processing on the third feature and the long-term behavior sequence representation to obtain a short-term behavior sequence representation, and generate a short-term interest feature based on the short-term behavior sequence representation and the fourth feature;

[0354] The third execution module 1504 is configured to merge the long-term interest feature and the short-term interest feature to obtain the user interest feature corresponding to the candidate video;

[0355] The first determination module 1505 is configured to determine a recommendation decision result for the candidate video based on the user's interest characteristics.

[0356] In one embodiment, the first execution module 1502 is specifically used to determine a first query vector based on the first feature, and input the first query vector into the attention encoder; determine a first key vector and a first value vector based on the second feature respectively, and input the first key vector and the first value vector into the attention encoder; encode the first query vector, the first key vector and the first value vector through the attention encoder to obtain a long-term behavior sequence representation; the long-term behavior sequence representation indicates the degree of relevance between each historical playback video in the historical playback video sequence and the source video.

[0357] In one embodiment, the first execution module 1502 is specifically configured to determine a second query vector based on the fourth feature; and determine a second key vector and a second value vector based on the long-term behavior sequence representation.

[0358] Attention processing is performed based on the second query vector, the second key vector, and the second value vector to obtain a long-term interest feature.

[0359] In one embodiment, the sub-video sequence is a video sequence composed of some historical videos in the historical playback video sequence up to the current time; the second execution module 1503 is specifically used to determine a third query vector based on the third feature, and input the third query vector into the interest attention network; determine a third key vector and a third value vector based on the long-term behavior sequence representation, respectively, and input the third key vector and the third value vector into the interest attention network; perform attention processing on the third query vector, the third key vector and the third value vector through the interest attention network to obtain a short-term behavior sequence representation; the short-term behavior sequence representation indicates the degree of correlation between each historical playback video in the historical playback video sequence and each video in the sub-video sequence.

[0360] In one embodiment, the second execution module 1503 is specifically used to determine a fourth query vector based on the fourth feature; determine a fourth key vector and a fourth value vector based on the short-term behavior sequence representation respectively; perform attention processing based on the fourth query vector and the fourth value vector to obtain a short-term interest feature.

[0361] In one embodiment, the third execution module 1504 is specifically used to determine the first fusion coefficient of the long-term interest feature based on the first feature, the fourth feature, the long-term interest feature and the short-term interest feature; determine the second fusion coefficient of the short-term interest feature based on the first fusion coefficient; and fuse the long-term interest feature and the short-term interest feature based on the first fusion coefficient and the second fusion coefficient to obtain the user interest feature corresponding to the candidate video.

[0362] In one embodiment, the third execution module 1504 is specifically used to perform a connection operation on the first feature, the fourth feature, the long-term interest feature and the short-term interest feature based on a connection function to obtain a fusion vector; perform a nonlinear transformation on the fusion vector based on a multi-perception layer function to obtain a fusion feature of the fusion vector; and compress the range of the fusion feature based on a compression function to obtain a first fusion coefficient of the long-term interest feature.

[0363] In one embodiment, the first fusion coefficient is a positive number less than 1, and the second fusion coefficient is the difference between the value 1 and the first fusion coefficient; the third execution module 1504 is specifically used to weight the long-term interest feature based on the first fusion coefficient, and weight the short-term interest feature based on the second fusion coefficient; the weighted long-term interest feature and the weighted short-term interest feature are summed to obtain the user interest feature corresponding to the candidate video.

[0364] In one embodiment, the determination module 1505 is specifically used to obtain object features and context features that characterize the playback scenario of the source video; input the first feature, the fourth feature, the context feature, the object feature and the user interest feature into a multi-target network to obtain multiple scores of the candidate video output by the multi-target network under multiple preset indicators; determine the target score of the candidate video based on the multiple scores of the candidate video under the multiple preset indicators, and determine the recommendation decision result of the candidate video based on the target score.

[0365] In one embodiment, the acquisition module 1501 is also used to obtain the first original feature of the source video, the second original feature of each historical playback video in the historical playback video sequence, the third original feature of the sub-video sequence in the historical playback video sequence, the fourth original feature of the candidate video, the object original feature and the context original feature; and perform vector embedding on the first original feature, the second original feature, the third original feature, the fourth original feature, the object original feature and the context original feature, respectively, to obtain the first feature, the second feature, the third feature, the fourth feature, the object feature and the context feature, respectively.

[0366] In one embodiment, the acquisition module 1501 is also used to obtain historical playback records, which are used to record historical playback videos; determine the information of the historical playback video based on the historical playback records; obtain the source video information; and use the information of the historical playback video and the information of the source video to construct a historical playback video sequence.

[0367] Based on the same inventive concept, the present application also provides a video recommendation device for implementing the aforementioned video recommendation model training method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations in one or more of the following embodiments of the video recommendation model training device can be found in the above-mentioned limitations on the video recommendation model training method and will not be further elaborated here.

[0368] In an exemplary embodiment, Figure 16 As shown, a video recommendation model training device 1600 is provided, comprising: a second acquisition module 1601, a fourth execution module 1602, a fifth execution module 1603, a sixth execution module 1604, a second determination module 1605 and an adjustment module 1606, wherein:

[0369] The second acquisition module 1601 is used to obtain the first training feature of the training source video, the second training feature of each training history playback video in the training history playback video sequence, the third training feature of the training sub-video sequence in the training history playback video sequence, and the fourth training feature of the training candidate video;

[0370] The fourth execution module 1602 is configured to encode the first training feature and the second training feature through the video recommendation model to be trained to obtain a training long-term behavior sequence representation, and generate a training long-term interest feature based on the training long-term behavior sequence representation and the fourth training feature.

[0371] A fifth execution module 1603 is configured to perform attention processing on the third training feature and the training long-term behavior sequence representation through the video recommendation model to be trained to obtain a training short-term behavior sequence representation, and generate a training short-term interest feature based on the training short-term behavior sequence representation and the fourth training feature;

[0372] A sixth execution module 1604 is configured to update the trained long-term interest feature and the trained short-term interest feature based on the dependency relationship between the trained long-term behavior sequence representation and the trained short-term behavior sequence representation through a relational attention network to obtain an updated long-term interest feature and an updated short-term interest feature.

[0373] A second determining module 1605 is configured to determine a target loss value based on the trained long-term interest feature, the trained short-term interest feature, the updated long-term interest feature, and the updated short-term interest feature;

[0374] The adjustment module 1606 is configured to adjust the video recommendation model to be trained based on the target loss value.

[0375] In one embodiment, after the video recommendation model is trained, the trained long-term interest features are similar to the updated long-term interest features, the trained short-term interest features are similar to the updated short-term interest features, the trained long-term interest features are different from the updated short-term interest features, and the trained short-term interest features are different from the updated long-term interest features.

[0376] In one embodiment, the second determination module 1605 is specifically used to determine the first similarity difference between the training long-term interest feature and the updated long-term interest feature and the updated short-term interest feature, and determine the first loss value based on the first similarity difference; determine the second similarity difference between the updated long-term interest feature and the training long-term interest feature and the training short-term interest feature, and determine the second loss value based on the second similarity difference; determine the third similarity difference between the training short-term interest feature and the updated short-term interest feature and the updated long-term interest feature, and determine the third loss value based on the third similarity difference; determine the fourth similarity difference between the updated short-term interest feature and the training short-term interest feature and the training long-term interest feature, and determine the fourth loss value based on the fourth similarity difference; determine the target loss value based on the first loss value, the second loss value, the third loss value and the fourth loss value.

[0377] Each module in the aforementioned video recommendation device and video recommendation model training device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a computer device memory in software form, so that the processor can call and execute the corresponding operations of each module.

[0378] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 17As shown. The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via wired or wireless means, and the wireless means can be implemented via Wi-Fi, a mobile cellular network, near field communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a video recommendation method or a video recommendation model training method. The display unit of the computer device 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 a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.

[0379] Those skilled in the art will understand that the structure shown in 17 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0380] In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the video recommendation method or video recommendation model training method described in any of the above embodiments are implemented.

[0381] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the video recommendation method or video recommendation model training method described in any of the above embodiments are implemented.

[0382] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps of the video recommendation method or the video recommendation model training method described in any of the above embodiments are implemented.

[0383] It should be noted that the object characteristics, 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, stored data, displayed data, 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 relevant data must comply with relevant regulations.

[0384] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory 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 various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processors (GPUs), digital signal processors (DSPs), programmable logic devices (PLCs), artificial intelligence (AI) processors, and the like.

[0385] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, 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 application.

[0386] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A video recommendation method, characterized in that: The method comprises: Obtaining a first feature of a source video, a second feature of each historically played video in a historically played video sequence, a third feature of a sub-video sequence in the historically played video sequence, and a fourth feature of a candidate video; Encoding is performed based on the first feature and the second feature to obtain a long-term behavior sequence representation, and generating a long-term interest feature based on the long-term behavior sequence representation and the fourth feature; Performing attention processing on the third feature and the long-term behavior sequence representation to obtain a short-term behavior sequence representation, and generating a short-term interest feature based on the short-term behavior sequence representation and the fourth feature; Merging the long-term interest feature and the short-term interest feature to obtain the user interest feature corresponding to the candidate video; Determine a recommendation decision result for the candidate video based on the user interest characteristics.

2. The method according to claim 1, characterized in that Encoding is performed based on the first feature and the second feature to obtain a long-term behavior sequence representation, including: Determine a first query vector based on the first feature, and input the first query vector into an attention encoder; Determine a first key vector and a first value vector according to the second feature, respectively, and input the first key vector and the first value vector into the attention encoder; The first query vector, the first key vector and the first value vector are encoded by the attention encoder to obtain a long-term behavior sequence representation; the long-term behavior sequence representation indicates the degree of relevance between each historical playback video in the historical playback video sequence and the source video.

3. The method according to claim 1, characterized in that Generating a long-term interest feature based on the long-term behavior sequence representation and the fourth feature includes: determining a second query vector according to the fourth feature; Determine a second key vector and a second value vector respectively according to the long-term behavior sequence representation; Attention processing is performed based on the second query vector, the second key vector, and the second value vector to obtain a long-term interest feature.

4. The method according to claim 1, wherein The sub-video sequence is a video sequence consisting of a portion of historical videos in the historical playback video sequence up to the current time; performing attention processing on the third feature and the long-term behavior sequence representation to obtain a short-term behavior sequence representation, including: determining a third query vector according to the third feature, and inputting the third query vector into an interest attention network; Determining a third key vector and a third value vector respectively according to the long-term behavior sequence representation, and inputting the third key vector and the third value vector into the interest attention network; The third query vector, the third key vector and the third value vector are subjected to attention processing by the interest attention network to obtain a short-term behavior sequence representation; the short-term behavior sequence representation indicates the degree of relevance between each historical playback video in the historical playback video sequence and each video in the sub-video sequence.

5. The method according to claim 1, wherein Generating a short-term interest feature based on the short-term behavior sequence representation and the fourth feature includes: determining a fourth query vector according to the fourth feature; determining a fourth key vector and a fourth value vector according to the short-term behavior sequence representation respectively; Attention processing is performed based on the fourth query vector and the fourth value vector to obtain a short-term interest feature.

6. The method according to any one of claims 1 to 5, characterized in that: The long-term interest feature and the short-term interest feature are integrated to obtain the user interest feature corresponding to the candidate video, including: determining a first fusion coefficient of the long-term interest feature according to the first feature, the fourth feature, the long-term interest feature, and the short-term interest feature; Determining a second fusion coefficient of the short-term interest feature according to the first fusion coefficient; The long-term interest feature and the short-term interest feature are fused based on the first fusion coefficient and the second fusion coefficient to obtain the user interest feature corresponding to the candidate video.

7. The method according to claim 6, characterized in that Determining a first fusion coefficient of the long-term interest feature according to the first feature, the fourth feature, the long-term interest feature, and the short-term interest feature includes: Performing a connection operation on the first feature, the fourth feature, the long-term interest feature, and the short-term interest feature based on a connection function to obtain a fusion vector; Performing nonlinear transformation processing on the fusion vector based on a multi-perception layer function to obtain a fusion feature of the fusion vector; The range of the fusion feature is compressed based on a compression function to obtain a first fusion coefficient of the long-term interest feature.

8. The method according to claim 6, characterized in that The first fusion coefficient is a positive number less than 1, and the second fusion coefficient is the difference between 1 and the first fusion coefficient; The long-term interest feature and the short-term interest feature are fused based on the first fusion coefficient and the second fusion coefficient to obtain a user interest feature corresponding to the candidate video, including: performing weighted processing on the long-term interest feature based on the first fusion coefficient, and performing weighted processing on the short-term interest feature based on the second fusion coefficient; The weighted long-term interest features and the weighted short-term interest features are summed to obtain the user interest features corresponding to the candidate video.

9. The method according to any one of claims 1 to 5, characterized in that Determining a recommendation decision result for the candidate video according to the user interest feature includes: Acquiring object features and context features representing a playback scenario of the source video; Inputting the first feature, the fourth feature, the context feature, the object feature, and the user interest feature into a multi-objective network to obtain multiple scores of the candidate video output by the multi-objective network under multiple preset indicators; A target score for the candidate video is determined based on multiple scores of the candidate video under the multiple preset indicators, and a recommendation decision result for the candidate video is determined based on the target score.

10. The method according to claim 9, characterized in that The method further comprises: Obtaining a first original feature of a source video, a second original feature of each historically played video in a historically played video sequence, a third original feature of a sub-video sequence in the historically played video sequence, a fourth original feature of a candidate video, an object original feature, and a context original feature; Vector embedding is performed on the first original feature, the second original feature, the third original feature, the fourth original feature, the object original feature, and the context original feature, respectively, to obtain a first feature, a second feature, a third feature, a fourth feature, an object feature, and a context feature, respectively.

11. The method according to any one of claims 1 to 5, characterized in that Also includes: Obtaining historical playback records, where the historical playback records are used to record historical playback videos; Determining information of historically played videos based on the historical playback records; Acquiring the source video information; A historically played video sequence is constructed using the information of the historically played video and the information of the source video.

12. A video recommendation model training method, characterized in that: The method comprises: Obtaining a first training feature of a training source video, a second training feature of each training history playback video in a training history playback video sequence, a third training feature of a training sub-video sequence in the training history playback video sequence, and a fourth training feature of a training candidate video; encoding the first training feature and the second training feature using a video recommendation model to be trained to obtain a training long-term behavior sequence representation, and generating a training long-term interest feature based on the training long-term behavior sequence representation and the fourth training feature; performing attention processing on the third training feature and the training long-term behavior sequence representation through the video recommendation model to be trained to obtain a training short-term behavior sequence representation, and generating a training short-term interest feature based on the training short-term behavior sequence representation and the fourth training feature; By using a relational attention network, the trained long-term interest feature and the trained short-term interest feature are updated based on the dependency relationship between the trained long-term behavior sequence representation and the trained short-term behavior sequence representation to obtain an updated long-term interest feature and an updated short-term interest feature; Determining a target loss value according to the training long-term interest feature, the training short-term interest feature, the updated long-term interest feature, and the updated short-term interest feature; The video recommendation model to be trained is adjusted based on the target loss value.

13. The method according to claim 12, characterized in that After the video recommendation model is trained, the trained long-term interest features are similar to the updated long-term interest features, the trained short-term interest features are similar to the updated short-term interest features, the trained long-term interest features are different from the updated short-term interest features, and the trained short-term interest features are different from the updated long-term interest features.

14. The method according to claim 13, wherein: The determining of the target loss value according to the trained long-term interest feature, the trained short-term interest feature, the updated long-term interest feature, and the updated short-term interest feature includes: Determining first similarity differences between the training long-term interest feature and the updated long-term interest feature and the updated short-term interest feature, respectively, and determining a first loss value according to the first similarity differences; determining a second similarity difference between the updated long-term interest feature and the training long-term interest feature and the training short-term interest feature, and determining a second loss value according to the second similarity difference; determining a third similarity difference between the training short-term interest feature and the updated short-term interest feature and the updated long-term interest feature, respectively, and determining a third loss value according to the third similarity difference; determining a fourth similarity difference between the updated short-term interest feature and the training short-term interest feature and the training long-term interest feature, respectively, and determining a fourth loss value according to the fourth similarity difference; A target loss value is determined according to the first loss value, the second loss value, the third loss value, and the fourth loss value.

15. A video recommendation device, characterized in that: The device comprises: A first acquisition module is configured to acquire a first feature of a source video, a second feature of each historically played video in a historically played video sequence, a third feature of a sub-video sequence in the historically played video sequence, and a fourth feature of a candidate video; A first execution module is configured to perform encoding based on the first feature and the second feature to obtain a long-term behavior sequence representation, and generate a long-term interest feature based on the long-term behavior sequence representation and the fourth feature; a second execution module, configured to perform attention processing on the third feature and the long-term behavior sequence representation to obtain a short-term behavior sequence representation, and generate a short-term interest feature based on the short-term behavior sequence representation and the fourth feature; A third execution module is configured to fuse the long-term interest feature and the short-term interest feature to obtain a user interest feature corresponding to the candidate video; The first determination module is used to determine the recommendation decision result of the candidate video according to the user interest feature.

16. A video recommendation model training device, characterized in that: The device comprises: A second acquisition module is used to obtain a first training feature of a training source video, a second training feature of each training history playback video in a training history playback video sequence, a third training feature of a training sub-video sequence in the training history playback video sequence, and a fourth training feature of a training candidate video; The fourth execution module is used to encode the first training feature and the second training feature through the video recommendation model to be trained to obtain a training long-term behavior sequence representation, and generate a training long-term interest feature based on the training long-term behavior sequence representation and the fourth training feature. a fifth execution module, configured to perform attention processing on the third training feature and the training long-term behavior sequence representation through the video recommendation model to be trained to obtain a training short-term behavior sequence representation, and generate a training short-term interest feature based on the training short-term behavior sequence representation and the fourth training feature; a sixth execution module, configured to update the trained long-term interest feature and the trained short-term interest feature based on the dependency relationship between the trained long-term behavior sequence representation and the trained short-term behavior sequence representation through a relational attention network to obtain an updated long-term interest feature and an updated short-term interest feature; A second determining module is configured to determine a target loss value based on the trained long-term interest feature, the trained short-term interest feature, the updated long-term interest feature, and the updated short-term interest feature; An adjustment module is used to adjust the video recommendation model to be trained based on the target loss value.

17. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 14 are implemented.

18. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 14 are implemented.

19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 14 are implemented.