Media File Recommendation Method, Device, Electronic Device and Computer Storage Medium

The media and user feature vectors are extracted by the BERT, item2vec and T-AM models in the preset processor, and combined with the time attention mechanism, the problem of media file recommendation algorithms in the prior art focusing on surface features and relying on user features is solved, and accurate media file recommendation is achieved.

CN114637907BActive Publication Date: 2025-07-08GUANGZHOU YAXIN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110875625.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-30
Publication Date
2025-07-08
Estimated Expiration
2041-07-30

AI Technical Summary

Technical Problem

The existing media file recommendation algorithm mainly focuses on the surface characteristics of media files, lacks in-depth analysis, and relies on user feature construction, resulting in poor recommendation results, especially ineffective in cold start issues and lack of diversity.

Method used

The preset processor is adopted, including the BERT model, item2vec model and T-AM model, and the feature vectors are extracted from the media data and user data respectively. Combined with the time attention mechanism, the feature vectors are fused for similarity calculations, and media files that meet the deep interests of users are recommended.

Benefits of technology

It realizes a comprehensive recommendation from both media similarity and user similarity, which can accurately capture the user's deep interest preferences, and the recommendation results are well interpretable and diverse.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114637907B_ABST
    Figure CN114637907B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a method, apparatus, electronic device, and computer-readable storage medium for recommending media files. The method for recommending media files includes: obtaining media data of a target user; inputting the media data into a preset processor to obtain a recommendation result of the target user; the preset processor includes a first processor, a second processor, and a third processor; the first processor determines a first feature vector based on the context information of the first media data; the second processor determines a second feature vector based on the low-dimensional vector corresponding to the second media data; the third processor determines a third feature vector of the target user based on the time attention mechanism and the media data; the recommendation result is determined according to the first feature vector, the second feature vector, and the third feature vector. The embodiment of the present application processes the media data through a preset processor, realizes the recommendation of media files from two aspects of media similarity and user similarity, and the recommendation result is more comprehensive and accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data processing. Specifically, the present application relates to a method, an apparatus, an electronic device, and a computer-readable storage medium for recommending media files. Background Art

[0002] In recent years, with the wide application of recommendation systems in Internet e-commerce, search engines, and video websites, their significant technical inspiration has attracted the attention of the industry. More and more enterprises have begun to focus on the research and application of intelligent recommendation, applying related technologies of artificial intelligence to the field of intelligent recommendation to improve the user experience. Generally speaking, intelligent recommendation is based on the user's past behavior to infer the user's potential interests and hobbies, and then recommend things that the user may be interested in to the user.

[0003] Current recommendation algorithms are mainly divided into collaborative filtering-based recommendation algorithms and user feature-based recommendation algorithms. Among them, the collaborative filtering-based recommendation algorithm only considers the superficial connection between media files, and there may be a situation where the superficial features of two media files are very similar but the actual content is completely different. At the same time, due to the strong dependence of the collaborative filtering-based recommendation algorithm on habitual data, it cannot solve the cold start problem, and its efficiency is not conducive to large-scale deployment applications. The user feature-based recommendation algorithm, on the other hand, is extremely dependent on the construction of user features. The recommendation effect is limited by the detailed degree of the description of media content, and it is easily affected by the technical personnel who construct the features. At the same time, the user feature-based recommendation method will always recommend media closely related to the content to the user, lacking the diversity of recommended content. Summary of the Invention

[0004] The present application provides a method, an apparatus, an electronic device, and a computer-readable storage medium for recommending media files, which are used to solve the problems that the existing media file recommendation methods only focus on the superficial features of media files, the attention level is relatively shallow, and they rely on the construction effect of user features.

[0005] According to one aspect of the present application, there is provided a method for recommending media files, including:

[0006] Obtaining media data of a target user; wherein the media data includes first media data and second media data; the first media data includes media type information of the historical playback data of the target user, and the second media data includes playback time information of the historical playback data;

[0007] Input media data into a preset processor to obtain a recommendation result for the target user; wherein, the preset processor includes a first processor, a second processor, and a third processor; the first processor determines a first feature vector based on the context information of the first media data; the second processor determines a second feature vector based on the low-dimensional vector corresponding to the second media data; the third processor determines a third feature vector of the target user based on the time attention mechanism and the media data; the recommendation result is determined according to the first feature vector, the second feature vector, and the third feature vector.

[0008] Optionally, obtaining the media data of the target user includes:

[0009] Obtain the historical playback data of the target user; wherein, the historical playback data includes media name information, media type information, and playback time information;

[0010] Determine the first media data of the target user according to the media name information and media type information in the historical playback data;

[0011] Determine the second media data of the target user according to the media name information and playback time information in the historical playback data.

[0012] Optionally, determining the first media data of the target user according to the media name information and media type information in the historical playback data includes:

[0013] Obtain the first media initial data in the historical playback data; the first media initial data includes media name information and media type information;

[0014] When there is no corresponding duration data in the first media initial data, use the first duration data as the duration data in the first media initial data; the first duration data is the duration data with the longest playback duration in the historical playback data;

[0015] When the duration data in the first media initial data is less than the preset duration data, update the duration data in the first media initial data to the preset duration data to obtain the first media data.

[0016] Optionally, determining the second media data of the target user according to the media name information and playback time information in the historical playback data includes:

[0017] Obtain the second media initial data in the historical playback data; the second media initial data includes media name information and playback time information; the playback time information includes the playback start time and the playback end time;

[0018] Filter out the second media initial data with corresponding first media data according to the media name information as the second media data.

