Media asset recommendation method and device, equipment, storage medium and product
By combining user characteristics and the semantic encoding of the media, the user's preferences are extracted and the recommendations of the media have solved the problem of not accurate recommendation of low -living user media capital, and achieved high accuracy of the recommendation effect of media capital.
Patent Information
- Application Number
- CN202411365245.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-28
AI Technical Summary
The existing media recommendation model is difficult to accurately recommend media for low-lived users, and user preferences are unstable.
By combining user characteristics and the semantic encoding of the media, the user preference is extracted, and the recommendation of media capital is based on this. Specific steps include obtaining the characteristics of historical media assets and user channel preferences, generating semantic encoding and user characteristics of historical media assets, extracting user preferences, and screening the most similar media assets from considerable media capital.
Recommended precision media capital for low -living users, improved the accuracy and user experience of recommendation.
Smart Images

Figure CN119377422A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular to a media resource recommendation method, device, equipment, storage medium and product. Background Art
[0002] With the rapid development of the Internet, it is difficult for users to quickly filter out the content of interest from the massive amount of information, and they are facing the problem of information overload. The information filtering technology of the personalized recommendation system allows users to quickly and effectively obtain the information of interest from the massive amount of data.
[0003] However, some user groups have low activity levels and watch too little media. For these low-activity users, the multi-interest representations extracted by existing media recommendation models are not stable enough and cannot accurately recommend media for these low-activity users. Summary of the invention
[0004] Based on this, the present invention provides a media resource recommendation method, apparatus, device, storage medium and product, which can extract user preferences by combining user characteristics and semantic coding of media resources, so as to make media resource recommendations based on user preferences, thereby accurately realizing media resource recommendations for low-activity users.
[0005] To achieve the above object, an embodiment of the present invention provides a media resource recommendation method, comprising:
[0006] Acquire characteristic information of historical media resources and channel preference information of the user; wherein the historical media resources are media resources played by the user in a recently set time period;
[0007] Generating a semantic code of the historical media asset based on the feature information of the historical media asset, and generating a historical media asset sequence representation based on the semantic codes of all the historical media assets;
[0008] generating a user characteristic representation based on the channel preference information;
[0009] Generate a user preference representation based on the historical media asset sequence representation and the user feature representation;
[0010] A set number of media assets with semantic codes closest to the user's preference representation are selected from the viewable media assets to be recommended to the user.
[0011] The generating of the semantic coding of the historical media assets based on the feature information of the historical media assets, and generating the historical media asset sequence representation based on the semantic coding of all the historical media assets, includes:
[0012] Encoding the characteristic information of the historical media asset into historical media asset embedding;
[0013] Performing multi-level quantization on the embedding of the historical media resources to obtain semantic coding of the historical media resources;
[0014] Mapping the semantic coding of the historical media resource into a semantic index;
[0015] splicing the semantic indexes of all the historical media resources in chronological order to obtain index splicing information;
[0016] Converting the index splicing information into a historical media asset sequence of the user and embedding it;
[0017] A position embedding matrix is introduced for embedding the historical media asset sequence to obtain a historical media asset sequence representation.
[0018] As an improvement of the above solution, the generating of the user characteristic representation based on the channel preference information includes:
[0019] generating an initial feature representation of the user based on the channel preference information;
[0020] Calling a projection algorithm to convert the initial feature representation into a user portrait projection matrix;
[0021] Obtaining the timestamp of the user playing the historical media resource within the most recent set time period;
[0022] Splicing all the timestamps in chronological order to obtain timestamp splicing information;
[0023] Calculate the time intervals between adjacent historical media resources according to the timestamps to obtain a time interval sequence;
[0024] Converting the timestamp splicing information and the time interval sequence into a timestamp sequence embedding and a time interval sequence embedding respectively;
[0025] Generate a temporal feature embedding according to the timestamp sequence embedding and the time interval sequence embedding;
[0026] The user portrait projection matrix and the time feature embedding are spliced and sent to a multi-layer perceptron-based feedforward neural network to output a user feature representation.
[0027] As an improvement of the above solution, the generating of the user preference representation according to the historical media asset sequence representation and the user feature representation includes:
[0028] Based on a multi-head attention mechanism, the historical media asset sequence representation and the user feature representation are processed, and the processing results are input into a feedforward neural network to extract the user preference representation.
[0029] As an improvement of the above solution, the step of selecting a set number of media assets with semantic codes closest to the user's preference representation from the viewable media assets to recommend to the user includes:
[0030] At least two graded preference representations are generated according to the user preference representation, and a set number of media assets with semantic codes closest to the graded preference representations are selected from the viewable media assets to be recommended to the user.
[0031] As an improvement of the above solution, the embedding of the historical media assets is quantized at multiple levels to obtain the semantic coding of the historical media assets, including:
[0032] In the current level quantization, the index of the target reference embedding is found from the preset current level codebook; wherein the target reference embedding is the reference embedding in the current level codebook that is closest to the embedding value to be processed of the current level; wherein the current level is any level from the zeroth level to the set level; if the current level is the zeroth level, the embedding value to be processed is the historical media asset embedding; if the current level is not the zeroth level, the embedding value to be processed of the current level is the difference between the embedding value to be processed of the previous level and the target reference embedding of the previous level;
[0033] A semantic encoding of the historical media asset is generated based on the indexes embedded in the target references of all levels.
[0034] To achieve the above purpose, an embodiment of the present invention further provides a media resource recommendation device, comprising:
[0035] An information acquisition module, used to acquire characteristic information of historical media resources and channel preference information of users; wherein the historical media resources are media resources played by the user in a recently set time period;
[0036] A media asset representation generation module, configured to generate a semantic code of the historical media asset based on the feature information of the historical media asset, and to generate a historical media asset sequence representation based on the semantic codes of all the historical media assets;
[0037] A user representation generation module, used to generate a user feature representation based on the channel preference information;
[0038] A preference extraction module, used to generate a user preference representation based on the historical media asset sequence representation and the user feature representation;
[0039] The media resource recommendation module is used to select a set number of media resources whose semantic codes are closest to the user's preference expression from the viewable media resources, and recommend them to the user.
[0040] To achieve the above objectives, an embodiment of the present invention further provides a media resource recommendation device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the media resource recommendation method as described in any of the above embodiments is implemented.
[0041] To achieve the above objectives, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the media resource recommendation method as described in any of the above embodiments.
[0042] To achieve the above objective, an embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the media asset recommendation method as described in any of the above embodiments when executed by a processor.
[0043] Compared with the prior art, the media recommendation method, device, equipment, storage medium and product disclosed in the embodiments of the present invention firstly generates the corresponding semantic coding by acquiring the characteristic information of the media played by the user in the most recent set time period, and then generates the historical media sequence representation, and generates the user characteristic representation by acquiring the user's channel preference information; then, generates the user preference representation based on the historical media sequence representation and the user characteristic representation; finally, selects the set recommended number of media with the semantic coding closest to the user preference representation from the viewable media, and recommends them to the user. It can be seen that the embodiments of the present invention extract the user preferences by combining the user characteristics and the semantic coding of the media, and recommends the media according to the user preferences, thereby accurately realizing the media recommendation for low-activity users. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the implementation mode will be briefly introduced below. Obviously, the drawings described below are only some implementation modes of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 is a flowchart of a media resource recommendation method provided by an embodiment of the present invention;
[0046] Figure 2 It is a schematic diagram of a semantic coding generation process provided by an embodiment of the present invention;
[0047] Figure 3 It is a schematic diagram of a model architecture provided by an embodiment of the present invention;
[0048] Figure 4is a structural diagram of a media resource recommendation device provided by an embodiment of the present invention;
[0049] Figure 5 It is a structural diagram of a media resource recommendation device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] See also Figure 1 , is a flow chart of a media resource recommendation method provided by an embodiment of the present invention. Specifically, the media resource recommendation method includes steps S1 to S5:
[0052] S1. Acquire characteristic information of historical media resources and channel preference information of users; wherein the historical media resources are media resources played by the user in a recently set time period.
[0053] Exemplarily, the characteristic information of media assets includes, but is not limited to, information such as director, actor, channel, text description, and characteristics of media asset content. The most recently set time period may be the most recent 3 days, the most recent 7 days, or the most recent month, etc., and its specific duration may be adjusted according to actual conditions. The user's channel preference information may include information such as the user's overall viewing time, the user's frequency-based viewing time, and the user's channel preference. It is understandable that the characteristic information of media assets, the most recently set time period, and the channel preference information may be set according to actual conditions and are not limited here.
[0054] S2. Generate semantic codes of the historical media assets based on the feature information of the historical media assets, and generate historical media asset sequence representations based on the semantic codes of all the historical media assets.
[0055] Specifically, in step S2, the characteristic information of the historical media assets is converted into a historical media asset sequence representation, so as to effectively express the characteristic information of the historical media assets. S,PThe specific generation method of is as follows: according to the information of the director, actor, channel, text description, etc. of the historical media assets, combined with the content characteristics of the media assets, the corresponding embedding vector (i.e., historical media asset embedding) is generated using the pre-trained text encoder, and then the embedding vector is quantized to generate the semantic encoding of the historical media assets (i.e., semantic ID), and then the semantic ID is converted into a semantic index, and the semantic indexes of all historical media assets are spliced in chronological order and sent to the embedding layer to form the user's historical click-to-play behavior id sequence embedding (i.e., historical media asset sequence embedding), and the user's historical click-to-play behavior id sequence embedding is used as the historical media asset sequence representation E S,P The maximum length of the user's historical click-to-play behavior id sequence embedding is set to 100 (this value can be set according to actual conditions). If it exceeds the maximum length, it will be truncated. The embedding technology is a method of mapping high-dimensional data to low-dimensional space, which is usually used to convert discrete and non-continuous data into continuous vector representation for computer processing.
[0056] S3. Generate a user feature representation based on the channel preference information.
[0057] Specifically, in step S3, the channel preference information is converted into a user feature representation to achieve the purpose of effectively expressing the channel preference information. Exemplarily, the channel preference information includes information such as the user's overall viewing time, the user's frequency-based viewing time, and the user's channel preference. These information are spliced together and sent to a feedforward neural network based on a multi-layer perceptron (MLP) to output the user's initial feature representation E u , the initial feature representation E u As user feature Q u .
[0058] S4. Generate a user preference representation according to the historical media asset sequence representation and the user feature representation.
[0059] S5. Filter out a set number of media assets whose semantic codes are closest to the user's preference expression from the viewable media assets, and recommend them to the user.
[0060] It is worth noting that the media resource recommendation method can be executed by any computing device, such as a server or a user terminal (such as a laptop computer, a desktop computer, etc.), and the specific number of recommended quantities can be set according to actual needs and is not limited here. It can be understood that the embodiments of the present invention are applicable to media recommendations for various electronic products, especially large-screen products (such as televisions).
[0061] Compared with the prior art, the embodiments of the present invention extract user preferences by utilizing semantic coding of user features and media features to recommend media assets based on user preferences, thereby accurately implementing media asset recommendations for low-activity users and alleviating the problem of poor recall results for low-activity users.
[0062] In a preferred embodiment, the generating of the semantic coding of the historical media assets based on the feature information of the historical media assets, and the generating of the historical media asset sequence representation based on the semantic coding of all the historical media assets, includes:
[0063] Encoding the characteristic information of the historical media asset into historical media asset embedding;
[0064] Performing multi-level quantization on the embedding of the historical media resources to obtain semantic coding of the historical media resources;
[0065] Mapping the semantic coding of the historical media resource into a semantic index;
[0066] splicing the semantic indexes of all the historical media resources in chronological order to obtain index splicing information;
[0067] Converting the index splicing information into a historical media asset sequence of the user and embedding it;
[0068] A position embedding matrix is introduced for embedding the historical media asset sequence to obtain a historical media asset sequence representation.
[0069] Specifically, the historical media asset sequence is represented by E S,PThe specific generation method of is as follows: 1. For the feature information of each historical media asset (such as the text description information of the historical media asset, the actors involved, the lines, and the text information related to the barrage, etc.), use BGE to obtain its embedding vector, where BGE is a general semantic vector model, the full name is BAAI GeneralEmbedding. 2. Based on the embedding vector of step 1, the multi-level quantizer assigns a semantic ID to each historical media asset, which applies quantization to the residual at multiple levels to generate a semantically encoded codeword (also called a semantic ID). First, it is defined as a codebook of length m. The semantic ID of each magnitude in the semantic ID tuple of the historical media asset comes from a different codebook. It can be understood that through multi-level quantization, similar media assets (media assets with similar content features or close embedding vectors) have overlapping semantic ids, for example: if the first-level index (first-level semantic ID) represents a TV series channel, the second-level index represents a costume drama or a modern drama, etc., and the third-level index represents a love drama, a suspense drama, etc. 3. Map the semantic ID of the historical media asset trained in step 2 into a digital index ID (i.e., semantic index), send the digital index ID to the embedding layer, and convert the digital index ID into the historical media asset embedding. The specific conversion principle of step 3 is shown in formulas (1) and (2):
[0070] index i =look_up(id i ) (1)
[0071] emd i = embedding(index i ) (2)
[0072] Where id i Indicates the media asset id, look_up() indicates the mapping function, index i represents the digital index id after the mapping function, embedding() represents the embedding function, emd i Represents the embedding vector after the embedding function. 4. The semantic indexes corresponding to the historical media resources (such as the video media resources that the user clicked and played in the past 7 days) are spliced in chronological order and sent to the embedding layer to form the user's historical click-to-play behavior id sequence embedding. Among them, the maximum length of the user's historical click-to-play behavior id sequence embedding is set to 100 (this value can be set according to actual conditions). If it exceeds the set maximum length, it will be truncated. In order to capture preferences in different periods, it is necessary to additionally introduce the position embedding information of the sequence. The learnable position embedding matrix is expressed as P = [P1; P2; ...; P t], t represents the length of user behavior, and the user's historical click-to-play behavior id sequence embedding is added to the position embedding matrix P to obtain the final historical media resource sequence representation E S,P .
[0073] In a preferred embodiment, the generating of the user characteristic representation based on the channel preference information includes:
[0074] generating an initial feature representation of the user based on the channel preference information;
[0075] Calling a projection algorithm to convert the initial feature representation into a user portrait projection matrix;
[0076] Obtaining the timestamp of the user playing the historical media resource within the most recent set time period;
[0077] Splicing all the timestamps in chronological order to obtain timestamp splicing information;
[0078] Calculate the time intervals between adjacent historical media resources according to the timestamps to obtain a time interval sequence;
[0079] Converting the timestamp splicing information and the time interval sequence into a timestamp sequence embedding and a time interval sequence embedding respectively;
[0080] Generate a temporal feature embedding according to the timestamp sequence embedding and the time interval sequence embedding;
[0081] The user portrait projection matrix and the time feature embedding are spliced and sent to a multi-layer perceptron-based feedforward neural network to output a user feature representation.
[0082] It should be noted that in the large-screen TV recommendation scenario, multiple family members often share a TV account, so their historical behaviors are also mixed together. For example: (animation, variety shows, movies), users can show multiple interests from their historical behaviors. In the large-screen multi-interest scenario, since multiple users share a device and it is common for the same user to operate in the same time period, if multi-interest modeling only considers historical sequence information and lacks contextual time perception information, then the impact of the date when the user clicks on the media and the different intervals between contexts on the recommendation performance will be ignored. Existing multi-interest recommendation methods overemphasize the relevance of historical interaction sequences and only consider the best matching interest for each candidate media asset. If the interaction sequence on the family TV consists of many cartoons and a small number of movies, such as (The Invisible Guest, Detective Chinatown, Peppa Pig, SpongeBob SquarePants, Milkman), the next one may have a higher matching score for cartoons. These models ignore key temporal dynamic information and have poor recommendation performance.
[0083] Based on this, this implementation combines the timestamp with the time interval to assist the channel preference information in generating the user feature representation, so as to alleviate the problem that the prior art is insufficient in expressing the time factor. The specific generation method of the user feature representation is as follows:
[0084] 1. Channel preference information X u This includes information such as the user's overall viewing time, the user's frequency-based viewing time, and the user's channel preference. These user information are spliced together and sent to the MLP-based feedforward neural network to output the initial feature representation E u Among them, the initial feature represents E u The specific implementation formula is as follows:
[0085] X u =[x u,1 ,x u,2 ,...,x u,n ] (3)
[0086] E u =f u (W u X u +b u ) (4)
[0087] Where n represents the number of channel preference information, W u and b u represents the trainable parameters of the MLP-based feedforward neural network, f u represents the activation function, E u Represents the initial feature representation of the user.
[0088] 2. Concatenate the timestamps corresponding to the historical media resources (such as the video media resources clicked and played by the user in the past 7 days) in chronological order to obtain the timestamp concatenation information, and calculate the time interval between the two media resources according to the timestamps, and finally obtain the time interval sequence. It is known that the timestamp sequence of the current user (i.e., the timestamp concatenation information) is [t1; t2; ...; t t ], if there is no user click behavior within 7 days before t1, the time interval of the corresponding position is 0, and the time interval of t2 is t2-t1. After calculating the time intervals in sequence, the time interval sequence is obtained, and then sent to the embedding layer to form the user click timestamp sequence embedding E t1 (i.e., timestamp sequence embedding) and user click time interval sequence embedding E t2 (i.e. time interval sequence embedding), the calculation method of time feature embedding is T mix =E t1 ⊙E t2 , where ⊙ is the Hadamard product.
[0089] 3. In order to learn user preferences more effectively, a time-aware multi-interest recommendation model is introduced. First, the user portrait embedding (i.e., the initial feature representation E u ), and obtain the output representation (i.e., the user portrait projection matrix) through the projection matrix:
[0090] Q 初始 =E u W i Q (5)
[0091] Among them, W i Q Represents a mapping matrix.
[0092] In order to accurately perceive the real-time interests of the current user, the user portrait projection matrix and the time features of step 2 are embedded into T mix After concatenation, it is fed into the MLP-based feedforward neural network to output the user feature representation Q u , the specific formula is as follows:
[0093] Q u =concat[Q 初始 ,T mix ] (6)
[0094] Q u =f u (W u Q u +b u )(7)
[0095] Compared with the existing multi-interest recommendation methods, the proposed method combines timestamps with time intervals, which alleviates the problem that the current large-screen recommendation model has insufficient expression ability of time factors and improves the recommendation performance of the recommendation system.
[0096] In a preferred embodiment, generating the user preference representation according to the historical media asset sequence representation and the user feature representation includes:
[0097] Based on a multi-head attention mechanism, the historical media asset sequence representation and the user feature representation are processed, and the processing results are input into a feedforward neural network to extract the user preference representation.
[0098] Specifically, a multi-head attention module is used to capture the temporal dependencies of the user's temporal perception. It first projects the input sequence representation (i.e., the historical media sequence representation) into h subspaces using different linear projections. Then, the self-attention mechanism is applied to each head, and the output representation MHSA (Fl ). In order to avoid the sparse sequence affecting the model's expression performance, the query matrix of the multi-head attention module uses the user feature representation Q after the user portrait and time feature are fused calculated by formula (7): u , the specific calculation method is shown in formula (11). The data processing process of the multi-head attention module is shown in the following formula:
[0099] MHSA(F l )=[head1,head2,...,head h ]W o (8)
[0100]
[0101] Among them, F l Represents the input of the lth layer, including the historical media sequence representation E S,P And the output of layer l-1. o represents the learnable parameters of each head, represents the normalized scaling factor, W i Q , and Represents the mapping matrix, where h represents the different linear projection subspaces after entering the layer, Q represents the query statement of the multi-head attention module, V represents the data item, and K represents the key corresponding to each data item.
[0102] Although the user characteristics indicate Q u The guided attention distribution is conducive to learning rich contextual knowledge, but it is still based on linear projection. Therefore, after the multi-head attention, the output of the multi-head attention module is given to the feedforward neural network layer, which is applicable to each position of the multi-head attention output. The detailed calculation principle is as follows:
[0103] FFN(x)=(ReLu(xW1+b1))W2+b2(12)
[0104] x (l-1) =LayerNorm(x (l-1) +Dropout(MHSA(x (l-1) )))(13)
[0105] F(x (l) )=LayerNorm(x (l-1) +Dropout(FFN(x (l-1) )))(14)
[0106] Among them, the role of LayerNorm is to achieve normalization and prevent data from falling into the saturation area of the activation function to reduce the problem of gradient disappearance; Dropout is a regularization technology to prevent deep neural networks from overfitting. It increases the generalization ability of the model by randomly shutting down some neurons during training. ReLu is the activation function.
[0107] In one embodiment, the user's channel preference information includes the user's overall viewing time and the user's frequency-based viewing time. It is understandable that the user's overall viewing time and the user's frequency-based viewing time reflect the user's channel preference to a certain extent.
[0108] In a preferred embodiment, the step S5 of selecting a set recommended number of media assets whose semantic codes are closest to the user preference representation from the viewable media assets for recommendation to the user includes: generating at least two graded preference representations based on the user preference representation, and selecting a set recommended number of media assets whose semantic codes are closest to the graded preference representations from the viewable media assets for recommendation to the user.
[0109] Specifically, in order to efficiently utilize the interpretability of semantic coding, after generating a high-quality user preference representation, the top k media assets of user interest are hierarchically retrieved from the constructed semantic coding. In the early training stage, the user preference representation is the final representation E obtained after calculation by formula (14). s , and calculate the similarity with the media resource to be recommended. The loss function is as follows:
[0110]
[0111] In order to keep consistent with offline training, the subsequent reasoning stage first needs to retrieve media assets from different levels according to the user preference representation, and use the nearest neighbor search method to obtain at least one result with the highest probability as output. For example, if the user's historical semantic id sequence is (5,4,1)(5,4,2)(3,6,4), then the finally learned representation vector (i.e., hierarchical preference representation) will predict at least one viewable media asset with the highest probability in the label from (5), (3), (5,4) and (3,6) respectively, so that multi-interest media assets can be recalled from the perspective of intuitive interpretability.
[0112] In a preferred implementation, the embedding of the historical media assets is quantized at multiple levels to obtain the semantic coding of the historical media assets, including:
[0113] In the current level quantization, the index of the target reference embedding is found from the preset current level codebook; wherein the target reference embedding is the reference embedding in the current level codebook that is closest to the embedding value to be processed of the current level; wherein the current level is any level from the zeroth level to the set level; if the current level is the zeroth level, the embedding value to be processed is the historical media asset embedding; if the current level is not the zeroth level, the embedding value to be processed of the current level is the difference between the embedding value to be processed of the previous level and the target reference embedding of the previous level;
[0114] A semantic encoding of the historical media asset is generated based on the indexes embedded in the target references of all levels.
[0115] Specifically, the semantic coding of media assets is generated as follows: Figure 2 As shown, at each level, there is a codebook Each codebook has k embedding vectors, and the size of k depends on the number of media assets. Then, the initial embedding r0 (i.e., the historical media asset embedding) is mapped to the nearest embedding in the codebook at that level to quantize. The index corresponding to the closest initial embedding is found at d = 0 (i.e., the zeroth level codebook), representing the zeroth codeword (i.e., the target reference embedding of the zeroth level quantization), i.e., c0 = argmin k ∥r0-e k ∥, where c0 represents the residual of the zeroth level. For the next level d = 1, the residual is defined as the difference between the embedding of the previous level (i.e., embeddingr0) and the embedding corresponding to the codeword, i.e. Then, similar to the zeroth level, the codeword of the first level is calculated by finding the embedding in the codebook of the first level that is closest to the residual r1. This process is repeated recursively m times to obtain m tuples representing semantic IDs. This recursive method approximates the input from coarse-grained to fine-grained, and finally assigns each media asset a corresponding semantic ID (c0,…,c m-1 ), the final quantitative representation
[0116] Among them, in the early training process, the loss function of the semantic ID training stage is as follows:
[0117]
[0118] Among them, sg means stop gradient. The initial codebook is initialized using k-means clustering, applying the k-means algorithm to the first training batch and using the centroid as initialization.
[0119] In order to make the process of the media resource recommendation method clearer, the following briefly introduces the entire process. Figure 3 The model architecture diagram shown in the figure, 1. According to the obtained user portrait (user's channel preference information), vectorization processing and matrix projection are performed to obtain the user portrait projection matrix; 3. The timestamp sequence and time interval sequence are obtained and vectorized, and the Hadamard product of the two vectorized time information is calculated to obtain the time feature embedding Tmix; 3. The user portrait projection matrix and the time feature embedding Tmix are spliced and input into the MLP-based feedforward neural network (MLP Layer), and the output information is used as the query statement Q of the multi-head attention module; 4. The semantic ID sequence (that is, the semantic encoding of all historical media assets) is obtained, and the historical media asset sequence representation is obtained after the semantic index conversion and splicing processing, and the historical media asset sequence representation is processed to obtain the data item V and key K of the multi-head attention module; 5. The query statement Q, data item V and key K are input into the multi-head attention module, and the output of the multi-head attention module is input into the feedforward neural network Feed Forward to extract the user preference representation Interest, and the user preference representation is calculated with the semantic encoding of the viewable media assets. The media with higher similarity is screened out to recommend to the user. Among them, in the early training process, the Label semantic ID is used as sample data and used to calculate the loss function during model training, so as to adjust the model parameters according to the calculated loss function. For example, in the training process, it is assumed that the semantic ID sequence is a sequence including the semantic codes of "The Invisible Guest", "Detective Chinatown 3", "Peppa Pig" and "SpongeBob SquarePants", and the Label semantic ID is the semantic code of the media resource clicked by the user, assuming it is "Milk Dragon", and these data are used for model training.
[0120] Compared with the prior art, the embodiments of the present invention alleviate the problem of insufficient expression of time factors in the current large-screen recommendation model by combining timestamps with time intervals, thereby improving the recommendation performance of the recommendation system; and alleviate the problem of poor recall results for low-activity users by utilizing user portraits and produced media asset semantic IDs; in addition, by specifically recalling multi-interest media assets from semantic IDs at different levels, the user experience is improved from the perspective of explainability.
[0121] See also Figure 4 , Figure 4 2 is a schematic diagram of the structure of a media resource recommendation device provided by an embodiment of the present invention. The media resource recommendation device 20 includes:
[0122] The information acquisition module 21 is used to acquire characteristic information of historical media resources and channel preference information of users; wherein the historical media resources are media resources played by the user in the most recent set time period;
[0123] A media asset representation generation module 22, configured to generate a semantic code of the historical media asset based on the feature information of the historical media asset, and to generate a historical media asset sequence representation based on the semantic codes of all the historical media assets;
[0124] A user representation generating module 23, configured to generate a user feature representation based on the channel preference information;
[0125] A preference extraction module 24, configured to generate a user preference representation based on the historical media asset sequence representation and the user feature representation;
[0126] The media resource recommendation module 25 is used to select a set number of media resources whose semantic codes are closest to the user's preference expression from the viewable media resources, and recommend them to the user.
[0127] In one implementation, the media asset representation generation module 22 is specifically configured to:
[0128] Encoding the characteristic information of the historical media asset into historical media asset embedding;
[0129] Performing multi-level quantization on the embedding of the historical media resources to obtain semantic coding of the historical media resources;
[0130] Mapping the semantic coding of the historical media resource into a semantic index;
[0131] splicing the semantic indexes of all the historical media resources in chronological order to obtain index splicing information;
[0132] Converting the index splicing information into a historical media asset sequence of the user and embedding it;
[0133] A position embedding matrix is introduced for embedding the historical media asset sequence to obtain a historical media asset sequence representation.
[0134] In one implementation, the user representation generating module 23 is specifically configured to:
[0135] generating an initial feature representation of the user based on the channel preference information;
[0136] Calling a projection algorithm to convert the initial feature representation into a user portrait projection matrix;
[0137] Obtaining the timestamp of the user playing the historical media resource within the most recent set time period;
[0138] Splicing all the timestamps in chronological order to obtain timestamp splicing information;
[0139] Calculate the time intervals between adjacent historical media resources according to the timestamps to obtain a time interval sequence;
[0140] Converting the timestamp splicing information and the time interval sequence into a timestamp sequence embedding and a time interval sequence embedding respectively;
[0141] Generate a temporal feature embedding according to the timestamp sequence embedding and the time interval sequence embedding;
[0142] The user portrait projection matrix and the time feature embedding are spliced and sent to a multi-layer perceptron-based feedforward neural network to output a user feature representation.
[0143] In one implementation, the preference extraction module 24 is specifically configured to:
[0144] Based on a multi-head attention mechanism, the historical media asset sequence representation and the user feature representation are processed, and the processing results are input into a feedforward neural network to extract the user preference representation.
[0145] In one implementation, the media resource recommendation module 25 is specifically used to:
[0146] At least two graded preference representations are generated according to the user preference representation, and a set number of media assets with semantic codes closest to the graded preference representations are selected from the viewable media assets to be recommended to the user.
[0147] In one implementation, the embedding of the historical media assets is quantized at multiple levels to obtain the semantic encoding of the historical media assets, including:
[0148] In the current level quantization, the index of the target reference embedding is found from the preset current level codebook; wherein the target reference embedding is the reference embedding in the current level codebook that is closest to the embedding value to be processed of the current level; wherein the current level is any level from the zeroth level to the set level; if the current level is the zeroth level, the embedding value to be processed is the historical media asset embedding; if the current level is not the zeroth level, the embedding value to be processed of the current level is the difference between the embedding value to be processed of the previous level and the target reference embedding of the previous level;
[0149] A semantic encoding of the historical media asset is generated based on the indexes embedded in the target references of all levels.
[0150] It is worth noting that the specific working process of the media resource recommendation device can refer to the working process of the media resource recommendation method described in the above embodiment, which will not be described in detail here.
[0151] Compared with the prior art, the media asset recommendation device disclosed in the embodiment of the present invention first generates the corresponding semantic code by acquiring the characteristic information of the media assets played by the user in the most recent set time period, and then generates the historical media asset sequence representation, and generates the user feature representation by acquiring the user's channel preference information; then, generates the user preference representation based on the historical media asset sequence representation and the user feature representation; finally, selects the set recommended number of media assets whose semantic codes are closest to the user preference representation from the viewable media assets, and recommends them to the user. It can be seen that the embodiment of the present invention extracts the user preferences by combining the user characteristics and the semantic codes of the media assets, and recommends the media assets according to the user preferences, thereby accurately realizing the media asset recommendation for low-activity users.
[0152] See also Figure 5 , Figure 5 is a structural diagram of a media asset recommendation device provided in an embodiment of the present invention. The media asset recommendation device 30 includes a processor 31, a memory 32, and a computer program stored in the memory 32 and configured to be executed by the processor 31. When the processor 31 executes the computer program, the steps in the above-mentioned media asset recommendation method embodiment are implemented, for example Figure 1 or, the processor 31 implements the functions of each module in the above-mentioned device embodiments when executing the computer program.
[0153] Exemplarily, the computer program may be divided into one or more modules, which are stored in the memory 32 and executed by the processor 31 to complete the present invention. The one or more modules may be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program in the media asset recommendation device. For example, the computer program may be divided into a login module, a material index acquisition module, a tag acquisition module, and a service provision module, and the specific functions of each module are as follows:
[0154] The information acquisition module 21 is used to acquire characteristic information of historical media resources and channel preference information of users; wherein the historical media resources are media resources played by the user in the most recent set time period;
[0155] A media asset representation generation module 22, configured to generate a semantic code of the historical media asset based on the feature information of the historical media asset, and to generate a historical media asset sequence representation based on the semantic codes of all the historical media assets;
[0156] A user representation generating module 23, configured to generate a user feature representation based on the channel preference information;
[0157] A preference extraction module 24, configured to generate a user preference representation based on the historical media asset sequence representation and the user feature representation;
[0158] The media resource recommendation module 25 is used to select a set number of media resources whose semantic codes are closest to the user's preference expression from the viewable media resources, and recommend them to the user.
[0159] The specific working process of each module can refer to the working process of the media resource recommendation device described in the above embodiment, and will not be repeated here.
[0160] The media resource recommendation device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The media resource recommendation device may include, but is not limited to, a processor 31 and a memory 32. Those skilled in the art may understand that the media resource recommendation device may also include an input and output device, a network access device, a bus, etc.
[0161] The processor 31 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 31 is the control center of the media resource recommendation device, and uses various interfaces and lines to connect various parts of the entire media resource recommendation device.
[0162] The memory 32 can be used to store the computer program and / or module. The processor 31 implements various functions of the media asset recommendation device by running or executing the computer program and / or module stored in the memory 32 and calling the data stored in the memory 32. The memory 32 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory 32 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0163] Wherein, if the module integrated in the media resource recommendation device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor 31, the steps of the above-mentioned method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0164] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the media asset recommendation method as described in any of the above embodiments when executed by a processor.
[0165] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A media resource recommendation method, characterized in that: include: Acquire characteristic information of historical media resources and channel preference information of the user; wherein the historical media resources are media resources played by the user in a recently set time period; Generating a semantic code of the historical media asset based on the feature information of the historical media asset, and generating a historical media asset sequence representation based on the semantic codes of all the historical media assets; generating a user characteristic representation based on the channel preference information; Generate a user preference representation based on the historical media asset sequence representation and the user feature representation; A set number of media assets with semantic codes closest to the user's preference representation are selected from the viewable media assets to be recommended to the user.
2. The media resource recommendation method according to claim 1, characterized in that: The generating of the semantic coding of the historical media assets based on the feature information of the historical media assets, and generating the historical media asset sequence representation based on the semantic coding of all the historical media assets, includes: Encoding the characteristic information of the historical media asset into historical media asset embedding; Performing multi-level quantization on the embedding of the historical media resources to obtain semantic coding of the historical media resources; Mapping the semantic coding of the historical media resource into a semantic index; splicing the semantic indexes of all the historical media resources in chronological order to obtain index splicing information; Converting the index splicing information into a historical media asset sequence of the user and embedding it; A position embedding matrix is introduced for embedding the historical media asset sequence to obtain a historical media asset sequence representation.
3. The media resource recommendation method according to claim 1, characterized in that: The generating of the user characteristic representation based on the channel preference information comprises: generating an initial feature representation of the user based on the channel preference information; Calling a projection algorithm to convert the initial feature representation into a user portrait projection matrix; Obtaining the timestamp of the user playing the historical media resource within the most recent set time period; Splicing all the timestamps in chronological order to obtain timestamp splicing information; Calculate the time intervals between adjacent historical media resources according to the timestamps to obtain a time interval sequence; Converting the timestamp splicing information and the time interval sequence into a timestamp sequence embedding and a time interval sequence embedding respectively; Generate a temporal feature embedding according to the timestamp sequence embedding and the time interval sequence embedding; The user portrait projection matrix and the time feature embedding are spliced and sent to a multi-layer perceptron-based feedforward neural network to output a user feature representation.
4. The media resource recommendation method according to any one of claims 1 to 3, characterized in that: The generating the user preference representation according to the historical media asset sequence representation and the user feature representation comprises: Based on a multi-head attention mechanism, the historical media asset sequence representation and the user feature representation are processed, and the processing results are input into a feedforward neural network to extract the user preference representation.
5. The media resource recommendation method according to claim 1, wherein: The step of selecting a set number of media assets with semantic codes closest to the user's preference representation from the viewable media assets to recommend to the user includes: At least two graded preference representations are generated according to the user preference representation, and a set number of media assets with semantic codes closest to the graded preference representations are selected from the viewable media assets to be recommended to the user.
6. The media resource recommendation method according to claim 2, characterized in that: The embedding of the historical media resources is subjected to multi-level quantization to obtain the semantic coding of the historical media resources, including: In the current level quantization, the index of the target reference embedding is found from the preset current level codebook; wherein the target reference embedding is the reference embedding in the current level codebook that is closest to the embedding value to be processed of the current level; wherein the current level is any level from the zeroth level to the set level; if the current level is the zeroth level, the embedding value to be processed is the historical media asset embedding; if the current level is not the zeroth level, the embedding value to be processed of the current level is the difference between the embedding value to be processed of the previous level and the target reference embedding of the previous level; A semantic encoding of the historical media asset is generated based on the indexes embedded in the target references of all levels.
7. A media resource recommendation device, characterized in that: include: An information acquisition module, used to acquire characteristic information of historical media resources and channel preference information of users; wherein the historical media resources are media resources played by the user in a recently set time period; A media asset representation generation module, configured to generate a semantic code of the historical media asset based on the feature information of the historical media asset, and to generate a historical media asset sequence representation based on the semantic codes of all the historical media assets; A user representation generation module, used to generate a user feature representation based on the channel preference information; A preference extraction module, used to generate a user preference representation based on the historical media asset sequence representation and the user feature representation; The media resource recommendation module is used to select a set number of media resources whose semantic codes are closest to the user's preference expression from the viewable media resources, and recommend them to the user.
8. A media resource recommendation device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the media asset recommendation method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the media asset recommendation method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the media asset recommendation method according to any one of claims 1 to 6 is implemented.