Video recommendation method, system, computer program product, device and storage medium
Through the feature extraction and aggregation of the movie viewing behavior of video social platform users, combined with the movie viewing habits of the associated objects, the accuracy of video recommendation has been improved, and the problem of low recommendation accuracy caused by information overload is solved.
Patent Information
- Application Number
- CN202411356432.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-09-27
AI Technical Summary
In video social platforms, the increasingly complex types of videos and the growing number of videos lead to information overload, which in turn makes video recommendations less accurate.
By using the first feature extraction module and the second feature extraction module to extract the target objects and associated objects, the aggregation feature is to improve the accuracy of the video recommendation. Specific steps include: feature extraction of historical viewing videos of the target object, combined with the movie viewing habits of its associated objects, and conducting feature fusion and prediction through technologies and other technologies such as transformed memory models and linear layers.
Through the fusion target objects and the characteristics of related objects, the accuracy of video recommendations has been improved, the scope of use of the resource of movie viewing behavior has been broaden, and the utilization rate of the resource of movie viewing behavior is enhanced.
Smart Images

Figure CN118890502B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a video recommendation method, a video recommendation system, a computer program product, a computer device, and a computer-readable storage medium. Background Art
[0002] With the popularization of Internet technology, the development of multimedia technology and social networks, "video social networking" has emerged as a new form of social interaction. Unlike traditional social forms, video social networking does not need to be limited to text and pictures. It can publish videos and even broadcast live. Users can watch, comment and share videos on these software, and can also communicate with video creators. However, the increasingly complex types of videos and the growing number of videos, while providing users with more choices, are prone to information overload problems, which in turn easily leads to low user interest when users recommend videos, that is, the accuracy of the recommended videos is poor. Summary of the invention
[0003] Based on this, it is necessary to provide a video recommendation method, a video recommendation system, a computer program product, a computer device and a computer-readable storage medium to address the above-mentioned technical problems, which can improve the utilization rate of movie viewing resource sources and improve the accuracy of recommended videos.
[0004] On the one hand, a video recommendation method is provided, which includes: using a first feature extraction module to extract features from a target object's viewing sequence to obtain a first viewing feature; wherein the viewing sequence includes video identifiers of historically watched videos; using a second feature extraction module to extract features from an associated object's viewing sequence to obtain a second viewing feature; wherein the associated object represents other objects that have an association relationship with the target object; aggregating the first viewing feature and the second viewing feature to obtain an aggregated feature, using the aggregated feature to predict a recommended video identifier, and recommending a video corresponding to the recommended video identifier to the target object.
[0005] In one embodiment of the present application, the second feature extraction module includes a first extractor and a second extractor; the second feature extraction module is used to perform feature extraction on the viewing sequence of the associated object to obtain the second viewing feature, including: inputting the viewing sequence of the first neighbor into the first extractor; inputting the viewing sequence of the second neighbor into the second extractor; wherein the associated object includes the first neighbor and the second neighbor, and the number of intermediate objects between the first neighbor and the target object is less than the number of intermediate objects between the second neighbor and the target object; the outputs of the first extractor and the second extractor are fused to obtain the second viewing feature.
[0006] In one embodiment of the present application, before using the second feature extraction module to extract features from the viewing sequence of the associated object, it includes: selecting a first number of first neighbors, and generating a viewing sequence for each selected first neighbor; obtaining a second number of second neighbors, and generating a viewing sequence for each selected second neighbor; wherein the first number is less than the second number.
[0007] In one embodiment of the present application, the first feature extraction module and / or the second feature extraction module includes a trained variational memory model, the variational memory model includes a forgetting gate, an input gate and an output gate; using the trained variational memory model to extract features of the viewing sequence includes: inputting the extracted features of the viewing sequence into the forgetting gate, inputting the output of the forgetting gate into the input gate; inputting the output of the input gate into the output gate, and obtaining the viewing features output by the output gate that express the recommended video information.
[0008] In one embodiment of the present application, inputting the output of the forget gate to the input gate includes: fusing the forget gate and the input gate; splicing the cell state parameters, hidden state parameters and features of the input viewing sequence at the historical moment to obtain input information; and inputting the input information to the input gate.
[0009] In one embodiment of the present application, the variational memory model also includes cell state parameters; using the trained variational memory model to extract features from the viewing sequence also includes: retaining the historical information that the forget gate chooses to forget; and updating the cell state parameters using the historical information and the output data of the input gate.
[0010] In one embodiment of the present application, the variational memory model includes a variational hyperbolic tangent function; using the trained variational memory model to extract features from the viewing sequence also includes: using the variational hyperbolic tangent function to identify an input feature value input thereto; in response to the input feature value being in a first value interval, obtaining a first feature value output by the variational hyperbolic tangent function; in response to the input feature value being in a second value interval, obtaining a calculated feature value calculated by the variational hyperbolic tangent function using the first feature value; wherein the calculated feature value is positively correlated with the input feature value; in response to the input feature value being in a third value interval, obtaining a second feature value output by the variational hyperbolic tangent function.
[0011] In one embodiment of the present application, feature extraction of the target object's viewing sequence includes: obtaining a third number of historical viewing records, and forming a viewing sequence based on the viewing order; inputting the viewing sequence into a trained current feature extraction model, and allowing the current feature extraction model to analyze the viewing behavior expressed by the viewing sequence to predict and output the video information that the current object potentially intends to watch; wherein the current feature extraction model includes a first feature extraction module and / or a second feature extraction module.
[0012] In one embodiment of the present application, training the current feature extraction model includes: obtaining a fourth number of historical movie viewing records with a timeline relationship as test movie viewing records; wherein the difference between the fourth number and the third number is 1; forming a test sequence with the third number of test movie viewing records that occurred first, and using the remaining test movie viewing records as verification videos; outputting the test sequence to the current feature extraction model in training to obtain a test prediction video; and updating the model parameters of the current feature extraction model based on the degree of match between the test prediction video and the verification video.
[0013] In one embodiment of the present application, predicting the video information that the current object potentially intends to watch includes: obtaining analysis features of the viewing sequence; and using a variant activation function to predict the probability of the current object intending to watch several preset videos based on the analysis features.
[0014] In one embodiment of the present application, a variant activation function is used to predict the probability that the current object intends to watch several preset videos based on the analysis features, including: in response to the analysis feature value of the analysis feature being in the fourth value interval, a first probability output by the variant activation function is obtained; in response to the analysis feature value being in the fifth value interval, a calculated probability calculated by the variant activation function is obtained; wherein the calculated probability is positively correlated with the analysis feature value; in response to the analysis feature value being in the sixth value interval, a second probability output by the variant activation function is obtained.
[0015] In one embodiment of the present application, the video recommendation method also includes: converting information parameters belonging to a floating point type into an integer type and inserting a pseudo-quantization node to obtain calculation parameters of the information parameters; wherein the information parameters include at least one of a model parameter and a feature vector, and the parameter length of the calculation parameters is shorter than the parameter length of the information parameters; using the calculation parameters to replace the information parameters for predictive calculation; in response to completing the predictive calculation, converting the updated calculation parameters into a floating point type.
[0016] In one embodiment of the present application, converting information parameters of floating-point type into integer type includes: using a preset quantization value interval to constrain the value of the floating-point information parameter converted into an integer type to obtain an intermediate parameter with a gradient; wherein the intermediate parameter serves as a pseudo-quantization node; inserting a pseudo-quantization node includes: rounding and degrading the intermediate parameter to obtain a first value; degrading the intermediate parameter to obtain a second value; and superimposing the difference between the first value and the second value with the intermediate parameter to obtain a calculation parameter.
[0017] In one embodiment of the present application, converting a floating-point information parameter into an integer value includes: obtaining a ratio of the information parameter to a quantization parameter as data to be constrained; wherein the quantization parameter is obtained by weighting the original quantization parameter using a gradient quantization parameter, and the gradient quantization parameter is associated with the dimension of the information parameter.
[0018] On the other hand, a video recommendation system is provided, which is used to implement a video recommendation method as in any of the above embodiments, and the video recommendation system includes: a first feature extraction module, a second feature extraction module, an aggregation module and a prediction module; the first feature extraction module is used to extract features from a target object's viewing sequence to obtain a first viewing feature; wherein the viewing sequence includes a video identifier of a historically watched video; the second feature extraction module is used to extract features from an associated object's viewing sequence to obtain a second viewing feature; wherein the associated object represents other objects that have an association relationship with the target object; the aggregation module is connected to the first feature extraction module and the second feature extraction module, and is used to aggregate the first viewing feature and the second viewing feature to obtain an aggregated feature; the prediction module is connected to the aggregation module, and is used to predict the recommended video identifier using the aggregated feature, and recommend the video corresponding to the recommended video identifier to the target object.
[0019] In one embodiment of the present application, the first feature extraction module includes a variational memory model, which includes a first input end, a second input end and an output end; the first input end of the variational memory model is used to input the viewing sequence of the target object; the second input end of the variational memory model is used to input the initial cell state parameters and hidden state parameters, or the cell state parameters after the previous update and the initial hidden state parameters; the output end of the variational memory model is used to output the first viewing feature.
[0020] In one embodiment of the present application, the variant memory model includes a cell state, a hidden state, a forget gate, an input gate, and an output gate; wherein the output end of the forget gate is connected to the input end of the input gate.
[0021] In one embodiment of the present application, the second feature extraction module includes a first extractor, a second extractor, a first linear layer, a second linear layer and a connection layer; the input end of the first extractor is used to input the viewing sequence of the first neighbor; the output end of the first extractor is connected to the input end of the first linear layer; the output end of the first linear layer is connected to the input end of the connection layer; the input end of the second extractor is used to input the viewing sequence of the second neighbor; the output end of the second extractor is connected to the input end of the second linear layer; the output end of the second linear layer is connected to the input end of the connection layer; the connection layer is used to connect the features input from its input end to obtain a second viewing feature; wherein, the associated objects include the first neighbor and the second neighbor, and the number of intermediate objects between the first neighbor and the target object is less than the number of intermediate objects between the second neighbor and the target object.
[0022] In one embodiment of the present application, the aggregation module includes a fusion module and a third linear layer; the input end of the fusion module is respectively connected to the first feature extraction module and the second feature extraction module, for inputting the first viewing feature and the second viewing feature; the output end of the fusion module is connected to the input end of the third linear layer; the output end of the third linear layer outputs the aggregation feature.
[0023] On the other hand, a computer program product is provided, which includes: a computer program, which implements the following steps when executed by a processor: using a first feature extraction module to extract features from a target object's viewing sequence to obtain a first viewing feature; wherein the viewing sequence includes video identifiers of historically watched videos; using a second feature extraction module to extract features from an associated object's viewing sequence to obtain a second viewing feature; wherein the associated object represents other objects that have an association relationship with the target object; aggregating the first viewing feature and the second viewing feature to obtain an aggregated feature, using the aggregated feature to predict a recommended video identifier, and recommending the video corresponding to the recommended video identifier to the target object.
[0024] On the other hand, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: using a first feature extraction module to perform feature extraction on a target object's viewing sequence to obtain a first viewing feature; wherein the viewing sequence includes video identifiers of historically viewed videos; using a second feature extraction module to perform feature extraction on an associated object's viewing sequence to obtain a second viewing feature; wherein the associated object represents other objects that have an association relationship with the target object; aggregating the first viewing feature and the second viewing feature to obtain an aggregated feature, using the aggregated feature to predict a recommended video identifier, and recommending the video corresponding to the recommended video identifier to the target object.
[0025] On the other hand, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: using a first feature extraction module to extract features from the target object's viewing sequence to obtain a first viewing feature; wherein the viewing sequence includes video identifiers of historically watched videos; using a second feature extraction module to extract features from the viewing sequence of an associated object to obtain a second viewing feature; wherein the associated object represents other objects that have an association relationship with the target object; aggregating the first viewing feature and the second viewing feature to obtain an aggregated feature, using the aggregated feature to predict a recommended video identifier, and recommending the video corresponding to the recommended video identifier to the target object.
[0026] The above-mentioned video recommendation method, video recommendation system, computer program product, computer device and computer-readable storage medium can integrate the second viewing feature of the associated object associated with the target object when predicting the recommended video recommended to the target object, so as to enrich the reference information dimension of the predicted recommended video, thereby facilitating the improvement of the accuracy of the recommended video. At the same time, the target object of the currently predicted recommended video can also be used as an associated object of other target objects. This means that the viewing sequence of each object can be used not only to predict its own recommended videos, but also to predict the recommended videos of the associated objects associated with it, which can broaden the scope of use of viewing behavior resources, so as to improve the utilization rate of viewing behavior resources and make full use of viewing behavior resources as much as possible. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a structural diagram of an embodiment of a movie-watching behavior resource of the present application;
[0028] Figure 2 This is a structural diagram of an embodiment of the video recommendation system of the present application;
[0029] Figure 3 This is a flowchart of an embodiment of the video recommendation method of the present application;
[0030] Figure 4 This is a flow chart of an embodiment of extracting the first movie-watching feature of the present application;
[0031] Figure 5 is a flowchart of another embodiment of extracting the first movie-watching feature of the present application;
[0032] Figure 6 is a flowchart of an embodiment of extracting the second movie-watching feature of the present application;
[0033] Figure 7 is a flowchart of another embodiment of extracting the second movie-watching feature of the present application;
[0034] Figure 8 This is a flow chart of an embodiment of obtaining aggregate features in the present application;
[0035] Fig. 9 This is a flowchart of another embodiment of obtaining aggregate features in the present application;
[0036] Fig.10 This is a flow chart of an embodiment of extracting movie viewing features using a variant memory model of the present application;
[0037] Fig.11 It is a flowchart of another embodiment of the present invention's variant memory model for extracting movie viewing features;
[0038] Fig.12 This is a mathematical curve diagram of an embodiment of a conventional activation function of the present application;
[0039] Fig.13 It is a mathematical curve schematic diagram of an embodiment of a conventional hyperbolic tangent function of the present application;
[0040] Fig.14 It is a structural diagram of an embodiment of a computer device of the present application. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0042] In order to solve the technical problem of poor accuracy of recommended videos existing in related technologies, the present application provides a video recommendation method, a video recommendation system, a computer program product, a computer device and a computer-readable storage medium. The video recommendation method includes: using a first feature extraction module to extract features from the viewing sequence of the target object to obtain a first viewing feature; wherein the viewing sequence includes the video identifier of the historically watched video; using a second feature extraction module to extract features from the viewing sequence of the associated object to obtain a second viewing feature; wherein the associated object represents other objects that have an associated relationship with the target object; aggregating the first viewing feature and the second viewing feature to obtain an aggregated feature, using the aggregated feature to predict the recommended video identifier, and recommending the video corresponding to the recommended video identifier to the target object. The specific model architecture and working principle of the present application are described in detail below.
[0043] See also Figure 1 , Figure 1 It is a structural diagram of an embodiment of the movie-watching behavior resource of the present application.
[0044] In one embodiment, each user can be taken as an object, and their movie-watching behavior can be collected. When collecting the user's movie-watching behavior and associated relationships, a collection request is sent to the user, so that after obtaining the user's consent to the collection request, the relevant movie-watching behavior and its associated relationship with other users / objects are collected. When the user does not agree to collect the associated relationship between him and other users, the associated relationship will not be collected. Optionally, the associated relationship may include social relationships, follow-up relationships, etc., which are not limited here. That is to say, the associated objects with which the user has an associated relationship may be the user's social friends, users who have historically shared videos or received video sharing, users followed by the user, etc., which will not be repeated here.
[0045] like Figure 1As shown in the example, the objects that can collect the viewing behavior include objects u1 to u5. The collected videos include videos v1 to v9. Among them, the videos can include short videos, long videos, live videos, TV series, movies, documentaries, etc., which are not limited here. Furthermore, the categories and tags of the videos can also be managed, for example Figure 1 The video categories in may include categories c1 to c3; the video tags may include tag t1 and tag t2.
[0046] See also Figure 2 , Figure 2 It is a structural diagram of an embodiment of the video recommendation system of the present application.
[0047] In one embodiment, the video recommendation system is used to implement a video recommendation method as described in any of the following embodiments.
[0048] The video recommendation system includes a first feature extraction module 10 , a second feature extraction module 20 , an aggregation module 30 and a prediction module 40 .
[0049] The first feature extraction module 10 is used to extract features from the target object's movie viewing sequence to obtain a first movie viewing feature; wherein the movie viewing sequence includes video identifiers of historically watched videos.
[0050] The second feature extraction module 20 is used to extract features from the movie viewing sequence of the associated object to obtain a second movie viewing feature; wherein the associated object refers to other objects that have an associated relationship with the target object.
[0051] The aggregation module 30 is connected to the first feature extraction module 10 and the second feature extraction module 20, and is used to aggregate the first movie viewing feature and the second movie viewing feature to obtain an aggregated feature.
[0052] The prediction module 40 is connected to the aggregation module 30 and is used to predict the recommended video identifier by using the aggregation features and recommend the video corresponding to the recommended video identifier to the target object.
[0053] It can be seen that the video recommendation system in this embodiment has four components, namely, the first feature extraction module 10, the second feature extraction module 20, the aggregation module 30 and the prediction module 40. They are used to realize different functions respectively, and the overall model architecture is relatively simple, that is, the architecture of the video recommendation system is simplified in this embodiment, which is conducive to reducing the resource occupation burden of the video recommendation system. In addition, in this embodiment, the modules that realize different functions in the video recommendation system are decoupled, which is conducive to improving training efficiency and reducing operation and maintenance burden. At the same time, in this embodiment, when predicting the recommended video recommended to the target object, the second viewing feature of the associated object associated with the target object can be integrated to enrich the reference information dimension of the predicted recommended video, so as to improve the accuracy of the recommended video. At the same time, the target object of the current predicted recommended video can also be used as an associated object of other target objects. This means that the viewing sequence of each object can not only be used to predict its own recommended video, but also to predict the recommended video of the associated object associated with it, which can broaden the scope of use of viewing behavior resources, so as to improve the utilization rate of viewing behavior resources and make full use of viewing behavior resources as much as possible.
[0054] For the specific definition of the video recommendation system, please refer to the definition of the video recommendation method in the following text, which will not be repeated here. Each module in the above video recommendation system can be implemented in whole or in part by software, hardware and their combination. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0055] See also Figure 3 , Figure 3 It is a flowchart of an embodiment of the video recommendation method of the present application.
[0056] S101: Using a first feature extraction module to extract features from a target object's movie viewing sequence to obtain a first movie viewing feature; wherein the movie viewing sequence includes video identifiers of historically viewed videos.
[0057] In this embodiment, the target object represents the user of the video to be recommended. The viewing sequence of the target object is formed by processing the video identifiers of the videos watched by the target object at historical moments.
[0058] S102: Using a second feature extraction module to extract features from the movie viewing sequence of the associated object to obtain a second movie viewing feature; wherein the associated object refers to other objects that have an associated relationship with the target object.
[0059] In this embodiment, the associated object refers to other objects that have an associated relationship with the target object. Therefore, when recommending recommended movies for the target object, the reference information dimension can be enriched, and the associated objects that have an associated relationship with the target object can be predicted together.
[0060] The associated object may be associated with the target object or indirectly associated with the target object, which is not limited here. The number of associated objects may be one or more, which is not limited here.
[0061] S103: Aggregate the first movie viewing feature and the second movie viewing feature to obtain an aggregated feature, use the aggregated feature to predict a recommended video identifier, and recommend a video corresponding to the recommended video identifier to a target object.
[0062] In this embodiment, when recommending a video to a target object, the target object's own viewing habits and the viewing habits of related objects can be integrated, and the recommended video to the target object can be predicted based on the two (i.e., the information expressed by the first viewing feature and the second viewing feature).
[0063] It can be seen that in this embodiment, when predicting the recommended video recommended to the target object, the video recommendation system can integrate the second viewing feature of the associated object associated with the target object to enrich the reference information dimension of the predicted recommended video, thereby helping to improve the accuracy of the recommended video. At the same time, the target object of the currently predicted recommended video can also be used as an associated object of other target objects. This means that the viewing sequence of each object can not only be used to predict its own recommended videos, but also to predict the recommended videos of the associated objects associated with it, which can broaden the scope of use of viewing behavior resources, so as to help improve the utilization rate of viewing behavior resources and make full use of viewing behavior resources as much as possible.
[0064] Please refer to Figure 4 and Figure 5 , Figure 4 is a flowchart of an embodiment of extracting the first viewing feature of the present application, Figure 5 It is a flowchart of another embodiment of the present application for extracting the first movie-watching feature.
[0065] In one embodiment, the first feature extraction module includes a first input terminal, a second input terminal and an output terminal. The first input terminal of the first feature extraction module is used to input the viewing sequence of the target object.
[0066] The second input end of the first feature extraction module is used to input the initial cell state parameters and hidden state parameters, or the cell state parameters and initial hidden state parameters after the last update. The output end of the first feature extraction module is used to output the first viewing feature.
[0067] As such, in this embodiment, the first feature extraction module can be used to learn the user behavior sequence output feature data 1. The user behavior sequence is composed of the video ID (Identity document, serial number) of the video watched by the user. Through the embedding layer data corresponding to the video ID, the feature data of the user behavior sequence data is obtained, that is, the extracted features of the viewing sequence. The features of the extracted viewing sequence are input into conventional LSTM (Long Short-Term Memory), variant LSTM, etc. Among them, LSTM is a time recurrent neural network, which can usually solve the long-term dependency problem existing in general RNN (Recurrent Neural Network).
[0068] Optionally, the first feature extraction module in this embodiment may include a variant memory model such as a variant LSTM. That is, the variant memory model includes a first input terminal, a second input terminal, and an output terminal. The first input terminal of the variant memory model is used to input the viewing sequence of the target object. The second input terminal of the variant memory model is used to input the initial cell state parameters and hidden state parameters, or the cell state parameters after the last update and the initial hidden state parameters. The output terminal of the variant memory model is used to output the first viewing feature. Specifically, the variant memory model inputs the forgetting gate to the input terminal of the input gate, so that the information richness in the first viewing feature extraction process can be enriched, which is beneficial to improve the information that can be expressed by the first viewing feature, so as to improve the accuracy of the predicted recommended video.
[0069] The specific working principle of the variant memory model will be explained later.
[0070] In this embodiment, the output first movie viewing feature may be a feature of extracting the historical movie viewing of the target object, or a feature of predicting the video that the target object may watch, which is not limited here.
[0071] Optionally, in this embodiment, a third number of historical movie viewing records can be obtained to form a movie viewing sequence based on the movie viewing order. The movie viewing sequence is input into the trained current feature extraction model. The current feature extraction model refers to the feature extraction model included in the first feature extraction module, which can be a conventional feature extractor or a variant memory model. The current feature extraction model is ordered to analyze the movie viewing behavior expressed by the movie viewing sequence to predict and output the video information that the current object potentially intends to watch. The current feature extraction model includes a first feature extraction module and / or a second feature extraction module.
[0072] That is to say, in this embodiment, the first feature extraction module can be used to predict the next video that the target user may watch, and obtain the first viewing feature, so as to predict the videos that the target object may potentially want to watch based on the target object's own viewing habits, so that the predicted recommended video can combine the characteristics of the target object's viewing habits in the time dimension, thereby improving the accuracy of the recommended video.
[0073] Specifically, in this embodiment, Figure 5 As shown in the example, the user's behavior sequence data is obtained, and the feature data of the user behavior sequence is obtained through the embedding layer. In this article, in order to distinguish it from other feature data, the feature data of the user behavior sequence is marked by F0, and the same applies to F1, F2, etc. in the following text. Initialization state data (h0, c0) (i.e. Figure 5 As shown in the example (hidden state parameters, cell state parameters). The feature data F0 of the user behavior sequence and the initialization state data (h0, c0) are input into the LSTM module, and the feature data F1 of the video sequence that the user is about to watch is output.
[0074] Furthermore, in the process of training the current feature extraction model, a fourth number of historical movie viewing records with a timeline relationship can be obtained as test movie viewing records, wherein the difference between the fourth number and the third number is 1. The third number of test movie viewing records that occurred first form a test sequence, and the remaining test movie viewing records are used as verification videos. The test sequence is output to the current feature extraction model in training to obtain a test prediction video. Based on the matching degree between the test prediction video and the verification video, the model parameters of the current feature extraction model are updated.
[0075] In layman's terms, the user's behavior sequence is to generate a viewing video ID sequence according to the viewing order of the videos in the video recommendation. In order to maintain the regularity of the data during training, S+1 video IDs can be sampled in the user's behavior sequence, and the last video ID is used to expand the number that is not met, that is, the missing video IDs are sampled as the last video ID. S ID sequences are trained by users, and the last ID is used as a reference for predicting the next viewing video ID. The first-order neighbor nodes and the second-order neighbor nodes are randomly sampled in the user's relationship graph. In this way, the current feature extraction model can be trained based on the actual viewing behavior of the user / target object, so that the prediction results of the current feature extraction model can be verified using the actual next viewing video, and the current feature extraction model can be updated based on the difference between the two, so as to promote the prediction results of the current feature extraction model in the training process to gradually approach the actual next viewing video, thereby improving the prediction reliability of the first feature extraction module.
[0076] Please refer to Figure 6 and Figure 7, Figure 6 is a flowchart of an embodiment of extracting the second viewing feature of the present application, Figure 7 It is a flowchart of another embodiment of the present application for extracting the second movie-watching feature.
[0077] In one embodiment, the second feature extraction module includes a first extractor, a second extractor, a first linear layer, a second linear layer, and a connection layer.
[0078] The input end of the first extractor is used to input the viewing sequence of the first neighbor; the output end of the first extractor is connected to the input end of the first linear layer; the output end of the first linear layer is connected to the input end of the connection layer. The first neighbor can be equivalent to a so-called section of neighbors in the field of video social networking. The first neighbor can refer to a first neighbor, or can refer to multiple neighbors that match the association relationship with the target user, which is not limited here.
[0079] The input end of the second extractor is used to input the viewing sequence of the second neighbor; the output end of the second extractor is connected to the input end of the second linear layer; the output end of the second linear layer is connected to the input end of the connection layer. Among them, the second neighbor can be equivalent to the so-called two-node neighbor in the field of video social networking. Similarly, the second neighbor can refer to one second neighbor, or it can refer to multiple neighbors that match the association relationship with the target user, which is not limited here.
[0080] The connection layer is used to connect the features input from its input end to obtain the second viewing feature.
[0081] The associated objects include first neighbors and second neighbors, and the number of intermediate objects between the first neighbors and the target object is less than the number of intermediate objects between the second neighbors and the target object.
[0082] That is, the viewing sequence of the first neighbor can be input into the first extractor; the viewing sequence of the second neighbor can be input into the second extractor; wherein the associated objects include the first neighbor and the second neighbor, and the number of intermediate objects between the first neighbor and the target object is less than the number of intermediate objects between the second neighbor and the target object. The outputs of the first extractor and the second extractor are fused to obtain the second viewing feature. In this way, when combining the viewing feature information of the associated object with the target object, the associated objects with multiple layers of close relationships can be fused to further enrich the surrounding information.
[0083] For example, the associated objects include the first neighbor and the second neighbor, so Figure 7 The number of layers N in can be 2.
[0084] Further, a first number of first neighbors are selected, and a viewing sequence of each selected first neighbor is generated. A second number of second neighbors are obtained, and a viewing sequence of each selected second neighbor is generated. The first number is less than the second number.
[0085] like Figure 1 As given in the example, user u1 is the first neighbor of user u2, user u1 is the second neighbor of user u3, and user u2 is the intermediate object between user u1 and user u3.
[0086] In layman's terms, the user's first neighbor behavior sequence data can be taken out, and the feature data Fn10 of the user's first neighbor behavior sequence can be obtained through the embedding layer. The initialization state data (h0, c0) data. The feature data Fn10 of the user's first neighbor behavior sequence and the initialization state data (h0, c0) data are input into the LSTM module, and the feature data F21 of the video sequence that the user's first neighbor is going to watch is output. The feature data F21 is processed by the linear layer to obtain the output feature data F21d.
[0087] The graph dataset extracts the user's second neighbor behavior sequence data, and obtains the feature data Fn10 of the user's second neighbor behavior sequence through the embedding layer. Initialize the state data (h0, c0) data. Input the feature data Fn10 of the user's second neighbor behavior sequence and the initialization state data (h0, c0) data into the LSTM module, and output the feature data F22 of the video sequence that the user's second neighbor will watch. The feature data F22 is processed by the linear layer to obtain the output feature data F22d. The feature data F21d and the feature data F22d are combined into a feature data list F2.
[0088] Please refer to Figure 8 and Fig. 9 , Figure 8 This is a flow chart of an embodiment of obtaining aggregate features in this application. Fig. 9 It is a flowchart of another embodiment of the present application for obtaining aggregation features.
[0089] In one embodiment, the aggregation module includes a fusion module and a third linear layer.
[0090] The input end of the fusion module is respectively connected to the first feature extraction module and the second feature extraction module for inputting the first viewing feature and the second viewing feature; the output end of the fusion module is connected to the input end of the third linear layer; and the output end of the third linear layer outputs the aggregated feature.
[0091] That is to say, the aggregation module can perform aggregation operations on the first movie viewing feature and the second movie viewing feature, propagate messages on the user behavior sequence feature data of the first neighbor and the user behavior sequence feature data of the second neighbor respectively, and integrate the video sequence feature data that needs to be watched in the next stage of the target object, the first neighbor, and the second neighbor, thereby improving the accuracy of the recommended video.
[0092] The following is a brief description of the principle of obtaining aggregate features. Take out a feature data vector F1i from the feature data F1, where the size of F1 can be considered as B, S, C. The feature data vector F1i and the feature data vector F2 form a feature vector list F. Determine whether the layer loop is completed. Determine whether the sampling times are completed. Take the average of the feature vector list F. After linear layer processing, output the features. Return to the nearest loop judgment and continue running. Output feature data, which is the aggregate feature.
[0093] The working principle of the variant memory model is explained in detail below.
[0094] Please refer to Fig.10 and Fig.11 , Fig.10 This is a flow chart of an embodiment of extracting movie viewing features using a variant memory model of the present application. Fig.11 It is a flow chart of another embodiment of the variant memory model of the present application for extracting movie viewing features.
[0095] In one embodiment, the first feature extraction module and / or the second feature extraction module includes a trained variant memory model, which includes a forget gate, an input gate, and an output gate.
[0096] The target object's viewing sequence is subjected to feature extraction through, for example, an embedding layer, to analyze the target object's viewing habits / intentions. In this way, the extracted viewing sequence features can be input into a forget gate, and the output of the forget gate can be input into an input gate. The output of the input gate is input into an output gate to obtain viewing features output by the output gate. The viewing features output by the output gate can express the recommended video information intended to be recommended based on the target object's viewing sequence.
[0097] Specifically, the forget gate and the input gate can be fused. The cell state parameters, hidden state parameters and features of the input viewing sequence at the historical moment are spliced to obtain input information. The input information is input to the input gate. In this way, the historical information that the forget gate chooses to discard / forget can be retained, increasing the richness of the information input to the input gate, which is conducive to improving the matching degree between the predicted recommended video information and the target object's intention.
[0098] Specifically, the variational memory model updates the output of the forget gate, the output of the input gate, and the output of the output gate during the forward propagation process;
[0099] Among them, the output of updating the forget gate is expressed as: Formula 1-1
[0100] The output of the updated input gate is expressed as: Formula 1-2
[0101] The output of the updated output gate is expressed as: Formula 1-3
[0102] Among them, t represents the current time; f t represents the output of updating the forget gate; g t Represents the output of updating the forget gate; o t represents the output of the updated forget gate; σ represents the activation function; x t represents the viewing sequence input at the current time t; W xf 、b xf , W hf 、b hf , W cf 、b cf represents the coefficient and bias of the linear relationship associated with the forget gate; h(t-1) and c(t-1) represent the hidden state parameter and cell state parameter at time t-1 respectively; W ig 、b ig , W hg 、b hg The coefficients and bias of the linear relationship associated with the input gate; W io 、b io , W ho 、b ho The coefficients and bias representing the linear relationship associated with the output gate.
[0103] Furthermore, the variant memory model also includes cell state parameters. Among them, the cell state parameters can also be updated with the prediction process. Based on the variant memory model provided in this embodiment, in the process of extracting features from the viewing sequence using the trained variant memory model, the historical information that the forget gate chooses to forget can be retained. In this way, the cell state parameters can be updated using the historical information and the output data of the input gate.
[0104] Specifically, the variant memory model also includes a cell state parameter and a hidden state parameter. That is, the variant memory model includes a cell state, a hidden state, a forget gate, an input gate, and an output gate; wherein the output end of the forget gate is connected to the input end of the input gate.
[0105] If so, the cell state parameters and hidden state parameters can be updated.
[0106] Among them, the updated cell state parameters are expressed as: Formula 1-4
[0107] Updating the hidden state parameters is expressed as: Formula 1-5
[0108] Among them, c t Represents the current updated cell state parameter; c t-1 represents the cell state parameter used in the feature extraction process; h t Represents the currently updated hidden state parameter; tanh() represents the hyperbolic tangent function.
[0109] The core of LSTM is the cell state. Fig.10 In the variant memory model shown in the example, the input information passes through the cell from the horizontal line above, and only interacts with other solid lines in a small amount during the period, indicating some linear transformations, which enables the input information to be preserved relatively completely, that is, it can retain long-term memory. The selective retention of information by LSTM is achieved through a gating mechanism. The gate structure can control the amount of information passing through the cell. In fact, it is achieved by linearly transforming the input information and then passing it through a sigmoid (activation function) layer, and finally converting the input into a coefficient vector with a value range of 0~1, which can be understood as the proportion of retained information. If the value is 0, it means that all the corresponding information will be discarded, and if it is 1, it means that all the corresponding information will be retained. The variant memory model involved in this embodiment inputs the forget gate into the input gate, and selects to retain certain information of the input data; the cell state information no longer uses the forget gate to forget the historical information, but chooses to retain more historical information, and when the cell state information is updated, the selected input data is added, so that certain information is emphasized and unimportant information is faded; the hidden state is still predicted using the hidden state of the previous moment, the current input information and the cell state information.
[0110] The following Fig.11The principle shown in the example is briefly described. Determine whether the number of steps i is less than the total number of steps M; determine whether the number of layers j is less than the total number of layers N. The input data passes through the linear layer and outputs the feature data M1. The state 1 data of the previous moment of the variant LSTM passes through the linear layer and outputs the feature data M2. Feature data M1 and M2 are added to obtain feature data M. Feature data M is split into 3 parts, namely f, g, and o. The state 2 data of the previous moment of the variant LSTM passes through the linear layer and outputs feature data M3. Feature data M3 is added to feature data f and passes through activation function 1 to obtain feature data ft. Feature data g passes through activation function 2 to obtain feature data gt. Feature data o passes through activation function 1 to obtain feature data ot. Feature data ft is multiplied by feature data gt and then added to the state 2 data of the previous moment to obtain the state 2 data of the current moment. The state 2 data of the current moment passes through activation function 2 and is multiplied by feature data ot to obtain the state 1 data of the current moment. j=j+1 means increasing the j value by 1 and returning to the layer number judgment loop. Similarly, i=i+1 means increasing the value of i by 1 and returning to the step judgment loop. The final feature data outputs is the viewing feature.
[0111] Furthermore, in this embodiment, the activation function is also processed in a variant to obtain a variant activation function. That is, the analysis features of the viewing sequence can be obtained inside the variant memory model. The variant activation function is used to predict the probability of the current object intending to watch several preset videos based on the analysis features, so as to segment the variant activation function so that the curve part in the conventional activation function approaches the linear distribution.
[0112] Specifically, the variant activation function is expressed as:
[0113] Formula 1-6
[0114] Among them, x fp32 Represents the analysis characteristics of the information parameters of 32-bit floating point type; scale represents the quantization parameter; STE() represents the conversion to gradient integer type operation using pseudo quantization node.
[0115] The following is an illustrative description of the relevant variants of the present application.
[0116] When accelerating devices such as FPGA (Field Programmable Gate Array), it is necessary to perform int8 (8-bit integer) data quantization operations on network data to reduce the amount of network computing and storage on priority device resources.
[0117] The purpose of model quantization is to convert float type calculations into integer type calculations. For example, the parameters of the model trained on a general PC (Personal Computer) are of float32 type, which occupies a bit width of 32 during calculations. For example, the bit width of int8 is only 8 (the bit width of int4 is only 4, etc.). Using quantized int8 to perform model inference calculations and then dequantizing to obtain the final output can increase the calculation speed and reduce the space of the calculation memory. The floating point model parameters (weight) and activation values (activation) are discretized into integers through a certain mapping, and the float parameters are converted into int8 integers through a linear mapping.
[0118] Specifically, the information parameter belonging to the floating point type can be converted into an integer type and inserted into the pseudo quantization node to obtain the calculation parameter of the information parameter; wherein the information parameter includes at least one of the model parameter and the feature vector, and the parameter length of the calculation parameter is shorter than the parameter length of the information parameter. The calculation parameter is used to replace the information parameter for prediction calculation. In response to the completion of the prediction calculation, the updated calculation parameter is converted into a floating point type.
[0119] Optionally, a preset quantization value interval can be used to constrain the conversion of floating-point information parameters into integer values to obtain intermediate parameters with gradients, wherein the intermediate parameters serve as pseudo-quantization nodes. However, the intermediate parameters may still have decimal points and need to be further rounded.
[0120] In this embodiment, it is considered that if the intermediate parameters with gradients are directly rounded, there may be a lack of gradients in some intervals, incomplete gradients, etc. In view of this, a pseudo quantization node is constructed in this embodiment to improve the gradient of the calculation parameters.
[0121] In detail, the intermediate parameter can be rounded and de-gradiented to obtain a first intermediate value. The intermediate parameter is de-gradiented to obtain a second intermediate value. The difference between the first intermediate value and the second intermediate value is superimposed on the intermediate parameter to obtain a calculation parameter. The calculation process of the calculation parameter is exemplified below using a specific expression.
[0122] Among them, the information parameters belonging to the floating point type are converted into integer type and expressed as: Formula 1-7
[0123] Inserting a pseudo-quantization node is expressed as: Formula 1-8
[0124] Among them, x int8 Indicates the data after the information parameter is converted to an 8-bit integer; clamp() indicates the truncation operation; qmin and q max They represent the minimum and maximum values of the quantized values respectively; round() represents the rounding operation; .detach() represents the degradation operation; x' int8 Represents the calculation parameters; STE() represents the defined conversion to integer operations with gradients using pseudo-quantization nodes.
[0125] It can be seen that x in formula 1-8 int8 It has gradient information, but the data may be non-integer. Therefore, we use range() to obtain the data after gradient removal. However, due to the loss of some gradients or the lack of some gradients, the derivative process will result in the appearance of 0 values. Therefore, we insert x int8 To introduce continuous gradients, in order to achieve the purpose of quantization. And, to ensure the insertion of pseudo-quantization nodes x int8 After, x' int8 Can keep integer values, that is, use round(x int8 .detach()) to x int8 The data after degrading is rounded off and further subtracted from x int8 The degradient value of x int8 .detach(), which ensures that the forensic value remains unchanged while maintaining the gradient.
[0126] Furthermore, for ease of understanding, we still use x' int8 Taking the result after prediction calculation as an example, the dequantization formula is given as an example. The dequantization formula can be expressed as: Formula 1-9
[0127] Among them, x' fp32 Indicates dequantized 32-bit floating-point data.
[0128] Furthermore, in back propagation, since the partial derivative of the new weight′ (weight is weight) obtained after inverse quantization is zero everywhere (the derivative of the rounding operation is 0), the pseudo-quantization process is skipped, and the weight before pseudo-quantization is directly updated. The result of the weight′ calculated by pseudo-quantization is used to simulate the quantization error, and this error is used to reversely correct the original weight to adapt to the error caused by quantization.
[0129] Combining the above formulas 1-7 to 1-9, we can get:
[0130] Formula 1-10
[0131] The following is an example of the expression of the back propagation process. fp32 The expression for the derivative of scale can be as follows: Formula 1-11
[0132] when hour, Formula 1-12
[0133] It can be seen that in this embodiment, by inserting pseudo quantization nodes, the quantization parameter (scale) is learned through quantization training and the scale is continuously updated to achieve the purpose of quantization. Different from other quantization training, in this embodiment, network learning not only adjusts weight to adapt to quantization error, but also adds scale to adapt to quantization error through learning scale.
[0134] Furthermore, in this embodiment, the quantization parameter is adjusted and updated, so that the adjusted and updated quantization parameter is used to participate in the prediction process of the recommended video.
[0135] Specifically, in this embodiment, the ratio of the information parameter to the quantization parameter is obtained as the data to be constrained, wherein the quantization parameter is obtained by weighting the original quantization parameter using the gradient quantization parameter, and the gradient quantization parameter is associated with the dimension of the information parameter.
[0136] In detail, in this embodiment, in order to achieve better convergence during training, the gradient of scale is adjusted by multiplying scale by a gradient scale (ie, a gradient quantization parameter), which is recorded as the first gradient quantization parameter gs.
[0137] For the weight, the expression of the first gradient quantization parameter gs is: Formula 1-13
[0138] For the activation value, the expression of the first gradient quantization parameter gs is: Formula 1-14
[0139] Among them, N w Represents the number of weights in each layer; N e Indicates the number of features in the activation value of each layer; scale0 represents the original activation function.
[0140] To facilitate the hardware's multiplication and division operations on scale, scale is approximated to a multiple of 2, so that the multiplication and division operations can be directly replaced by shifting. The specific formula is expressed as: Formula 1-15
[0141] Among them, scale1 represents the activation function that is approximated to a multiple of 2; abs() represents the absolute value operation; pow(a1,a2,a3) represents returning the value of a1 raised to the power of a2, and a1, a2, and a3 correspond to 2, round(log(abs(scale), and 2 in formula 1-15, respectively.
[0142] Because the scale parameter is approximately a multiple of 2, resulting in partial loss of precision, in order to better adjust the gradient of the scale, the scale is multiplied by a gradient scale, recorded as the second gradient quantization parameter gsr.
[0143] For the weight, the expression of the second gradient quantization parameter gs is: Formula 1-16
[0144] For the activation value, the expression of the second gradient quantization parameter gs is: Formula 1-17
[0145] Among them, scale0 in Formula 1-16 and Formula 1-17 may also be replaced by scale1.
[0146] In view of this, the expression of the quantization parameter scale can be expressed as:
[0147] Where scale represents the quantization parameter; scale0 represents the original quantization parameter; gs represents the first gradient quantization parameter; gsr represents the second gradient quantization parameter; N W Indicates the number of weights in each layer; q max Indicates the maximum value of the quantization value.
[0148] Furthermore, the present application also performs variant processing on the activation function (sigmoid) and the hyperbolic tangent function (tanh).
[0149] Specifically, see Fig.12 as well as Fig.13 , Fig.12 It is a mathematical curve diagram of an embodiment of a conventional activation function of the present application. Fig.13 It is a mathematical curve diagram of an embodiment of a conventional hyperbolic tangent function of the present application.
[0150] The regular sigmoid function transforms the input to an output on (0,1). It compresses any input in the range (inf, inf) to a value in the interval (0,1), expressed as: Formula 1-18
[0151] Among them, sigmoid n represents the regular sigmoid function; x1 represents the input of the regular sigmoid function; exp represents the natural exponential function.
[0152] The Sigmoid function involves exponential operations and is closer to a linear function in the limited range of [-2,2]. It may be difficult to calculate such a complex operation on a device with limited computing resources. Often, the corresponding data value is found by sampling and table lookup during quantization. In this embodiment, the quantization method in sampling training is used, and the input and output data can be adjusted as the network runs. Therefore, a piecewise linear function is used here to approximate the Sigmoid function quantization operation.
[0153] Specifically, the activation function in the video recommendation system can be replaced with the variant activation function provided in this embodiment. The mapping principle of the variant activation function in this embodiment is described in detail below.
[0154] In response to the analysis feature value of the analysis feature being in a fourth value interval, a first probability of an output of the variant activation function is obtained.
[0155] In response to the analysis feature value being in the fifth value interval, a calculated probability calculated by the variant activation function is obtained; wherein the calculated probability is positively correlated with the analysis feature value.
[0156] In response to the analysis that the characteristic value is located in the sixth value interval, a second probability of the output of the variant activation function is obtained.
[0157] That is to say, when the analysis eigenvalue belongs to the fourth value interval or the sixth value interval, a fixed value, namely the first probability and the second probability, can be directly output. When the input eigenvalue belongs to the fifth value interval, the output is the calculated probability calculated based on the analysis eigenvalue, and there is a linear relationship between the two, which can be considered to be positively correlated.
[0158] For example, the expression of the variant activation function in this embodiment is shown in Formula 1-6: Formula 1-6
[0159] Similarly, the regular tanh function can compress and convert its input to the interval (-1,1). The expression of the regular tanh function is as follows: Formula 1-19
[0160] Among them, tanh n represents the regular tanh function; x2 represents the input of the regular tanh function. Fig.13 As shown in the example, when the input is near 0, the regular tanh function is close to a linear transformation. The shape of the function is similar to the sigmoid function, except that the regular tanh function is symmetric about the origin of the coordinate system.
[0161] The tanh function involves exponential operations and is closer to a linear function in the limited range of [-2,2]. It may be difficult to calculate such a complex operation on a device with limited computing resources. Often, the corresponding data value is found by sampling and table lookup during quantization. In this embodiment, the quantization method in sampling training is used, and the input and output data can be adjusted as the network runs. Therefore, a piecewise linear function is used here to approximate the conventional tanh function quantization operation.
[0162] Specifically, the hyperbolic tangent function in the video recommendation system can be replaced by the variant hyperbolic tangent function provided in this embodiment. The mapping principle of the variant hyperbolic tangent function in this embodiment is described in detail below.
[0163] The input feature value inputted therein can be identified using a modified hyperbolic tangent function.
[0164] In response to the input eigenvalue being in the first value interval, a first eigenvalue of the output of the variant hyperbolic tangent function is obtained.
[0165] In response to the input eigenvalue being in the second value interval, a calculated eigenvalue calculated by the variant hyperbolic tangent function using the first eigenvalue is obtained; wherein the calculated eigenvalue is positively correlated with the input eigenvalue.
[0166] In response to the input eigenvalue being in the third value interval, a second eigenvalue output by the variant hyperbolic tangent function is obtained.
[0167] That is to say, when the input eigenvalue belongs to the first value interval or the third value interval, a fixed value, namely the first eigenvalue and the second eigenvalue, can be directly output. When the input eigenvalue belongs to the second value interval, the output is the calculated eigenvalue calculated based on the input eigenvalue, and there is a linear relationship between the two, so it can be considered that the two are positively correlated.
[0168] For example, the expression of the variant hyperbolic tangent function in this embodiment is as follows:
[0169] Formula 1-20
[0170] Among them, x fp32 Represents 32-bit floating-point information parameters; scale represents the quantization parameter; STE() represents the conversion to a gradient integer operation using a pseudo quantization node.
[0171] In summary, the video recommendation algorithm designed in this application uses a variant LSTM structure to learn the user behavior sequence information of users and their neighbors, predict the user's interest preference characteristics, and then integrate the characteristic information of users and their neighbors by taking the average aggregation method, predict the user's future interest preference, and recommend suitable projects, thereby improving the performance of the user video recommendation system. In view of the fact that the graph neural network can be accelerated on FPGA hardware, the graph neural network model is quantized and compressed to reduce the storage and computing resources used by the graph neural network. In order to ensure the accuracy of the graph neural network model, the video recommendation algorithm needs to be quantized to int8 data so that it can run on FPGA hardware. In the quantization process, the gradient is always 0 due to rounding. In this embodiment, a reasonable quantization method is designed on the straight-through estimation method to ensure the propagation of the gradient, so that the model parameters and quantization parameters are adjusted together with the training, and the quantization of the sigmoid and tanh functions is piecewise linearly approximated, and finally the network performance in the quantization process is improved in the optimization training method. After the model is quantized, the network model is converted to int8 numerical form, and the parallel computing and programmable characteristics of FPGA are used to achieve efficient and low-power acceleration of the graph neural network. The compression algorithm reduces the storage space and ensures the accuracy of the graph neural network.
[0172] That is, Graph Neural Network (GNN) has attracted a lot of attention due to its ability to model irregular structured data. GNN is widely used in various fields such as graph-based vertex classification, molecular interactions, social networks, recommendation systems, or program understanding. At present, the updates of GNN are mainly focused on building more complex models, including new graph convolutional layers and better aggregation functions. Although GNN models usually have few parameters, GNN has the characteristics of high memory usage and high computational complexity (manifested as long training or inference time) because the storage and computation requirements of each application are closely related to the size of the input graph data. This feature makes GNN unable to be effectively applied to most resource-constrained devices, such as systems such as FPGA devices. There are two main reasons behind this embarrassing situation. First, the input of GNN consists of two types of inputs, graph structure (edge list) and vertex features (embedding). When the scale of the graph becomes larger, it is easy to cause its storage size to increase dramatically. This will put great pressure on small devices with very limited memory budgets. Second, larger-scale graph data requires more data operations (such as addition and multiplication, etc.) and data movement (such as memory transactions, etc.), which will consume a lot of energy and exhaust the limited power budget on these micro devices. In this regard, the present application can overcome the above-mentioned technical problems to a certain extent, and can significantly reduce the storage space and calculation amount as much as possible while maintaining a high model accuracy.
[0173] Graph Neural Networks (GNNs) or Graph Convolutional Networks (GCNs) construct representations of nodes and edges in graph data. They are implemented through neighborhood aggregation (or message passing), where each node collects features from its neighborhood to update the representation of the local graph structure around it. Stacking several GNN layers enables the model to propagate the features of each node throughout the graph from its neighbors to its neighbors' neighbors. In video recommendation systems, the sequence of user behaviors sorted according to certain rules, such as generating a sequence of viewing video ids according to the viewing order of videos in video recommendation, and generating a sequence of product ids and store ids according to the purchase time of products in e-commerce recommendations, are collectively referred to as sequence features. User behavior sequences (UBS) contain rich information that can characterize user interests, including records of user browsing video ids over a period of time. It is a natural idea to use long short-term memory recurrent neural networks (LSTM) to capture sequence information. Optionally, the video dataset can use a public dataset or a self-built dataset. When forming the video identifiers included in the viewing sequence, the identifiers in the dataset can be used, which is not limited here.
[0174] It should be understood that although Figure 2-Figure 11 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-Figure 11 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0175] 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 described above are implemented, which will not be described in detail here.
[0176] See also Fig.14 , Fig.14 It is a structural diagram of an embodiment of a computer device of the present application.
[0177] In one embodiment, the computer device may be a server, and its internal structure diagram may be as follows: Fig.14 As shown in the example.
[0178] The computer device includes a processor, a memory, a network interface and a database connected through a system bus. 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, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store viewing behavior resource data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a video recommendation method is implemented.
[0179] Those skilled in the art will understand that Fig.14 The structure shown as an example is merely a block diagram of a portion of the structure related to the present application solution, and does not constitute a limitation on the computer device to which the present application solution 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.
[0180] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps may be implemented:
[0181] S101: Using a first feature extraction module to extract features from a target object's movie viewing sequence to obtain a first movie viewing feature; wherein the movie viewing sequence includes video identifiers of historically viewed videos.
[0182] S102: Using a second feature extraction module to extract features from the movie viewing sequence of the associated object to obtain a second movie viewing feature; wherein the associated object refers to other objects that have an associated relationship with the target object.
[0183] S103: Aggregate the first movie viewing feature and the second movie viewing feature to obtain an aggregated feature, use the aggregated feature to predict a recommended video identifier, and recommend a video corresponding to the recommended video identifier to a target object.
[0184] In one embodiment, the processor may further implement the following steps when executing the computer program: the second feature extraction module includes a first extractor and a second extractor; the second feature extraction module is used to perform feature extraction on the viewing sequence of the associated object to obtain the second viewing feature, including: inputting the viewing sequence of the first neighbor into the first extractor; inputting the viewing sequence of the second neighbor into the second extractor; wherein the associated object includes the first neighbor and the second neighbor, and the number of intermediate objects between the first neighbor and the target object is less than the number of intermediate objects between the second neighbor and the target object; the outputs of the first extractor and the second extractor are fused to obtain the second viewing feature.
[0185] In one embodiment, the processor can also implement the following steps when executing the computer program: before using the second feature extraction module to extract features from the viewing sequence of the associated object, it includes: selecting a first number of first neighbors, and generating a viewing sequence for each selected first neighbor; obtaining a second number of second neighbors, and generating a viewing sequence for each selected second neighbor; wherein the first number is less than the second number.
[0186] In one embodiment, the processor may further implement the following steps when executing the computer program: the first feature extraction module and / or the second feature extraction module includes a trained variational memory model, the variational memory model includes a forgetting gate, an input gate, and an output gate; using the trained variational memory model to extract features of the viewing sequence includes: inputting the extracted features of the viewing sequence into the forgetting gate, inputting the output of the forgetting gate into the input gate; inputting the output of the input gate into the output gate, and obtaining the viewing features output by the output gate that express the recommended video information.
[0187] In one embodiment, the processor can also implement the following steps when executing the computer program: inputting the output of the forget gate to the input gate includes: fusing the forget gate and the input gate; splicing the cell state parameters, hidden state parameters and features of the input viewing sequence at the historical moment to obtain input information; inputting the input information to the input gate.
[0188] In one embodiment, the processor can also implement the following steps when executing the computer program: the variational memory model also includes cell state parameters; using the trained variational memory model to extract features from the viewing sequence also includes: the forget gate selects the forgotten historical information; and updating the cell state parameters using the historical information and the output data of the input gate.
[0189] In one embodiment, the variational memory model includes a variational hyperbolic tangent function; when the trained variational memory model is used to extract features of a viewing sequence, the processor can also implement the following steps when executing a computer program: using the variational hyperbolic tangent function to identify an input feature value input thereto; in response to the input feature value being in a first value interval, obtaining a first feature value output by the variational hyperbolic tangent function; in response to the input feature value being in a second value interval, obtaining a calculated feature value calculated by the variational hyperbolic tangent function using the first feature value; wherein the calculated feature value is positively correlated with the input feature value; in response to the input feature value being in a third value interval, obtaining a second feature value output by the variational hyperbolic tangent function.
[0190] In one embodiment, the processor may further implement the following steps when executing the computer program: extracting features from the target object's viewing sequence, including: obtaining a third number of historical viewing records, and forming a viewing sequence based on the viewing order; inputting the viewing sequence into the trained current feature extraction model, and allowing the current feature extraction model to analyze the viewing behavior expressed by the viewing sequence to predict and output the video information that the current object potentially intends to watch; wherein the current feature extraction model includes a first feature extraction module and / or a second feature extraction module.
[0191] In one embodiment, the processor can also implement the following steps when executing the computer program: training the current feature extraction model includes: obtaining a fourth number of historical movie viewing records with a timeline relationship as test movie viewing records; wherein the difference between the fourth number and the third number is 1; forming a test sequence with the third number of test movie viewing records that occurred first, and using the remaining test movie viewing records as verification videos; outputting the test sequence to the current feature extraction model in training to obtain a test prediction video; and updating the model parameters of the current feature extraction model based on the matching degree between the test prediction video and the verification video.
[0192] In one embodiment, the processor can also implement the following steps when executing the computer program: predicting the potential video information that the current object intends to watch includes: obtaining analysis features of the viewing sequence; using a variant activation function to predict the probability of the current object intending to watch several preset videos based on the analysis features.
[0193] In one embodiment, when a variant activation function is used to predict the probability that the current object intends to watch several preset videos based on analysis features, the processor can also implement the following steps when executing the computer program: in response to the analysis feature value of the analysis feature being in the fourth value interval, a first probability output by the variant activation function is obtained; in response to the analysis feature value being in the fifth value interval, a calculated probability calculated by the variant activation function is obtained; wherein the calculated probability is positively correlated with the analysis feature value; in response to the analysis feature value being in the sixth value interval, a second probability output by the variant activation function is obtained.
[0194] In one embodiment, the processor can also implement the following steps when executing the computer program: the video recommendation method also includes: converting information parameters belonging to floating point type into integer type and inserting pseudo-quantization nodes to obtain calculation parameters of the information parameters; wherein the information parameters include at least one of model parameters and feature vectors, and the parameter length of the calculation parameters is shorter than the parameter length of the information parameters; using the calculation parameters to replace the information parameters for predictive calculation; in response to completing the predictive calculation, converting the updated calculation parameters into floating point type.
[0195] In one embodiment, when converting information parameters of floating-point type into integer type, the processor can also implement the following steps when executing the computer program: using a preset quantization value interval to constrain the value of the floating-point information parameter converted into an integer type to obtain an intermediate parameter with a gradient; wherein the intermediate parameter serves as a pseudo-quantization node; when inserting the pseudo-quantization node, the processor can also implement the following steps when executing the computer program: rounding and degrading the intermediate parameter to obtain a first intermediate value; degrading the intermediate parameter to obtain a second intermediate value; and superimposing the difference between the first intermediate value and the second intermediate value with the intermediate parameter to obtain a parameter for calculation.
[0196] In one embodiment, when a floating-point information parameter is converted into an integer value, the processor may further implement the following steps when executing a computer program: obtaining a ratio of the information parameter to a quantization parameter as data to be constrained; wherein the quantization parameter is obtained by weighting the original quantization parameter using a gradient quantization parameter, and the gradient quantization parameter is associated with the dimension of the information parameter.
[0197] 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 following steps can be implemented:
[0198] S101: Using a first feature extraction module to extract features from a target object's movie viewing sequence to obtain a first movie viewing feature; wherein the movie viewing sequence includes video identifiers of historically viewed videos.
[0199] S102: Using a second feature extraction module to extract features from the movie viewing sequence of the associated object to obtain a second movie viewing feature; wherein the associated object refers to other objects that have an associated relationship with the target object.
[0200] S103: Aggregate the first movie viewing feature and the second movie viewing feature to obtain an aggregated feature, use the aggregated feature to predict a recommended video identifier, and recommend a video corresponding to the recommended video identifier to a target object.
[0201] In one embodiment, the computer program can also implement the following steps when executed by the processor: the second feature extraction module includes a first extractor and a second extractor; the second feature extraction module is used to extract features of the viewing sequence of the associated object, and obtaining the second viewing feature includes: inputting the viewing sequence of the first neighbor into the first extractor; inputting the viewing sequence of the second neighbor into the second extractor; wherein the associated object includes the first neighbor and the second neighbor, and the number of intermediate objects between the first neighbor and the target object is less than the number of intermediate objects between the second neighbor and the target object; the outputs of the first extractor and the second extractor are fused to obtain the second viewing feature.
[0202] In one embodiment, when the computer program is executed by the processor, the following steps may also be implemented: before using the second feature extraction module to perform feature extraction on the viewing sequence of the associated object, the following steps include: selecting a first number of first neighbors, and generating a viewing sequence for each selected first neighbor; obtaining a second number of second neighbors, and generating a viewing sequence for each selected second neighbor; wherein the first number is less than the second number.
[0203] In one embodiment, when the computer program is executed by the processor, the following steps may also be implemented: the first feature extraction module and / or the second feature extraction module include a trained variational memory model, the variational memory model includes a forgetting gate, an input gate, and an output gate; using the trained variational memory model to extract features of the viewing sequence includes: inputting the extracted features of the viewing sequence into the forgetting gate, inputting the output of the forgetting gate into the input gate; inputting the output of the input gate into the output gate, and obtaining the viewing features output by the output gate that express the recommended video information.
[0204] In one embodiment, when the computer program is executed by the processor, the following steps can also be implemented: inputting the output of the forget gate to the input gate includes: fusing the forget gate and the input gate; splicing the cell state parameters, hidden state parameters and features of the input viewing sequence at the historical moment to obtain input information; inputting the input information to the input gate.
[0205] In one embodiment, when the computer program is executed by the processor, the following steps can also be implemented: the variational memory model also includes cell state parameters; using the trained variational memory model to extract features from the viewing sequence also includes: the forget gate selects the forgotten historical information; and the cell state parameters are updated using the historical information and the output data of the input gate.
[0206] In one embodiment, the variational memory model includes a variational hyperbolic tangent function; when the trained variational memory model is used to extract features of a viewing sequence, the computer program can also implement the following steps when executed by the processor: using the variational hyperbolic tangent function to identify an input feature value input thereto; in response to the input feature value being in a first value interval, obtaining a first feature value output by the variational hyperbolic tangent function; in response to the input feature value being in a second value interval, obtaining a calculated feature value calculated by the variational hyperbolic tangent function using the first feature value; wherein the calculated feature value is positively correlated with the input feature value; in response to the input feature value being in a third value interval, obtaining a second feature value output by the variational hyperbolic tangent function.
[0207] In one embodiment, when the computer program is executed by the processor, the following steps can also be implemented: feature extraction of the target object's viewing sequence includes: obtaining a third number of historical viewing records, and forming a viewing sequence based on the viewing order; inputting the viewing sequence into the trained current feature extraction model, and allowing the current feature extraction model to analyze the viewing behavior expressed by the viewing sequence to predict and output the video information that the current object potentially intends to watch; wherein the current feature extraction model includes a first feature extraction module and / or a second feature extraction module.
[0208] In one embodiment, when the computer program is executed by the processor, the following steps can also be implemented: training the current feature extraction model includes: obtaining a fourth number of historical movie viewing records with a timeline relationship as test movie viewing records; wherein the difference between the fourth number and the third number is 1; forming a test sequence with the third number of test movie viewing records that occurred first, and using the remaining test movie viewing records as verification videos; outputting the test sequence to the current feature extraction model in training to obtain a test prediction video; and updating the model parameters of the current feature extraction model based on the matching degree between the test prediction video and the verification video.
[0209] In one embodiment, when the computer program is executed by the processor, the following steps can also be implemented: predicting the video information that the current object potentially intends to watch includes: obtaining analysis features of the viewing sequence; using a variant activation function to predict the probability of the current object intending to watch several preset videos based on the analysis features.
[0210] In one embodiment, when a variant activation function is used to predict the probability that the current object intends to watch several preset videos based on analysis features, the computer program can also implement the following steps when executed by the processor: in response to the analysis feature value of the analysis feature being in the fourth value interval, a first probability output by the variant activation function is obtained; in response to the analysis feature value being in the fifth value interval, a calculated probability calculated by the variant activation function is obtained; wherein the calculated probability is positively correlated with the analysis feature value; in response to the analysis feature value being in the sixth value interval, a second probability output by the variant activation function is obtained.
[0211] In one embodiment, when the computer program is executed by the processor, the following steps can also be implemented: the video recommendation method also includes: converting information parameters belonging to floating point type into integer type and inserting pseudo-quantization nodes to obtain calculation parameters of the information parameters; wherein the information parameters include at least one of model parameters and feature vectors, and the parameter length of the calculation parameters is shorter than the parameter length of the information parameters; using the calculation parameters to replace the information parameters for predictive calculation; in response to completing the predictive calculation, converting the updated calculation parameters into floating point type.
[0212] In one embodiment, when converting information parameters of floating-point type into integer type, the computer program can also implement the following steps when executed by the processor: using a preset quantization value interval to constrain the value of the floating-point information parameter converted into an integer type to obtain an intermediate parameter with a gradient; wherein the intermediate parameter serves as a pseudo-quantization node; when inserting the pseudo-quantization node, the computer program can also implement the following steps when executed by the processor: rounding and degrading the intermediate parameter to obtain a first intermediate value; degrading the intermediate parameter to obtain a second intermediate value; and superimposing the difference between the first intermediate value and the second intermediate value with the intermediate parameter to obtain a parameter for calculation.
[0213] In one embodiment, when a floating-point information parameter is converted into an integer value, the following steps may be implemented when the computer program is executed by the processor: obtaining a ratio of the information parameter to a quantization parameter as data to be constrained; wherein the quantization parameter is obtained by weighting the original quantization parameter using a gradient quantization parameter, and the gradient quantization parameter is associated with the dimension of the information parameter.
[0214] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and 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. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0215] The technical features of the above embodiments may be combined arbitrarily. 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 specification.
[0216] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application.
Claims
1. A video recommendation method, characterized in that: The video recommendation method comprises: Using a first feature extraction module to extract features from the target object's movie viewing sequence to obtain a first movie viewing feature; wherein the movie viewing sequence includes video identifiers of historically viewed videos; Using a second feature extraction module to extract features from the movie viewing sequence of the associated object to obtain a second movie viewing feature; wherein the associated object refers to other objects that have an associated relationship with the target object; Aggregating the first movie viewing feature and the second movie viewing feature to obtain an aggregated feature, using the aggregated feature to predict a recommended video identifier, and recommending a video corresponding to the recommended video identifier to the target object; The first feature extraction module and / or the second feature extraction module includes a trained variant memory model, wherein the variant memory model includes a forget gate, an input gate, and an output gate; Using the trained variant memory model to extract features from the movie viewing sequence includes: Inputting the extracted features of the movie viewing sequence into the forget gate, and inputting the output of the forget gate into the input gate, so as to retain the historical information selected to be forgotten by the forget gate during the feature extraction process; The output of the input gate is input into the output gate to obtain the viewing feature expressing the recommended video information output by the output gate.
2. The video recommendation method according to claim 1, characterized in that: The second feature extraction module includes a first extractor and a second extractor; the second feature extraction module is used to extract features from the viewing sequence of the associated object to obtain the second viewing feature, including: Inputting the viewing sequence of the first neighbor into the first extractor; inputting the viewing sequence of the second neighbor into the second extractor; wherein the associated objects include the first neighbor and the second neighbor, and the number of intermediate objects between the first neighbor and the target object is less than the number of intermediate objects between the second neighbor and the target object; The outputs of the first extractor and the second extractor are combined to obtain the second movie viewing feature.
3. The video recommendation method according to claim 2, characterized in that: Before extracting features from the movie viewing sequence of the associated object using the second feature extraction module, the method includes: Selecting a first number of the first neighbors, and generating a movie viewing sequence for each of the selected first neighbors; Acquire a second number of the second neighbors, and generate a movie viewing sequence for each of the selected second neighbors; Wherein, the first number is less than the second number.
4. The video recommendation method according to claim 1, characterized in that: Inputting the output of the forget gate to the input gate comprises: Fusing the forget gate and the input gate; The input information is obtained by concatenating the cell state parameters and hidden state parameters at the historical moments and the features of the input viewing sequence; The input information is input to the input gate.
5. The video recommendation method according to claim 4, characterized in that: The variant memory model also includes a cell state parameter; and the feature extraction of the movie viewing sequence using the trained variant memory model also includes: Retain the historical information that the forget gate chooses to forget; The cell state parameters are updated using the historical information and the output data of the input gate.
6. The video recommendation method according to claim 5, characterized in that: The variant memory model includes a variant hyperbolic tangent function; and the feature extraction of the movie viewing sequence using the trained variant memory model also includes: Using the modified hyperbolic tangent function to identify input feature values inputted thereto; In response to the input eigenvalue being in a first value interval, obtaining a first eigenvalue output by the variant hyperbolic tangent function; In response to the input eigenvalue being in a second value interval, obtaining a calculated eigenvalue calculated by the modified hyperbolic tangent function using the first eigenvalue; wherein the calculated eigenvalue is positively correlated with the input eigenvalue; In response to the input eigenvalue being in a third value interval, a second eigenvalue output by the modified hyperbolic tangent function is obtained.
7. The video recommendation method according to claim 1, characterized in that: The feature extraction of the target object's viewing sequence includes: Acquire a third number of historical movie viewing records, and form the movie viewing sequence based on the movie viewing order; The movie viewing sequence is input into the trained current feature extraction model, and the current feature extraction model is enabled to analyze the movie viewing behavior expressed by the movie viewing sequence to predict and output the video information that the current object potentially intends to watch; wherein the current feature extraction model includes the first feature extraction module and / or the second feature extraction module.
8. The video recommendation method according to claim 7, characterized in that: Training the current feature extraction model includes: Acquire a fourth number of historical movie viewing records having a timeline relationship as test movie viewing records; wherein a difference between the fourth number and the third number is 1; The third number of the test viewing records that occurred previously form a test sequence, and the remaining test viewing records are used as verification videos; Output the test sequence to the current feature extraction model in training to obtain a test prediction video; Based on the degree of matching between the test prediction video and the verification video, the model parameters of the current feature extraction model are updated.
9. The video recommendation method according to claim 7, characterized in that: The video information that the current object is potentially intended to watch includes: Acquire analysis features for analyzing the movie viewing sequence; The variant activation function is used to predict the probability that the current object intends to watch several preset videos based on the analysis features; compared with the conventional activation function, the activation function curve formed by the variant activation function is close to a linear distribution.
10. The video recommendation method according to claim 9, characterized in that: The method of using the variant activation function to predict the probability of the current object intending to watch several preset videos based on the analysis features includes: In response to the analysis feature value of the analysis feature being in a fourth value interval, obtaining a first probability of the variant activation function output; In response to the analysis feature value being in the fifth value interval, obtaining a calculated probability calculated by the variant activation function; wherein the calculated probability is positively correlated with the analysis feature value; In response to the analysis feature value being in a sixth value interval, a second probability of the variant activation function output is obtained.
11. The video recommendation method according to claim 10, characterized in that: The video recommendation method further includes: Converting a floating-point information parameter into an integer type and inserting the integer into a pseudo-quantization node to obtain a calculation parameter of the information parameter; wherein the information parameter includes at least one of a model parameter and a feature vector, and a parameter length of the calculation parameter is shorter than a parameter length of the information parameter; Using the calculation parameters to replace the information parameters to perform prediction calculations; In response to completing the prediction calculation, the updated calculation parameter is converted into a floating point type.
12. The video recommendation method according to claim 11, characterized in that: The converting of the floating point information parameter into an integer type comprises: Using a preset quantization value interval, the floating-point information parameter is converted into an integer value to constrain the value, so as to obtain an intermediate parameter with a gradient; wherein the intermediate parameter is used as the pseudo quantization node; The inserting of the pseudo quantization node comprises: Performing rounding and gradient removal processing on the intermediate parameter to obtain a first intermediate value; Performing a degrading process on the intermediate parameter to obtain a second intermediate value; The difference between the first interval value and the second interval value is superimposed on the intermediate parameter to obtain the calculation parameter.
13. The video recommendation method according to claim 12, characterized in that: The floating point information parameter is converted into an integer value including: Acquire a ratio of the information parameter to the quantization parameter as data to be constrained; The quantization parameter is obtained by weighting the original quantization parameter using a gradient quantization parameter, and the gradient quantization parameter is associated with the dimension of the information parameter.
14. A video recommendation system, characterized in that: The video recommendation system is used to implement the video recommendation method according to any one of claims 1 to 13; the video recommendation system comprises: A first feature extraction module is used to extract features from the target object's viewing sequence to obtain a first viewing feature; wherein the viewing sequence includes video identifiers of historically viewed videos; A second feature extraction module is used to extract features from the viewing sequence of the associated object to obtain a second viewing feature; wherein the associated object refers to other objects that have an associated relationship with the target object; an aggregation module, connected to the first feature extraction module and the second feature extraction module, and configured to aggregate the first movie viewing feature and the second movie viewing feature to obtain an aggregated feature; The prediction module is connected to the aggregation module and is used to predict the recommended video identifier by using the aggregation feature, and recommend the video corresponding to the recommended video identifier to the target object.
15. The video recommendation system according to claim 14, characterized in that: The first feature extraction module includes a variant memory model, and the variant memory model includes a first input end, a second input end, and an output end; The first input end of the variant memory model is used to input the movie viewing sequence of the target object; The second input end of the variant memory model is used to input the initial cell state parameters and hidden state parameters, or the cell state parameters and initial hidden state parameters after the previous update; The output end of the variant memory model is used to output the first movie viewing feature.
16. The video recommendation system according to claim 15, characterized in that: The variant memory model includes a cell state, a hidden state, a forget gate, an input gate and an output gate; wherein the output end of the forget gate is connected to the input end of the input gate.
17. The video recommendation system according to claim 14, characterized in that: The second feature extraction module includes a first extractor, a second extractor, a first linear layer, a second linear layer and a connection layer; The input end of the first extractor is used to input the viewing sequence of the first neighbor; the output end of the first extractor is connected to the input end of the first linear layer; the output end of the first linear layer is connected to the input end of the connection layer; The input end of the second extractor is used to input the viewing sequence of the second neighbor; the output end of the second extractor is connected to the input end of the second linear layer; the output end of the second linear layer is connected to the input end of the connection layer; The connection layer is used to connect the features input from its input end to obtain the second movie viewing feature; The associated objects include the first neighbor and the second neighbor, and the number of intermediate objects between the first neighbor and the target object is less than the number of intermediate objects between the second neighbor and the target object.
18. The video recommendation system according to claim 14, characterized in that: The aggregation module includes a fusion module and a third linear layer; The input end of the fusion module is respectively connected to the first feature extraction module and the second feature extraction module, and is used to input the first viewing feature and the second viewing feature; the output end of the fusion module is connected to the input end of the third linear layer; and the output end of the third linear layer outputs the aggregated feature.
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 video recommendation method described in any one of claims 1 to 13 are implemented.
20. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the video recommendation method according to any one of claims 1 to 13 are implemented.
21. 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 video recommendation method according to any one of claims 1 to 13 are implemented.
Citation Information
Patent Citations
Project information recommendation method, device and equipment based on long short-term memory network
CN114240493A
Video recommendation method and device and computer equipment
CN118214927A