[0019] Optionally, input the media data into a preset processor to obtain the recommendation result of the target user, including:

[0020] Input the media data into a preset processor to obtain a first feature vector, a second feature vector, and a third feature vector;

[0021] Perform feature vector fusion on the first feature vector, the second feature vector, and the third feature vector to obtain a fusion result;

[0022] Perform similarity calculation based on the fusion result to obtain the recommendation result of the target user.

[0023] Optionally, the fusion result includes a media feature vector and a user feature vector; the recommendation result includes a first recommendation result and a second recommendation result;

[0024] Perform similarity calculation based on the fusion result to obtain the recommendation result of the target user, including:

[0025] Perform similarity calculation based on the media feature vector to obtain the first recommendation result of the target user, and perform similarity calculation based on the user feature vector to obtain the second recommendation result of the target user.

[0026] Optionally, the method further includes:

[0027] Obtain training data;

[0028] Input the training data into an initial processor to obtain an initial recommendation result;

[0029] Perform reverse optimization on the initial processor according to the initial recommendation result to obtain an optimized processor until a preset processor that meets the preset accuracy requirement is obtained.

[0030] According to another aspect of the present application, there is provided a media file recommendation device, including:

[0031] A first acquisition module for acquiring the media data of the target user; wherein, the media data includes first media data and second media data; the first media data includes the media type information of the historical playback data of the target user, and the second media data includes the playback time information of the historical playback data;

[0032] The first recommendation module is used to input media data into a preset processor to obtain a recommendation result for the target user; wherein, the preset processor includes a first processor, a second processor, and a third processor; the first processor determines a first feature vector based on the context information of the first media data; the second processor determines a second feature vector based on the low-dimensional vector corresponding to the second media data; the third processor determines a third feature vector of the target user based on the time attention mechanism and the media data; the recommendation result is determined according to the first feature vector, the second feature vector, and the third feature vector.

[0033] Optionally, the first acquisition module includes:

[0034] The first acquisition sub-module is used to acquire the historical playback data of the target user; wherein, the historical playback data includes media name information, media type information, and playback time information;

[0035] The second acquisition sub-module is used to determine the first media data of the target user according to the media name information and the media type information in the historical playback data;

[0036] The third acquisition sub-module is used to determine the second media data of the target user according to the media name information and the playback time information in the historical playback data.

[0037] Optionally, the second acquisition sub-module includes:

[0038] The second acquisition unit is used to acquire the first media initial data in the historical playback data; the first media initial data includes media name information and media type information;

[0039] The first update unit is used to, when there is no corresponding duration data in the first media initial data, use the first duration data as the duration data in the first media initial data; the first duration data is the duration data with the longest playback duration in the historical playback data;

[0040] The second update unit is used to, when the duration data in the first media initial data is less than the preset duration data, update the duration data in the first media initial data to the preset duration data to obtain the first media data.

[0041] Optionally, the third acquisition sub-module includes:

[0042] The third acquisition unit is used to acquire the second media initial data in the historical playback data; the second media initial data includes media name information and playback time information; the playback time information includes the playback start time and the playback end time;

[0043] The screening unit is used to screen out the second media initial data with corresponding first media data according to the media name information as the second media data.

[0044] Optionally, the first recommendation module includes:

[0045] An input sub-module for inputting media data into a preset processor to obtain a first feature vector, a second feature vector, and a third feature vector;

[0046] A fusion sub-module for performing feature vector fusion on the first feature vector, the second feature vector, and the third feature vector to obtain a fusion result;

[0047] A calculation sub-module for performing similarity calculation based on the fusion result to obtain a recommendation result for the target user.

[0048] Optionally, the fusion result includes a media feature vector and a user feature vector; the recommendation result includes a first recommendation result and a second recommendation result;

[0049] The calculation sub-module is specifically configured to perform similarity calculation based on the media feature vector to obtain a first recommendation result for the target user, and perform similarity calculation based on the user feature vector to obtain a second recommendation result for the target user.

[0050] Optionally, the apparatus further includes:

[0051] A second acquisition module for acquiring training data;

[0052] A second recommendation module for inputting the training data into an initial processor to obtain an initial recommendation result;

[0053] A training module for performing reverse optimization on the initial processor according to the initial recommendation result to obtain an optimized processor until a preset processor that meets the preset accuracy requirement is obtained.

[0054] According to another aspect of the present application, there is provided an electronic device, which includes:

[0055] One or more processors;

[0056] A memory;

[0057] One or more applications, where one or more applications are stored in the memory and are configured to be executed by one or more processors, and one or more programs are configured to: execute the media file recommendation method shown in the first aspect of the present application.

[0058] According to another aspect of the present application, there is provided a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the media file recommendation method shown in the first aspect of the present application.

[0059] Apply a media file recommendation method provided by this application to obtain media data of a target user; wherein, the media data includes first media data and second media data; the first media data includes media type information of the historical playback data of the target user, and the second media data includes playback time information of the historical playback data; input the media data into a preset processor to obtain a recommendation result for the target user; wherein, the preset processor includes a first processor, a second processor, and a third processor; the first processor determines a first feature vector based on the context information of the first media data; the second processor determines a second feature vector based on the low-dimensional vector corresponding to the second media data; the third processor determines a third feature vector of the target user based on the time attention mechanism and the media data; the recommendation result is determined according to the first feature vector, the second feature vector, and the third feature vector.

[0060] This application extracts key information from the media data in the historical playback data of the target user through the first processor, the second processor, and the third processor in the preset processor, determines the corresponding feature vectors, and then calculates the similarity after fusing the feature vectors, realizing the recommendation of media files to users from two aspects of media similarity and user similarity. The recommendation result can accurately capture the deep interest preferences of different users and has good interpretability. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the technical solutions in the embodiments of this application, the following will briefly introduce the drawings required for the description of the embodiments of this application.

[0062] Figure 1 It is one of the flow diagrams of a media file recommendation method provided by an embodiment of this application;

[0063] Figure 2 It is the second of the flow diagrams of a media file recommendation method provided by an embodiment of this application;

[0064] Figure 3 It is the structural diagram of a media file recommendation device provided by an embodiment of this application;

[0065] Figure 4 It is the structural diagram of a media file recommendation electronic device provided by an embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0066] The following details the embodiments of this application. The examples of the embodiments are shown in the drawings, where the same or similar reference numerals represent the same or similar elements or elements with the same or similar functions from beginning to end. The embodiments described below with reference to the drawings are exemplary and are only used to explain this application and should not be construed as a limitation of the present invention.

[0067] Those skilled in the art can understand that, unless specifically stated otherwise, the singular forms "a", "an", "the" and "said" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of this application means the presence of the described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or their groups. It should be understood that when we say that an element is "connected" or "coupled" to another element, it can be directly connected or coupled to other elements, or there may also be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0068] To make the objectives, technical solutions and advantages of this application clearer, the embodiments of this application will be further described in detail below with reference to the accompanying drawings.

[0069] In an existing application scenario, a recommendation algorithm based on collaborative filtering is used to recommend media files to users. Similar media files are found in the user's historical viewing records and recommended to the users, or the media files viewed by users with common viewing records are recommended to the users. The recommendation algorithm based on collaborative filtering only considers the superficial connections between various film and television works to a greater extent. For example, the titles or features of media files. Therefore, there may be a situation where the titles of two media files are very similar but the contents are completely different, and the recommendation effect will be very limited. At the same time, due to the fact that the collaborative filtering algorithm highly depends on habitual data, it is helpless in dealing with the cold start problem. On the other hand, the recommendation algorithm based on collaborative filtering cannot be applied to large-scale deployment applications.

[0070] In another existing application scenario, a recommendation algorithm based on user characteristics is used to recommend media files to users. The preference characteristics of the users are constructed and recommendations are made according to the preference characteristics of the users. The recommendation algorithm based on user characteristics highly depends on the construction of user characteristics. Even if the construction of the characteristics is very delicate, there are still problems that some characteristics of the users are difficult to capture, that is, the recall of user hobbies is relatively low. From the perspective of depicting the program content, it is easily limited by the degree of detail in describing the program content, and it is difficult to capture some unique characteristics of the content. From the perspective of recommendation diversity, the recommendation method based on user characteristics will always recommend programs closely related to the content to the users, and lose the diversity of the recommended content.

[0071] The media file recommendation method, device and electronic device provided by this application aim to solve the above technical problems of the existing technology.

[0072] The following uses specific embodiments to elaborate in detail on the technical solution of the present application and how the technical solution of the present application solves the above technical problems. These several specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0073] In an embodiment of the present application, a method for recommending media files is provided. As Figure 1 shown, it specifically includes:

[0074] Step S101, obtaining media data of a target user; where the media data includes first media data and second media data; the first media data includes media type information of the historical playback data of the target user, and the second media data includes playback time information of the historical playback data.

[0075] Obtain the historical playback data of the target user. The historical playback data is, for example, the data in the historical playback records of the target user recorded on a media playback website. The media data is the key data extracted from the historical playback data, including the first media data and the second media data. In other words, both the first media data and the second media data are obtained by processing the historical playback data of the target user.

[0076] The media files in the embodiments of the present application include conventional types of media files such as video files and audio files. Here, a video file is taken as an example for illustration. The first media data includes media type information of the historical playback data of the target user. The media type information is, for example, information such as news type, finance type, sports type, and life type to which the media file belongs. In addition, the first media data also includes media name information, media form information, media content information, etc. Among them, the media name information refers to the name of the media file recorded in the historical playback data of the target user; the media form information is, for example, form information such as feature film, documentary, talk show, etc.; the media content information refers to the specific content information of the media file itself.

[0077] The second media data includes playback time information of the historical playback data. The playback time information is, for example, the playback time information of the media file in the historical playback data of the target user, including the start time and end time of the corresponding media file playback. The second media data also includes the name of the media file corresponding to the playback time information, that is, the media name information.

[0078] Through the first media data and the second media data, the combination of media type information and playback type information is achieved. Specifically, the first media data corresponds to the attributes of the media file itself, and the second media data corresponds to the attributes of the target user playing the media file. Based on the first media data, the deep connections between different types and forms of media files can be analyzed. Based on the second media data, the behavioral characteristics such as the preferences of different users for playing media files and the habits of playing times can be analyzed. In the embodiments of the present application, the first media data and the second media data are combined for comparison, analysis, and calculation, and the media files liked by the target user can be determined more comprehensively and accurately.

[0079] Step S102, input the media data into a preset processor to obtain the recommendation result of the target user.

[0080] Among them, the preset processor includes a first processor, a second processor, and a third processor; the first processor determines a first feature vector based on the context information of the first media data; the second processor determines a second feature vector based on the low-dimensional vector corresponding to the second media data; the third processor determines a third feature vector of the target user based on the time attention mechanism and the media data; the recommendation result is determined according to the first feature vector, the second feature vector, and the third feature vector.

[0081] After obtaining the media data of the target user, the media data is input into a preset processor to obtain the recommendation result of the target user. The preset processor provided in the embodiments of the present application is specifically composed of at least three sub-processors, namely a first processor, a second processor, and a third processor.

[0082] Among them, the first processor can be designed based on the BERT (Bidirectional Encoder Representation from Transformers) model. The BERT model is a multi-layer bidirectional Transformer encoder based on fine-tuning and is also a method for pre-training language representation. When processing a word or a sentence, the BERT model can take into account the context information of this word or sentence, thereby obtaining the context semantics, and then generating a more accurate feature representation to improve the performance of the model.

[0083] The first processor obtains the context information between different media files from the first media data and determines the first feature vector of the target user based on the context information.

[0084] The second processor can be designed based on the item2vec model, which is mainly used for processing the second media data. The Item2vec model converts the second media data of the target user as a behavior sequence into a sentence composed of items, maps the original high-dimensional sparse representation to a low-dimensional dense vector space to extract features, and calculates the low-dimensional vectors to determine the second feature vector. Among them, the method of probabilistic dropout words can also be introduced in the second processor to balance low-frequency words and high-frequency words, thereby improving the accuracy of determining the second feature vector.

[0085] The second processor obtains the behavior feature vector of the target user from the second media data as the second feature vector.

[0086] The third processor can be designed based on the T-AM (Time-Attention Mechanism) model, introducing the time attention mechanism and adding time parameters to determine the third feature vector, making the output result more in line with the user's interest change. The essence of the T-AM model is to imitate the human visual attention mechanism, learn a weight distribution of the media file features, and then apply these weight distributions to the original features, providing different feature impacts for program-based recommendations and user-based recommendations, etc., so that the task mainly focuses on some important features and ignores unimportant features, improving the task efficiency.

[0087] The third processor determines the third feature vector of the target user from the media data according to the time attention mechanism. The T-AM model includes a weight calculation process, that is, designing a scoring function, calculating a score for each attention vector, and the scoring basis is the degree of relevance to the object concerned by the attention vector. The more relevant, the greater the value obtained, and the score is mapped to a value in (0, 1).

[0088] Media file recommendations should consider the time effect because users' interests change over time. The media files that a user liked in the past week may not be interesting now. Compared with recommending the media files that the user liked in the past, recommending the media files that the user recently liked is more valuable for reference.

[0089] For example, taking a week as a time period, construct a time function with time x as a variable The time function is symmetric about the fourth day of each week and monotonically decreasing. Combining the time parameter and the media data, the third feature vector of the target user can be determined.

[0090] The preset processor determines the first feature vector, the second feature vector, and the third feature vector of the target user based on the first processor, the second processor, and the third processor respectively. The recommendation result of the target user is determined according to the first feature vector, the second feature vector, and the third feature vector.

[0091] The recommended results include information such as the name of the media file and the network link of the media file. Through the recommended results, the user can play the media files of interest. The key feature vectors of the target user are extracted by the first processor, the second processor, and the third processor in the preset processor, and the feature vectors are fused and calculated, so as to determine the recommended results of media files that better meet the user's needs.

[0092] In the embodiment of the present application, the first processor, the second processor, and the third processor in the preset processor respectively extract key information from the historical playback data of the target user, determine the corresponding feature vectors, and then perform similarity calculation after fusing the feature vectors, so as to recommend media files to the user from two aspects of media similarity and user similarity. The recommended results can accurately capture the deep interest preferences of different users and have good interpretability.

[0093] In a preferred embodiment of the present application, possible implementation manners for obtaining the media data of the target user are provided, including possible implementation manners for obtaining the first media data of the target user and obtaining the second media data of the target user.

[0094] Obtain the historical playback data of the target user; wherein, the historical playback data includes media name information, media type information, and playback time information.

[0095] Obtain the historical playback data of the target user, wherein the historical playback data includes various media resource information of the media that the target user has played, for example, media name information, media form information, media type information, and the specific content of the media, etc. In addition, the historical playback data also includes the specific playback time when the target user has played the media. In the embodiment of the present application, the historical playback data at least includes media name information, media type information, and playback time information.

[0096] Among them, obtaining the first media data of the target user includes:

[0097] Determine the first media data of the target user according to the media name information and media type information in the historical playback data.

[0098] The first media data includes the media name information and media type information in the historical playback data, and may also include other types of media resource information, for example, media form information, the specific content of the media, etc. According to the media name information and media type information in the obtained historical playback data, the first media data of the target user can be determined.

[0099] In a preferred embodiment of the present application, possible implementation manners for determining the first media data of the target user according to the media name information and media type information in the historical playback data are provided.

[0100] Obtain the first media initial data in the historical playback data; the first media initial data includes media name information and media type information.

[0101] Obtain the first media initial data in the historical playback data, where the first media initial data corresponds to the first media data. The first media initial data includes media name information and media type information. By preprocessing the first media initial data in the historical playback data, the corresponding first media data can be obtained.

[0102] When there is no corresponding duration data in the first media initial data, use the first duration data as the duration data in the first media initial data; the first duration data is the duration data with the longest playback duration corresponding in the historical playback data.

[0103] The duration data corresponding to the first media initial data also belongs to the media asset information of the media, and the duration data can be directly obtained when obtaining the historical playback data. Specifically, there are cases where the duration data in some historical playback data is missing. For example, when obtaining the duration data corresponding in the first media initial data, it may occur that the obtained duration data is a null value, that is, there is no corresponding duration data in the first media initial data. In this case, specific processing needs to be performed on the duration data to obtain the first media data that meets the preset requirements.

[0104] Generally, the duration data refers to the duration data carried by the media itself. When the media itself does not carry the corresponding duration data, use the first duration data as the duration data in the first media initial data. The first duration data is the longest duration data recorded in the historical playback data for the corresponding media being played.

[0105] When the duration data in the first media initial data is less than the preset duration data, update the duration data in the first media initial data to the preset duration data to obtain the first media data.

[0106] When there is no corresponding duration data in the first media initial data, use the first duration data as the duration data in the first media initial data; when there is corresponding duration data in the first media initial data, do not perform any processing.

[0107] Further, when the duration data in the first media initial data is less than the preset duration data, the duration data needs to be updated again. The preset duration data is the standard duration data of the first media data set in advance and can be set by the user himself. The first duration data corresponding to different media forms may be different. In the embodiments of the present application, the update process of the duration data can be completed by filling the duration. Specifically, the duration data corresponding to the media of the same media form is filled to obtain the first media data with the duration data unified to the preset duration data.

[0108] Among them, obtaining the second media data of the target user includes:

[0109] Determining the second media data of the target user according to the media name information and play time information in the historical play data.

[0110] The second media data includes the media name information and play time information in the historical play data, and may also include other types of historical play data information. The play time information includes the start play time and end play time when the target user has played the media. According to the start play time and end play time, the specific play duration of different media played by the target user can be calculated.

[0111] In a preferred embodiment of the present application, a possible implementation manner of determining the second media data of the target user according to the media name information and play time information in the historical play data is provided.

[0112] Obtaining the second media initial data in the historical play data; the second media initial data includes the media name information and play time information; the play time information includes the play start time and play end time.

[0113] Obtaining the second media initial data in the historical play data, where the second media initial data corresponds to the second media data. The second media initial data includes the media name information and play time information. The play time information includes the play start time and play end time. By preprocessing the second media initial data in the historical play data, the corresponding second media data can be obtained.

[0114] Specifically, there may be a situation where the play time information is missing in the historical play data of the target user. For example, when the target user has played the media file 01, at least one of the play start time and play end time of the media file 01 does not exist in the corresponding historical play data, so that the specific play duration of the media file 01 cannot be determined according to the play time information. In the embodiments of the present application, the media data with incomplete play time information is discarded. That is to say, the obtained second media initial data is the media data including the play start time and play end time.

[0115] Screen the second media initial data with corresponding first media data according to the media name information as the second media data.

[0116] The first media data includes media name information, and the second media initial data also includes media name information. For the second media initial data obtained from the historical playback data, the appropriate second media initial data is screened out according to the corresponding media name information as the second media data. Specifically, the appropriate second media initial data refers to the second media initial data with corresponding media name information to the first media data. For example, if the media name information corresponding to the second media initial data is 02, and the media name information corresponding to the first media data is also 02, then this second media initial data is used as the second media data. If there is no first media data with the same media name in the second media initial data, this second media initial data is discarded.

[0117] In a preferred embodiment of the present application, a possible implementation manner of inputting media data into a preset processor to obtain a recommendation result for the target user is provided.

[0118] Input the media data into a preset processor to obtain a first feature vector, a second feature vector, and a third feature vector.

[0119] Input the media data of the target user into a preset processor, where the media data includes first media data and second media data. The first processor in the preset processor performs feature extraction processing on the first media data to obtain a first feature vector; the second processor in the preset processor performs feature extraction processing on the second media data to obtain a second feature vector; the third processor in the preset processor calculates a third feature vector based on the media data and the time attention mechanism.

[0120] Perform feature vector fusion on the first feature vector, the second feature vector, and the third feature vector to obtain a fusion result.

[0121] After the preset processor obtains the feature vectors of the target user based on the three sub-processors, the feature vectors are fused to obtain a fusion result.

[0122] To more clearly represent the steps of feature vector fusion, here the first feature vector is represented as A, and the second feature vector is represented as B. Then, the fusion result of the first feature vector and the second feature vector is C = [AB].

[0123] Furthermore, to recommend media to the target user more comprehensively, the embodiments of the present application provide two specific feature fusion methods based on media features and user features.

[0124] Among them, the fusion result based on media features is expressed as V = C * f(x); where f(x) is the time parameter provided by the third processor.

[0125] The fusion result based on user features is expressed as where U i is the vector representation of the i-th user, m is the total number of historical play records of the i-th user within a period, and f(x) is the time parameter provided by the third processor.

[0126] Feature vector fusion is performed based on the first feature vector, the second feature vector, and the third feature vector to obtain a fusion result.

[0127] Based on the fusion result, similarity calculation is performed to obtain the recommendation result for the target user.

[0128] Specifically, in the embodiments of the present application, at least two fusion results based on media features and user features are obtained, and similarity calculations are respectively performed on the two fusion results, so as to obtain a comprehensive recommendation result for the target user.

[0129] The similarity calculation can adopt the method of cosine similarity calculation. For example, a and b are two n-dimensional vectors, a is [a1, a2,..., a n , and b is [b1, b2,..., b n , then the cosine of the included angle θ between a and b is expressed as

[0130]

[0131] The preset processor respectively calculates the media similarity and user similarity of the target user, and then determines the corresponding recommendation result based on the media similarity and user similarity.

[0132] In a preferred embodiment of the present application, a possible implementation manner of performing similarity calculation based on the fusion result to obtain the recommendation result for the target user is provided.

[0133] Based on the media feature vector, similarity calculation is performed to obtain the first recommendation result for the target user, and based on the user feature vector, similarity calculation is performed to obtain the second recommendation result for the target user.

[0134] The preset processor calculates the similarity between different media based on the media feature vector V, and screens the preset number of media with the highest similarity as the first recommendation result for the target user. The preset processor calculates the similarity between different users based on the user feature vector U, and screens the media in the historical play records of the preset number of users with the highest similarity as the second recommendation result for the target user.

[0135] Apply a media file recommendation method provided by an embodiment of the present application to obtain media data of a target user; wherein, the media data includes first media data and second media data; the first media data includes media type information of the historical playback data of the target user, and the second media data includes playback time information of the historical playback data; input the media data into a preset processor to obtain a recommendation result of the target user; wherein, the preset processor includes a first processor, a second processor, and a third processor; the first processor determines a first feature vector based on the context information of the first media data; the second processor determines a second feature vector based on the low-dimensional vector corresponding to the second media data; the third processor determines a third feature vector of the target user based on a time attention mechanism and the media data; the recommendation result is determined according to the first feature vector, the second feature vector, and the third feature vector.

[0136] In an embodiment of the present application, the first processor, the second processor, and the third processor in the preset processor respectively extract key information from the historical playback data of the target user, determine corresponding feature vectors, and then perform similarity calculation after fusing the feature vectors, realizing the recommendation of media files to users from two aspects of media similarity and user similarity. The recommendation result can accurately capture the deep interest preferences of different users and has good interpretability.

[0137] An embodiment of the present application provides a media file recommendation method, as Figure 2 shown, the method includes:

[0138] Step S201, obtain training data.

[0139] Obtain the historical playback data of the user, and extract the media data corresponding to the historical playback data of the user from the historical playback data, wherein the media data includes third media data and fourth media data. The third media data includes media type information of the historical playback data of the user, and the fourth media data includes playback time information of the historical playback data.

[0140] The historical playback data includes various media resource information of the media that the user has played, for example, media name information, media form information, media type information, and specific content of the media, etc. In addition, the historical playback data also includes the specific playback time when the user has played the media. In an embodiment of the present application, the historical playback data includes at least media name information, media type information, and playback time information.

[0141] Step S202, input the training data into an initial processor to obtain an initial recommendation result.

[0142] The initial processor is composed of at least three sub-processors, namely a first initial processor, a second initial processor, and a third initial processor.

[0143] Among them, the first initial processor can be designed based on the BERT model and is mainly used for processing third media data. The first initial processor extracts features from the third media data and determines the fourth feature vector according to the context information.

[0144] The second initial processor can be designed based on the item2vec model and is mainly used for processing fourth media data. The second initial processor extracts features by mapping the original high-dimensional sparse representation to a low-dimensional dense vector space and calculates the low-dimensional vectors to determine the fifth feature vector.

[0145] The third initial processor can be designed based on the T-AM model. By introducing a time attention mechanism and adding time parameters, the third initial processor determines the sixth feature vector, making the output result more in line with the user's interest changes.

[0146] The preset processor determines the fourth feature vector, the fifth feature vector, and the sixth feature vector based on the first initial processor, the second initial processor, and the third initial processor respectively. Further, an initial recommendation result is determined according to the fourth feature vector, the fifth feature vector, and the sixth feature vector.

[0147] Step S203: Perform reverse optimization on the initial processor according to the initial recommendation result to obtain an optimized processor until a preset processor that meets the preset accuracy requirement is obtained.

[0148] Screen and mark the initial recommendation result to determine positive sample data and negative sample data. Among them, the positive sample data is sample data with better recommendation effects, and the negative sample data is sample data with poorer recommendation results.

[0149] Perform reverse optimization on the initial processor based on the positive sample data and the negative sample data to obtain a preset processor that meets the preset accuracy requirement.

[0150] Applying the media file recommendation method provided in the embodiments of the present application, training data is obtained; the training data is input into the initial processor to obtain an initial recommendation result; the initial processor is reversely optimized according to the initial recommendation result to obtain an optimized processor until a preset processor that meets the preset accuracy requirement is obtained.

[0151] In the embodiments of the present application, the initial processor is trained and optimized through the user's historical playback data to obtain a preset processor that meets the accuracy requirement. The preset processor can automatically recommend media files to the user from two aspects: media similarity and user similarity. The recommendation result can accurately capture the deep interest preferences of different users and has good interpretability.

[0152] The embodiments of the present application provide a media file recommendation device, such asFigure 3 As shown in the figure, the device includes:

[0153] A first acquisition module 301, configured to acquire media data of a target user; wherein, the media data includes first media data and second media data; the first media data includes media type information of the historical playback data of the target user, and the second media data includes playback time information of the historical playback data;

[0154] A first recommendation module 302, configured to input the media data into a preset processor to obtain a recommendation result of the target user; wherein, the preset processor includes a first processor, a second processor, and a third processor; the first processor determines a first feature vector based on the context information of the first media data; the second processor determines a second feature vector based on the low-dimensional vector corresponding to the second media data; the third processor determines a third feature vector of the target user based on the time attention mechanism and the media data; the recommendation result is determined according to the first feature vector, the second feature vector, and the third feature vector.

[0155] In one or more embodiments, the first acquisition module 301 includes:

[0156] A first acquisition sub-module, configured to acquire historical playback data of the target user; wherein, the historical playback data includes media name information, media type information, and playback time information;

[0157] A second acquisition sub-module, configured to determine the first media data of the target user according to the media name information and the media type information in the historical playback data;

[0158] A third acquisition sub-module, configured to determine the second media data of the target user according to the media name information and the playback time information in the historical playback data.

[0159] In one or more embodiments, the second acquisition sub-module includes:

[0160] A second acquisition unit, configured to acquire first initial media data in the historical playback data; the first initial media data includes media name information and media type information;

[0161] A first update unit, configured to use the first duration data as the duration data in the first initial media data when there is no corresponding duration data in the first initial media data; the first duration data is the duration data with the longest playback duration in the historical playback data;

[0162] A second update unit, configured to update the duration data in the first initial media data to the preset duration data when the duration data in the first initial media data is less than the preset duration data, so as to obtain the first media data.

[0163] In one or more embodiments, the third acquisition sub-module includes:

[0164] A third acquisition unit, configured to acquire second media initial data in historical play data; the second media initial data includes media name information and play time information; the play time information includes a play start time and a play end time;

[0165] A screening unit, configured to screen out the second media initial data with corresponding first media data according to the media name information, as the second media data.

[0166] In one or more embodiments, the first recommendation module 302 includes:

[0167] An input sub-module, configured to input media data into a preset processor to obtain a first feature vector, a second feature vector, and a third feature vector;

[0168] A fusion sub-module, configured to perform feature vector fusion on the first feature vector, the second feature vector, and the third feature vector to obtain a fusion result;

[0169] A calculation sub-module, configured to perform similarity calculation based on the fusion result to obtain a recommendation result for the target user.

[0170] In one or more embodiments, the fusion result includes a media feature vector and a user feature vector; the recommendation result includes a first recommendation result and a second recommendation result;

[0171] The calculation sub-module is specifically configured to perform similarity calculation based on the media feature vector to obtain a first recommendation result for the target user, and perform similarity calculation based on the user feature vector to obtain a second recommendation result for the target user.

[0172] In one or more embodiments, the apparatus further includes:

[0173] A second acquisition module, configured to acquire training data;

[0174] A second recommendation module, configured to input the training data into an initial processor to obtain an initial recommendation result;

[0175] A training module, configured to perform reverse optimization on the initial processor according to the initial recommendation result to obtain an optimized processor until a preset processor that meets the preset accuracy requirement is obtained.

[0176] Apply a media file recommendation device provided by an embodiment of the present application to obtain media data of a target user; wherein the media data includes first media data and second media data; the first media data includes media type information of the historical playback data of the target user, and the second media data includes playback time information of the historical playback data; input the media data into a preset processor to obtain a recommendation result for the target user; wherein the preset processor includes a first processor, a second processor, and a third processor; the first processor determines a first feature vector based on the context information of the first media data; the second processor determines a second feature vector based on the low-dimensional vector corresponding to the second media data; the third processor determines a third feature vector of the target user based on the time attention mechanism and the media data; the recommendation result is determined according to the first feature vector, the second feature vector, and the third feature vector.

[0177] In the embodiment of the present application, the first processor, the second processor, and the third processor in the preset processor respectively extract key information from the historical playback data of the target user, determine corresponding feature vectors, and then perform similarity calculation after fusing the feature vectors, so as to realize the recommendation of media files to the user from two aspects of media similarity and user similarity. The recommendation result can accurately capture the deep interest preferences of different users and has good interpretability.

[0178] An embodiment of the present application provides an electronic device, which includes: a memory and a processor; at least one program, stored in the memory, when being executed by the processor, compared with the prior art, can realize that the first processor, the second processor, and the third processor in the preset processor respectively extract key information from the historical playback data of the target user, determine corresponding feature vectors, and then perform similarity calculation after fusing the feature vectors, so as to realize the recommendation of media files to the user from two aspects of media similarity and user similarity. The recommendation result can accurately capture the deep interest preferences of different users and has good interpretability.

[0179] In an optional embodiment, an electronic device is provided, as Figure 4 shown, Figure 4 the electronic device 4000 shown includes: a processor 4001 and a memory 4003. Among them, the processor 4001 and the memory 4003 are connected, such as connected through a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, and the transceiver 4004 may be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data, etc. It should be noted that in practical applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation to the embodiment of the present application.

[0180] The processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logical blocks, modules, and circuits described in connection with the disclosure of this application. The processor 4001 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0181] The bus 4002 may include a path for transmitting information between the above components. The bus 4002 can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only a thick line is used to represent it, but it does not mean that there is only one bus or one type of bus.

[0182] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or it can also be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but not limited to this.

[0183] The memory 4003 is used to store the application program code for executing the solution of this application, and is controlled by the processor 4001 to execute. The processor 4001 is used to execute the application program code stored in the memory 4003 to implement the content shown in the foregoing method embodiments.

[0184] An embodiment of this application provides a computer-readable storage medium. A computer program is stored on this computer-readable storage medium. When it runs on a computer, it enables the computer to execute the corresponding content in the foregoing method embodiments. Compared with the prior art, by presetting the first processor, the second processor, and the third processor in the processor to extract key information from the historical playback data of the target user respectively, determine the corresponding feature vectors, and then calculate the similarity after fusing the feature vectors, it realizes the recommendation of media files to users from two aspects of media similarity and user similarity. The recommendation result can accurately capture the deep interest preferences of different users and has good interpretability.

[0185] An embodiment of this application provides a computer program product containing instructions. When it runs on a computer device, it enables the computer device to execute the processing method of coupons provided by the foregoing method embodiments.

[0186] It should be understood that although the steps in the flowchart of the accompanying drawings are displayed in sequence according to the indication of the arrows, these steps do not necessarily need to be executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages do not necessarily need to be executed at the same time, but can be executed at different times, and their execution order does not necessarily need to be sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.

[0187] The above are only some embodiments of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.

Claims

1. A media file recommendation method, characterized in that, Including: Obtain the media data of the target user; wherein, the media data includes first media data and second media data; the first media data includes media type information of the historical playback data of the target user, and the second media data includes playback time information of the historical playback data; Input the media data into a preset processor to obtain a first feature vector, a second feature vector, and a third feature vector; Perform feature vector fusion on the first feature vector, the second feature vector, and the third feature vector to obtain a fusion result, where the fusion result includes a media feature vector and a user feature vector; Based on the fusion result, perform similarity calculation to obtain a recommendation result for the target user; Wherein, the preset processor includes a first processor, a second processor, and a third processor; the first processor determines the first feature vector based on the context information of the first media data; the second processor determines the second feature vector based on the low-dimensional vector corresponding to the second media data; the third processor determines the third feature vector of the target user based on the time attention mechanism and the media data, and the third feature vector is used to represent the interest preference of the target user for media files considering the time effect; the recommendation result is determined according to the first feature vector, the second feature vector, and the third feature vector; Performing feature vector fusion on the first feature vector, the second feature vector, and the third feature vector to obtain a fusion result includes: Fuse the first feature vector and the second feature vector to obtain a first fusion result; Fuse the first fusion result and the third feature vector to obtain a media feature vector; For each media file in the historical playback data, fuse the feature component corresponding to the media file in the first fusion result with the third feature vector respectively to obtain a second fusion result corresponding to each feature component, and sum all the second fusion results to obtain a user feature vector.

2. The media file recommendation method according to claim 1, wherein The obtaining the media data of the target user includes: Obtain the historical playback data of the target user; wherein, the historical playback data includes media name information, media type information, and playback time information; Determine the first media data of the target user according to the media name information and the media type information in the historical playback data; Determine the second media data of the target user according to the media name information and the playback time information in the historical playback data.

3. The media file recommendation method according to claim 2, wherein The determining the first media data of the target user according to the media name information and the media type information in the historical playback data includes: Obtain the first media initial data in the historical playback data; the first media initial data includes the media name information and the media type information; When there is no corresponding duration data in the first media initial data, use the first duration data as the duration data in the first media initial data; the first duration data is the duration data with the longest playback duration in the historical playback data; When the duration data in the first media initial data is less than the preset duration data, update the duration data in the first media initial data to the preset duration data to obtain the first media data.

4. The media file recommendation method according to claim 2, wherein The determining the second media data of the target user according to the media name information and the playback time information in the historical playback data includes: Obtain the second media initial data in the historical playback data; the second media initial data includes the media name information and the playback time information; the playback time information includes the playback start time and the playback end time; Filter out the second media initial data with corresponding first media data according to the media name information as the second media data.

5. The media file recommendation method according to claim 1, wherein The recommendation result includes a first recommendation result and a second recommendation result; The obtaining the recommendation result of the target user by performing a similarity calculation based on the fusion result includes: Performing a similarity calculation based on the media feature vector to obtain the first recommendation result of the target user, and performing a similarity calculation based on the user feature vector to obtain the second recommendation result of the target user.

6. The media file recommendation method according to claim 1, wherein The method further includes: Obtain training data; Input the training data into the initial processor to obtain an initial recommendation result; Perform reverse optimization on the initial processor according to the initial recommendation result to obtain an optimized processor until the preset processor that meets the preset accuracy requirement is obtained.

7. A media file recommendation device, characterized in that, including: A first acquisition module, configured to acquire media data of a target user; wherein, the media data includes first media data and second media data; the first media data includes media type information of the historical playback data of the target user, and the second media data includes the playback time information of the historical playback data; A first recommendation module, configured to input the media data into a preset processor to obtain a first feature vector, a second feature vector, and a third feature vector; fuse the first feature vector, the second feature vector, and the third feature vector to obtain a fusion result, the fusion result including a media feature vector and a user feature vector; perform a similarity calculation based on the fusion result to obtain the recommendation result of the target user; Wherein, the preset processor includes a first processor, a second processor, and a third processor; the first processor determines a first feature vector based on the context information of the first media data; the second processor determines a second feature vector based on the low-dimensional vector corresponding to the second media data; the third processor determines a third feature vector of the target user based on a time attention mechanism and the media data, and the third feature vector is used to characterize the interest preference of the target user for media files considering the time effect; the recommendation result is determined according to the first feature vector, the second feature vector, and the third feature vector; Fusing the first feature vector, the second feature vector, and the third feature vector to obtain a fusion result includes: Fuse the first feature vector and the second feature vector to obtain a first fusion result; Fuse the first fusion result and the third feature vector to obtain a media feature vector; For each media file of the historical playback data, fuse the feature components corresponding to the media file in the first fusion result with the third feature vector respectively to obtain a second fusion result corresponding to each feature component, and sum all the second fusion results to obtain a user feature vector.

8. An electronic device, characterized in that, The electronic device includes: One or more processors; A memory; One or more applications, wherein the one or more applications are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs are configured to: execute the media file recommendation method according to any one of claims 1 to 6.

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

Citation Information

Patent Citations

  • Method, apparatus and electronic device for recommending from media

    CN109062963A

  • Video recommendation method and device, electronic equipment and storage medium

    CN112818251A