Song recommendation model training method, song recommendation method and related products

By obtaining and integrating the audio and text features of the song, training the song recommendation model, solving the problem of low accuracy of new song recommendations, achieving effective recommendations for new songs, and improving user experience.

CN118939830APending Publication Date: 2024-11-12TENCENT MUSIC ENTERTAINMENT TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411079663.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In some scenarios, the historical user behavior of the song cannot be obtained, resulting in a low accuracy of recommendation for new songs, especially for new songs that have not yet been promoted, and it is impossible to determine the appropriate user group.

Method used

By obtaining multiple preference triples, including two positive songs that the user likes and one negative song that he does not like, extract the audio and text features of the song, calculate the similarity loss, train the song recommendation model, and put it to be recommended The characteristics of the song and the associated song are integrated to make recommendations.

Benefits of technology

Even if you cannot obtain historical user behavior, you can recommend the songs to the right user group to improve the accuracy of recommendations and improve the promotion effect of new songs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939830A_ABST
    Figure CN118939830A_ABST
Patent Text Reader

Abstract

The invention relates to a song recommendation model training method, a song recommendation method and a related product. The song recommendation method comprises the steps of obtaining a to-be-recommended song and at least one associated song of a to-be-recommended user; inputting the to-be-recommended song and the plurality of associated songs into a trained song recommendation model to obtain song audio features and song text features of the to-be-recommended song and song audio features and song text features of each associated song; fusing the song audio feature and the song text feature of the to-be-recommended song to obtain a song fusion feature of the to-be-recommended song, and fusing the song audio feature and the song text feature of each associated song to obtain a song fusion feature of each associated song; and recommending the to-be-recommended song to the to-be-recommended user based on the similarity between the song fusion feature of the to-be-recommended song and the song fusion feature of each associated song. By adopting the method, the song recommendation accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a song recommendation model training method, a song recommendation method and related products. Background Art

[0002] Song recommendation is one of the important channels for users to listen to songs, and it is also an important way to promote and publicize new songs. The goal of the recommendation algorithm is to analyze user behavior and the correlation between songs, figure out the user's preferences for listening to songs, and push the right songs to the right people. However, in some scenarios, it is impossible to obtain the historical user behavior of the song, and thus it is impossible to infer which user groups it is suitable for based on historical user behavior, resulting in a low accuracy rate for song recommendations. For example, for some new songs, before they are promoted, it is impossible to infer which user groups this new song is suitable for based on historical user behavior, resulting in a low accuracy rate for new song recommendations. Summary of the invention

[0003] The embodiments of the present application provide a song recommendation model training method, a song recommendation method and related products that can improve the accuracy of song recommendations.

[0004] In a first aspect, the present application provides a method for training a song recommendation model, the method comprising:

[0005] Acquire multiple preference triplets; each preference triplet contains two positive songs that the same sample user likes and one negative song that the same sample user does not like;

[0006] For each preference triplet, input the preference triplet into a song recommendation model to be trained to extract sample song audio features and sample song text features of each of the positive example song and the negative example song contained in the preference triplet;

[0007] Determine a first audio similarity corresponding to the preference triplet according to the sample song audio features of each of the two positive songs in the preference triplet, and determine a second audio similarity corresponding to the preference triplet according to the sample song audio features of each of the positive song and the negative song in the preference triplet;

[0008] Determine a first text similarity corresponding to the preference triplet according to the sample song text features of each of the two positive songs in the preference triplet, and determine a second text similarity corresponding to the preference triplet according to the sample song text features of each of the positive song and the negative song in the preference triplet;

[0009] determining an audio triplet loss according to the first audio similarities and the second audio similarities corresponding to each of the plurality of preference triples;

[0010] Determining a text triple loss according to the first text similarities and the second text similarities corresponding to each of the plurality of preference triples; and

[0011] The song recommendation model to be trained is trained according to the audio ternary loss and the text ternary loss to obtain a trained song recommendation model; the trained song recommendation model is used to recommend songs to be recommended.

[0012] In a second aspect, the present application provides a song recommendation method, the method comprising:

[0013] Acquire songs to be recommended and at least one associated song of each of the multiple users to be recommended, wherein the associated song is a song that has a preset interactive behavior with the user to be recommended;

[0014] Inputting the song to be recommended and the plurality of the related songs into a trained song recommendation model to obtain the song audio features and song text features of the song to be recommended, as well as the song audio features and song text features of each of the related songs; wherein the song recommendation model is trained by the method described in any one of claims 1 to 4;

[0015] The song audio features and the song text features of the song to be recommended are merged to obtain the song fusion features of the song to be recommended, and the song audio features and the song text features of each of the related songs are merged to obtain the song fusion features of each of the related songs;

[0016] Based on the similarity between the song fusion feature of the song to be recommended and the song fusion features of each of the related songs, the song to be recommended is recommended to the multiple users to be recommended.

[0017] In a third aspect, the present application provides a song recommendation device, the device comprising:

[0018] The first acquisition module is used to acquire multiple preference triplets; each preference triplet contains two positive songs that the same sample user likes and one negative song that the same sample user does not like;

[0019] A first extraction module is used for inputting the preference triplet into the song recommendation model to be trained for each preference triplet, so as to extract the sample song audio features and sample song text features of each of the positive example song and the negative example song contained in the preference triplet;

[0020] A determination module, for determining a first audio similarity corresponding to the preference triplet according to the audio features of the sample songs of the two positive songs in the preference triplet, and determining a second audio similarity corresponding to the preference triplet according to the audio features of the sample songs of the positive song and the negative song in the preference triplet; determining a first text similarity corresponding to the preference triplet according to the text features of the sample songs of the two positive songs in the preference triplet, and determining a second text similarity corresponding to the preference triplet according to the text features of the sample songs of the positive song and the negative song in the preference triplet; determining an audio triplet loss according to the first audio similarities and the second audio similarities corresponding to each of the plurality of preference triples; determining a text triplet loss according to the first text similarities and the second text similarities corresponding to each of the plurality of preference triples; and,

[0021] A training module is used to train the song recommendation model to be trained according to the audio ternary loss and the text ternary loss to obtain a trained song recommendation model; the trained song recommendation model is used to recommend songs to be recommended.

[0022] In a fourth aspect, the present application provides a song recommendation device, the device comprising:

[0023] A second acquisition module is used to acquire songs to be recommended and at least one associated song of each of the multiple users to be recommended, wherein the associated song is a song that has a preset interactive behavior with the user to be recommended;

[0024] A second extraction module is used to input the song to be recommended and the multiple related songs into a trained song recommendation model to obtain the song audio features and song text features of the song to be recommended, as well as the song audio features and song text features of each of the related songs; wherein the song recommendation model is trained by the training method of the song recommendation model in this application;

[0025] A fusion module, used for fusing the song audio features and the song text features of the song to be recommended to obtain the song fusion features of the song to be recommended, and fusing the song audio features and the song text features of each of the related songs to obtain the song fusion features of each of the related songs;

[0026] The recommendation module is used to recommend the song to be recommended to the multiple users to be recommended based on the similarity between the song fusion feature of the song to be recommended and the song fusion feature of each of the related songs.

[0027] In a fifth aspect, the present application provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps in the method embodiments of the present application are implemented.

[0028] In a sixth aspect, the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the method embodiments of the present application.

[0029] In a seventh aspect, the present application provides a computer program product, including a computer program, which implements the steps in the method embodiments of the present application when the computer program is executed by a processor.

[0030] The above-mentioned song recommendation model training method, song recommendation method and related products obtain songs to be recommended and at least one related song of each user to be recommended among multiple users to be recommended, where the related songs are songs that have preset interactive behaviors with the users to be recommended; the songs to be recommended and multiple related songs are input into the trained song recommendation model to obtain the song audio features and song text features of the songs to be recommended, as well as the song audio features and song text features of each related song; wherein the song recommendation model is trained by the song recommendation model training method in the present application; the song audio features and song text features of the songs to be recommended are fused to obtain the song fusion features of the songs to be recommended, and the song audio features and song text features of each related song are fused separately to obtain the song fusion features of each related song; based on the similarity between the song fusion features of the songs to be recommended and the song fusion features of each related song, the songs to be recommended are recommended to multiple users to be recommended. In this way, by analyzing the information of the songs to be recommended and the related songs themselves, that is, the information of the two modes of song audio information and song text information of the songs to be recommended and the related songs themselves, and by the song fusion features obtained by fusing the song audio features of the song audio information and the song text features of the song text information, song recommendations are performed. In this way, even if the historical user behavior of the songs to be recommended cannot be obtained, the songs to be recommended can be recommended to the appropriate user groups, thereby improving the recommendation accuracy of the users to be recommended. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A diagram of an application environment of a song recommendation method in one embodiment;

[0032] Figure 2 A schematic diagram of a flow chart of a song recommendation method in one embodiment;

[0033] Figure 3 A schematic diagram of a flow chart of a method for training a song recommendation model in one embodiment;

[0034] Figure 4A schematic diagram of a flow chart of a method for training a song recommendation model in another embodiment;

[0035] Figure 5 A structural block diagram of a training device for a song recommendation model in one embodiment;

[0036] Figure 6 It is a structural block diagram of a song recommendation device in another embodiment;

[0037] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0039] The song recommendation method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can be set up separately and can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other servers. Among them, the terminal 102 can be, but is not limited to, various desktop computers, laptops, smart phones, tablet computers, vehicle-mounted terminals, intelligent voice interaction devices, aircraft, smart home appliances and portable wearable devices. Smart home appliances can be smart speakers, smart TVs and smart air conditioners. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, cloud security, host security and other network security services, CDN, and basic cloud computing services such as big data and artificial intelligence platforms. The terminal 102 and the server 104 can be directly or indirectly connected by wired or wireless communication, and this application is not limited here.

[0040] The server 104 can obtain songs to be recommended, and at least one associated song of each of the multiple users to be recommended, wherein the associated songs are songs that have preset interactive behaviors with the users to be recommended. The server 104 inputs the songs to be recommended and the multiple associated songs into the trained song recommendation model to obtain the song audio features and song text features of the songs to be recommended, as well as the song audio features and song text features of each associated song; wherein the song recommendation model is trained by the training method of the song recommendation model in the present application. The server 104 fuses the song audio features and song text features of the songs to be recommended to obtain the song fusion features of the songs to be recommended, and fuses the song audio features and song text features of each associated song respectively to obtain the song fusion features of each associated song. The server 104 recommends the songs to be recommended to the multiple users to be recommended based on the similarity between the song fusion features of the songs to be recommended and the song fusion features of each associated song.

[0041] It is understood that the server 104 can send the songs to be recommended to the terminal 102 of the corresponding user to be recommended. This embodiment does not limit this. It is understood that Figure 1 The application scenarios are only for illustration and are not limited to this.

[0042] In one embodiment, Figure 2 As shown, a song recommendation method is provided, which can be applied to a computer device, which can be a terminal or a server, that is, the method can be executed by the terminal or the server alone, or can be implemented through interaction between the terminal and the server. This embodiment takes the method applied to the server 104 as an example for description, and includes the following steps:

[0043] Step 202, obtaining songs to be recommended and at least one associated song of each of the multiple users to be recommended, wherein the associated song is a song having a preset interactive behavior with the user to be recommended.

[0044] In one embodiment, the associated songs may include at least one of collection songs, favorite songs, and played songs, etc. Collection songs are songs that the user to be recommended has collected, favorite songs are songs that the user to be recommended has liked, and played songs are songs that the user to be recommended has played.

[0045] Step 204, input the song to be recommended and multiple related songs into the trained song recommendation model to obtain the song audio features and song text features of the song to be recommended, as well as the song audio features and song text features of each related song; wherein the song recommendation model is trained by the training method of the song recommendation model of the present application.

[0046] In one embodiment, the server may input the song to be recommended into the trained song recommendation model to obtain the song audio features and song text features of the song to be recommended. Also, the server may input multiple related songs into the trained song recommendation model to obtain the song audio features and song text features of each related song. The song recommendation model is trained by the training method of the song recommendation model of the present application.

[0047] In one embodiment, the server may obtain the song audio information and song text information of the song to be recommended, and obtain the song audio information and song text information of each of the multiple related songs. The server may input the song audio information of the song to be recommended into the audio encoder in the trained song recommendation model, so as to perform feature encoding on the song audio information of the song to be recommended through the audio encoder, and obtain the song audio features of the song to be recommended. The server may input the song audio information of multiple related songs into the audio encoder in the trained song recommendation model, so as to perform feature encoding on the song audio information of multiple related songs through the audio encoder, and obtain the song audio features of each related song. The server may input the song text information of the song to be recommended into the text encoder in the trained song recommendation model, so as to perform feature encoding on the song text information of the song to be recommended through the text encoder, and obtain the song text features of the song text information of the song to be recommended. The server may input the song text information of multiple related songs into the text encoder in the trained song recommendation model, so as to perform feature encoding on the song text information of multiple related songs through the text encoder, and obtain the song text features of the song text information of each related song.

[0048] It can be understood that song audio information is the information of the song in the audio dimension, and song text information is the information of the song in the text dimension. Audio and text are two different modes. Song audio information is the audio information of the song. Song text information is the text information of the song. Song text information can also be understood as the tag information of the song. Song text information can include at least one of the year, singer, genre, award information, release introduction, creation background or lyrics of the song.

[0049] Step 206, the song audio features and song text features of the song to be recommended are merged to obtain the song fusion features of the song to be recommended, and the song audio features and song text features of each related song are merged to obtain the song fusion features of each related song.

[0050] Specifically, the server may fuse the song audio features and song text features of the song to be recommended to obtain the song fusion features of the song to be recommended. Also, the server may fuse the song audio features and song text features of each associated song to obtain the song fusion features of each associated song. It can be understood that the song fusion features of a song consider both the song audio features and the song text features of the song. Compared with the single mode of the song audio features or the single mode of the song text features, the song fusion features have richer feature information and can more accurately represent the information of the song.

[0051] Step 208, based on the similarity between the song fusion feature of the song to be recommended and the song fusion features of each related song, recommend the song to be recommended to multiple users to be recommended.

[0052] In the above song recommendation method, by obtaining a song to be recommended and at least one related song of each of a plurality of users to be recommended, the related song is a song that has a preset interactive behavior with the user to be recommended; the song to be recommended and the plurality of related songs are input into a trained song recommendation model to obtain the song audio features and song text features of the song to be recommended, as well as the song audio features and song text features of each related song; wherein the song recommendation model is trained by the training method of the song recommendation model in the present application; the song audio features and song text features of the song to be recommended are fused to obtain the song fusion features of the song to be recommended, and the song audio features and song text features of each related song are fused separately to obtain the song fusion features of each related song; based on the similarity between the song fusion features of the song to be recommended and the song fusion features of each related song, the song to be recommended is recommended to a plurality of users to be recommended. In this way, by analyzing the information of the songs to be recommended and the related songs themselves, that is, the information of the two modes of song audio information and song text information of the songs to be recommended and the related songs themselves, and by the song fusion features obtained by fusing the song audio features of the song audio information and the song text features of the song text information, song recommendations are performed. In this way, even if the historical user behavior of the songs to be recommended cannot be obtained, the songs to be recommended can be recommended to the appropriate user groups, thereby improving the recommendation accuracy of the users to be recommended.

[0053] In one embodiment, Figure 3 As shown, a song recommendation method is provided, which can be applied to a computer device, which can be a terminal or a server, that is, the method can be executed by the terminal or the server alone, or can be implemented through interaction between the terminal and the server. This embodiment takes the method applied to the server 104 as an example for description, and includes the following steps:

[0054] Step 302, obtaining a plurality of preference triplets; each preference triplet includes two positive songs that the same sample user likes and one negative song that the same sample user does not like;

[0055] Step 304: for each preference triplet, input the preference triplet into the song recommendation model to be trained to extract the sample song audio features and sample song text features of the positive example songs and negative example songs contained in the preference triplet;

[0056] Step 306, determining a first audio similarity corresponding to the preference triplet according to the audio features of the sample songs of the two positive songs in the preference triplet, and determining a second audio similarity corresponding to the preference triplet according to the audio features of the sample songs of the positive song and the negative song in the preference triplet;

[0057] Step 308, determining a first text similarity corresponding to the preference triplet according to the sample song text features of each of the two positive example songs in the preference triplet, and determining a second text similarity corresponding to the preference triplet according to the sample song text features of each of the positive example song and the negative example song in the preference triplet;

[0058] Step 310, determining an audio triplet loss according to first audio similarities and second audio similarities corresponding to each of the plurality of preference triples;

[0059] Step 312, determining a text triple loss according to the first text similarities and the second text similarities corresponding to each of the plurality of preference triples;

[0060] Step 314, training the song recommendation model to be trained according to the audio ternary loss and the text ternary loss to obtain a trained song recommendation model; the trained song recommendation model is used to recommend the songs to be recommended.

[0061] In one embodiment, the server may obtain multiple preference triples, wherein each preference triple contains two positive songs that the same sample user likes and one negative song that the user does not like. For each preference triple, the preference triple is input into the song recommendation model to be trained to extract the sample song audio features and sample song text features of the positive songs and negative songs contained in the preference triple. The server may determine the first audio similarity corresponding to the preference triple based on the sample song audio features of the two positive songs in the preference triple, and determine the second audio similarity corresponding to the preference triple based on the sample song audio features of the positive song and the negative song in the preference triple. The server may determine the first text similarity corresponding to the preference triple based on the sample song text features of the two positive songs in the preference triple, and determine the second text similarity corresponding to the preference triple based on the sample song text features of the positive song and the negative song in the preference triple. The server may determine the audio triple loss based on the first audio similarity and the second audio similarity corresponding to each of the multiple preference triples. The server may determine the text triplet loss according to the first text similarity and the second text similarity corresponding to each of the plurality of preference triples. Further, the server may determine the target loss according to the audio triplet loss and the text triplet loss, and iteratively train the song recommendation model to be trained in a direction to reduce the target loss until the iteration stop condition is met, thereby obtaining the trained song recommendation model.

[0062] In one embodiment, the iteration stopping condition may specifically be that the number of iterations reaches a preset number, or that the target loss is less than a preset loss.

[0063] In the above song recommendation method, the song recommendation model to be trained is trained by audio ternary loss and text ternary loss to obtain a trained song recommendation model. In this way, the song audio information and song text information of the song are considered at the same time during the training of the song recommendation model, so that the trained song recommendation model can extract more accurate and richer song audio features and song text features, thereby further improving the recommendation accuracy of the song.

[0064] In one embodiment, a song recommendation model to be trained is trained according to an audio ternary loss and a text ternary loss to obtain a trained song recommendation model, including: selecting at least part of positive songs and negative songs from multiple preference triples as first sample songs, and selecting positive songs and negative songs in the multiple preference triples except the first sample songs as second sample songs; determining a first cross-modal similarity according to sample song audio features of the first sample songs and sample song text features of the first sample songs; determining a second cross-modal similarity according to the sample song audio features of the first sample songs and sample song text features of the second sample songs; and determining a contrast loss according to a ratio of the first cross-modal similarity to the second cross-modal similarity; training the song recommendation model to be trained according to the audio ternary loss, the text ternary loss and the contrast loss to obtain a trained song recommendation model.

[0065] In one embodiment, the server may obtain multiple preference triples, wherein each preference triple contains two positive songs that the same sample user likes and one negative song that the user does not like. For each preference triple, the preference triple is input into the song recommendation model to be trained to extract the sample song audio features and sample song text features of the positive songs and negative songs contained in the preference triple. The server may determine the first audio similarity corresponding to the preference triple based on the sample song audio features of the two positive songs in the preference triple, and determine the second audio similarity corresponding to the preference triple based on the sample song audio features of the positive song and the negative song in the preference triple. The server may determine the first text similarity corresponding to the preference triple based on the sample song text features of the two positive songs in the preference triple, and determine the second text similarity corresponding to the preference triple based on the sample song text features of the positive song and the negative song in the preference triple. The server may determine the audio triple loss based on the first audio similarity and the second audio similarity corresponding to each of the multiple preference triples. The server may determine the text ternary loss according to the first text similarity and the second text similarity corresponding to each of the plurality of preference triples. The server may select at least some of the positive songs and negative songs from the plurality of preference triples as the first sample songs, and use the positive songs and negative songs in the plurality of preference triples other than the first sample songs as the second sample songs. The server may determine the first cross-modal similarity according to the sample song audio features of the first sample song and the sample song text features of the first sample song, and determine the second cross-modal similarity according to the sample song audio features of the first sample song and the sample song text features of the second sample song. The server may determine the contrast loss according to the ratio of the first cross-modal similarity to the second cross-modal similarity. Furthermore, the server may determine the target loss according to the audio ternary loss, the text ternary loss and the contrast loss, and iteratively train the song recommendation model to be trained in the direction of reducing the target loss until the iteration stop condition is met to obtain the trained song recommendation model.

[0066] In one embodiment, the target loss may be determined by the following formula:

[0067] ;

[0068] ;

[0069] ;

[0070] .

[0071] in, Representing the first audio similarity, it can be understood that the first audio similarity can be represented by the distance between the sample song audio features of the two positive example songs in the preference triplet. It represents the second audio similarity. It can be understood that the second audio similarity can be represented by the distance between the audio features of the sample songs of a positive song and a negative song in the preference triplet. n represents the number of preference triples in a training batch. Represents audio ternary loss. Representing the first text similarity, it can be understood that the first text similarity can be represented by the distance between the sample song text features of the two positive example songs in the preference triplet. Representing the second text similarity, it can be understood that the second text similarity can be represented by the distance between the sample song text features of a positive song and a negative song in the preference triplet. represents the text triple loss. q represents the sample song audio feature of the first sample song, represents a sample song text feature of the first sample song, Indicates the second sample song. represents the first cross-modal similarity, represents the second cross-modal similarity. K represents the number of second sample songs in a training batch. is the contrast loss. Loss is the target loss. weight1, weight2 and weight3 are pre-set weights, which are used to control the proportion of audio ternary loss, text ternary loss and contrast loss in the target loss. and It is a pre-set fixed value used to control the size of the loss function. It can be understood that the audio ternary loss learns song characteristics from the audio dimension, the text ternary loss learns song characteristics from the text dimension, and the contrast loss combines the features of the two modalities of audio and text as a bridge connecting the two modalities in the song recommendation model.

[0072] In the above embodiment, the song recommendation model to be trained is trained by audio ternary loss, text ternary loss and contrast loss to obtain a trained song recommendation model. In this way, the song audio information and song text information of the song are considered at the same time in the process of training the song recommendation model. The contrast loss can also prevent the model from being affected by certain song characteristics, making the model training more comprehensive, so that the trained song recommendation model can extract more accurate and richer song audio features and song text features, thereby further improving the recommendation accuracy of the song.

[0073] In one embodiment, a plurality of preference triplets are obtained, including: obtaining a plurality of sample collection song lists, each sample collection song list including at least two collection songs; for each sample collection song list, combining the collection songs in the sample collection song list in pairs to obtain candidate song pairs corresponding to the sample collection song list; selecting a plurality of candidate song pairs having an appearance frequency greater than a preset frequency as a plurality of target song pairs from the candidate song pairs corresponding to the sample collection song lists of the plurality of sample users; for each target song pair, taking the collection songs in the target song pair as positive example songs, selecting a collection song from each collection song of the target song as a negative example song, and obtaining a preference triplet corresponding to the target song pair.

[0074] Specifically, the server may obtain multiple sample collection song lists, wherein each sample collection song list includes at least two collection songs. For each sample collection song list, the server may combine the collection songs in the sample collection song list in pairs to obtain candidate song pairs corresponding to the sample collection song list. The server may select multiple candidate song pairs with an appearance frequency greater than a preset frequency from the candidate song pairs corresponding to the multiple sample collection song lists as multiple target song pairs. For each target song pair, the server may use the collection songs in the target song pair as positive songs, and select a collection song from each collection song of the target song as a negative song, to obtain the preference triple corresponding to the target song pair, i.e. (positive song 1, positive song 2, negative song), wherein positive song 1 and positive song 2 are a target song pair.

[0075] For example, assuming that user A's playlist is [S1, S2, S3], user B's playlist is [S1, S2, S4], and user C's playlist is [S1, S3, S5], then the results of the pairwise combinations and the corresponding frequencies are: S1S2 (2 times), S1S3 (2 times), S2S3 (1 time), S2S4 (1 time), S1S4 (1 time), S1S5 (1 time), S3S5 (1 time). If the preset frequency is set to 2, the target song pairs retained are S1S2 and S1S3.

[0076] In one embodiment, the server may obtain initial sample collection playlists of multiple sample users respectively; for each initial sample collection playlist, the initial sample collection playlist may be directly used as the sample collection playlist.

[0077] In the above embodiment, for each sample collection song list, the candidate song pairs corresponding to the sample collection song list are obtained by combining the collection songs in the sample collection song list in pairs. From the candidate song pairs corresponding to the multiple sample collection song lists, multiple candidate song pairs with an appearance frequency greater than a preset frequency are selected as multiple target song pairs. For each target song pair, the collection songs in the target song pair are used as positive example songs, and one collection song is selected from the various collection songs of the target song as a negative example song to obtain the preference triplet corresponding to the target song pair. In this way, the accuracy of the obtained preference triplet can be improved.

[0078] In one embodiment, obtaining multiple sample collection playlists includes: obtaining initial sample collection playlists of multiple sample users; and determining an initial sample collection playlist having an initial sample collection playlist with a number of collection songs greater than a preset number as a sample collection playlist.

[0079] Specifically, the server may obtain the initial sample collection song lists of multiple sample users. For each initial sample collection song list, the server may count the number of collection songs in the initial sample collection song list. When the number of collection songs in the initial sample collection song list is greater than a preset number, the initial sample collection song list is used as a sample collection song list, so that the initial sample collection song lists of users who listen to less songs can be filtered out, thereby improving the confidence of the sample collection song list that is finally used as training data.

[0080] In one embodiment, Figure 4 As shown, the server may obtain initial sample favorite song lists of multiple sample users, i.e., the favorite song list of user 1, the favorite song list of user 2, ..., the favorite song list of user n. For each initial sample favorite song list, the server may determine the number of favorite songs in the initial sample favorite song list. When the number of favorite songs in the initial sample favorite song list is greater than a preset number, the initial sample favorite song list is used as a sample favorite song list, i.e., intersection song list 1, intersection song list 2, ..., intersection song list m.

[0081] For each sample collection song list, the collection songs in the sample collection song list are combined in pairs to obtain at least one candidate song pair corresponding to the sample collection song list, that is, song pair 1, song pair 2, ..., song pair k. The server can select candidate song pairs with a frequency of occurrence greater than a preset frequency from the candidate song pairs corresponding to the sample collection song lists of multiple sample users as target song pairs, that is, high-confidence song pairs. For each target song pair, the server can use the two collection songs in the target song pair as positive songs, and select one collection song from the external collection songs of the target song as a negative song to obtain the preference triplet corresponding to the target song pair. Each preference triplet contains two positive songs that the same sample user likes and one negative song that the same sample user does not like.

[0082] For each preference triplet, the preference triplet is input into the song recommendation model to be trained to extract the sample song audio features and sample song text features of the positive and negative songs contained in the preference triplet, and the first audio similarity corresponding to the preference triplet is determined according to the sample song audio features of the two positive songs in the preference triplet, and the second audio similarity corresponding to the preference triplet is determined according to the sample song audio features of the one positive song and the negative song in the preference triplet. The first text similarity corresponding to the preference triplet is determined according to the sample song text features of the two positive songs in the preference triplet, and the second text similarity corresponding to the preference triplet is determined according to the sample song text features of the one positive song and the negative song in the preference triplet. The audio triplet loss is determined according to the first audio similarities and the second audio similarities corresponding to the multiple preference triplet. The text triplet loss is determined according to the first text similarities and the second text similarities corresponding to the multiple preference triplet.

[0083] At least some of the positive songs and negative songs are selected from the plurality of preference triplets as first sample songs, and the positive songs and negative songs in the plurality of preference triplets except the first sample songs are selected as second sample songs; the sample songs include positive songs and negative songs. A first cross-modal similarity is determined based on the sample song audio features of the first sample song and the sample song text features of the first sample song. A second cross-modal similarity is determined based on the sample song audio features of the first sample song and the sample song text features of the second sample song. A contrast loss is determined based on the ratio of the first cross-modal similarity to the second cross-modal similarity.

[0084] According to the audio ternary loss, text ternary loss and contrast loss, the song recommendation model to be trained is trained to obtain a trained song recommendation model. It can be understood that in the model application stage, the server can input the target song into the trained song recommendation model to extract features of the song audio information through the trained song recommendation model to obtain song audio features, extract features of the song text information to obtain song text features, fuse the song audio features and the song text features to obtain the song fusion features of the target song, and recommend songs based on the song fusion features of the target song.

[0085] In the above embodiment, for each initial sample collection song list, when the number of collection songs in the initial sample collection song list is greater than the preset number, the initial sample collection song list is used as the sample collection song list. In this way, the initial sample collection song list of users who listen to less songs can be filtered out, and the confidence of the sample collection song list can be improved, thereby further improving the accuracy of song recommendation.

[0086] In one embodiment, the associated songs are the collection songs of the user to be recommended; based on the similarity between the song fusion feature of the song to be recommended and the song fusion feature of each associated song, the songs to be recommended are recommended to multiple users to be recommended, including: for each collection song of the target user to be recommended, the similarity between the song fusion feature of the collection song and the song fusion feature of the song to be recommended is determined to obtain the similarity between the collection song and the song to be recommended; the target user to be recommended is any user to be recommended among the multiple users to be recommended; based on the similarity between each collection song in at least one collection song of the target user to be recommended and the song to be recommended, the songs to be recommended are recommended to the target user to be recommended. In one embodiment, the song to be recommended is any associated song of any user to be recommended among the multiple users to be recommended; or, the song to be recommended is different from each associated song of each user to be recommended.

[0087] In one embodiment, the song to be recommended is different from the associated songs of each user to be recommended, which can be understood as the song to be recommended is a newly released song.

[0088] It should be understood that, although each step in the flow chart of the above-mentioned embodiments is shown in order, these steps are not necessarily performed in order. Unless there is a clear explanation in this article, the execution of these steps does not have strict order restrictions, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the above-mentioned embodiments may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in order, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0089] In one embodiment, Figure 5 As shown, a song recommendation device 500 is provided, and the device specifically includes:

[0090] The first acquisition module 502 is used to acquire multiple preference triples; each preference triplet includes two positive songs that the same sample user likes and one negative song that the same sample user does not like;

[0091] A first extraction module 504 is used for inputting the preference triplet into the song recommendation model to be trained for each preference triplet, so as to extract the sample song audio features and sample song text features of the positive example songs and the negative example songs respectively contained in the preference triplet;

[0092] Determination module 506, for determining a first audio similarity corresponding to the preference triplet according to the audio features of the sample songs of the two positive songs in the preference triplet, and determining a second audio similarity corresponding to the preference triplet according to the audio features of the sample songs of the one positive song and the negative song in the preference triplet; determining a first text similarity corresponding to the preference triplet according to the text features of the sample songs of the two positive songs in the preference triplet, and determining a second text similarity corresponding to the preference triplet according to the text features of the sample songs of the one positive song and the negative song in the preference triplet; determining an audio triplet loss according to the first audio similarities and the second audio similarities corresponding to each of the plurality of preference triplet; determining a text triplet loss according to the first text similarities and the second text similarities corresponding to each of the plurality of preference triplet;

[0093] The training module 508 is used to train the song recommendation model to be trained according to the audio ternary loss and the text ternary loss to obtain a trained song recommendation model; the trained song recommendation model is used to recommend songs to be recommended.

[0094] In one embodiment, the training module 508 is also used to select at least some positive songs and negative songs from multiple preference triplets as first sample songs, and select the positive songs and negative songs in the multiple preference triplets except the first sample songs as second sample songs; determine the first cross-modal similarity according to the sample song audio features of the first sample songs and the sample song text features of the first sample songs; determine the second cross-modal similarity according to the sample song audio features of the first sample songs and the sample song text features of the second sample songs; determine the contrast loss according to the ratio of the first cross-modal similarity to the second cross-modal similarity; train the song recommendation model to be trained according to the audio ternary loss, the text ternary loss and the contrast loss to obtain the trained song recommendation model.

[0095] In one embodiment, the first acquisition module 502 is also used to obtain multiple sample collection song lists, each sample collection song list includes at least two collection songs; for each sample collection song list, the collection songs in the sample collection song list are combined in pairs to obtain candidate song pairs corresponding to the sample collection song list; from the candidate song pairs corresponding to the multiple sample collection song lists, candidate song pairs whose occurrence frequencies are greater than multiple preset frequencies are selected as multiple target song pairs; for each target song pair, the collection songs in the target song pair are used as positive example songs, and one collection song is selected from each collection song of the target song as a negative example song to obtain a preference triplet corresponding to the target song pair.

[0096] In one embodiment, the first acquisition module 502 is also used to obtain the initial sample collection song lists of multiple sample users; the initial sample collection song list in which the number of collected songs is greater than a preset number is determined as a sample collection song list.

[0097] In one embodiment, Figure 6 As shown, a song recommendation device 600 is provided, and the device specifically includes:

[0098] The second acquisition module 602 is used to acquire songs to be recommended and at least one associated song of each of the multiple users to be recommended, where the associated song is a song that has a preset interactive behavior with the user to be recommended;

[0099] The second extraction module 604 is used to input the song to be recommended and multiple related songs into the trained song recommendation model to obtain the song audio features and song text features of the song to be recommended, as well as the song audio features and song text features of each related song; wherein the song recommendation model is trained by the training method of the song recommendation model of the present application;

[0100] Fusion module 606, used to fuse the song audio features and song text features of the song to be recommended to obtain the song fusion features of the song to be recommended, and to fuse the song audio features and song text features of each associated song to obtain the song fusion features of each associated song;

[0101] The recommendation module 608 is used to recommend the song to be recommended to multiple users to be recommended based on the similarity between the song fusion feature of the song to be recommended and the song fusion features of each related song.

[0102] In one embodiment, the associated songs are favorite songs that the user to be recommended has favorited; the recommendation module 608 is also used to determine the similarity between the song fusion features of the favorite songs and the song fusion features of the songs to be recommended for each favorite song of the target user to be recommended, so as to obtain the similarity between the favorite songs and the songs to be recommended; the target user to be recommended is any one of the multiple users to be recommended; based on the similarity between each favorite song in at least one favorite song of the target user to be recommended and the songs to be recommended, the songs to be recommended are recommended to the target user to be recommended.

[0103] In one embodiment, the song to be recommended is any associated song of any user to be recommended among multiple users to be recommended; or, the song to be recommended is different from each associated song of each user to be recommended.

[0104] The above-mentioned song recommendation device obtains songs to be recommended and at least one related song of each user to be recommended among multiple users to be recommended, where the related songs are songs that have preset interactive behaviors with the users to be recommended; inputs the songs to be recommended and multiple related songs into a trained song recommendation model to obtain the song audio features and song text features of the songs to be recommended, as well as the song audio features and song text features of each related song; wherein the song recommendation model is trained by the training method of the song recommendation model in the present application; fuses the song audio features and song text features of the songs to be recommended to obtain the song fusion features of the songs to be recommended, and fuses the song audio features and song text features of each related song respectively to obtain the song fusion features of each related song; and recommends the songs to be recommended to multiple users to be recommended based on the similarity between the song fusion features of the songs to be recommended and the song fusion features of each related song. In this way, by analyzing the information of the songs to be recommended and the related songs themselves, that is, the information of the two modes of song audio information and song text information of the songs to be recommended and the related songs themselves, and by the song fusion features obtained by fusing the song audio features of the song audio information and the song text features of the song text information, song recommendations are performed. In this way, even if the historical user behavior of the songs to be recommended cannot be obtained, the songs to be recommended can be recommended to the appropriate user groups, thereby improving the recommendation accuracy of the users to be recommended.

[0105] Each module in the above song recommendation device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0106] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a song recommendation method is implemented.

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

[0108] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

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

[0110] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

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

[0112] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0113] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0114] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A training method for a song recommendation model, It is characterized in that The method comprises: Acquire multiple preference triplets; each preference triplet contains two positive songs that the same sample user likes and one negative song that the same sample user does not like; For each preference triplet, input the preference triplet into a song recommendation model to be trained to extract sample song audio features and sample song text features of each of the positive example song and the negative example song contained in the preference triplet; Determine a first audio similarity corresponding to the preference triplet according to the sample song audio features of each of the two positive songs in the preference triplet, and determine a second audio similarity corresponding to the preference triplet according to the sample song audio features of each of the positive song and the negative song in the preference triplet; Determine a first text similarity corresponding to the preference triplet according to the sample song text features of each of the two positive songs in the preference triplet, and determine a second text similarity corresponding to the preference triplet according to the sample song text features of each of the positive song and the negative song in the preference triplet; Determine an audio ternary loss based on the first audio similarities and the second audio similarities corresponding to each of the multiple preference triples; determine a text ternary loss based on the first text similarities and the second text similarities corresponding to each of the multiple preference triples; and, train the song recommendation model to be trained based on the audio ternary loss and the text ternary loss to obtain a trained song recommendation model; the trained song recommendation model is used to recommend songs to be recommended.

2. The method according to claim 1, It is characterized in that The step of training the song recommendation model to be trained according to the audio ternary loss and the text ternary loss to obtain the trained song recommendation model comprises: Selecting at least part of the positive example songs and the negative example songs from the plurality of preference triplets as first sample songs, and selecting the positive example songs and the negative example songs in the plurality of preference triplets except the first sample songs as second sample songs; Determining a first cross-modal similarity according to a sample song audio feature of the first sample song and a sample song text feature of the first sample song; determining a second cross-modal similarity according to the sample song audio feature of the first sample song and a sample song text feature of the second sample song; and determining a contrast loss according to a ratio of the first cross-modal similarity to the second cross-modal similarity; The song recommendation model to be trained is trained according to the audio ternary loss, the text ternary loss and the contrast loss to obtain a trained song recommendation model.

3. The method according to claim 1, It is characterized in that The obtaining of multiple preference triplets includes: Acquire multiple sample collection song lists, each of which includes at least two collection songs; For each of the sample collection song lists, the collected songs in the sample collection song lists are combined in pairs to obtain candidate song pairs corresponding to the sample collection song lists; and from the candidate song pairs corresponding to the multiple sample collection song lists, multiple candidate song pairs whose occurrence frequency is greater than a preset frequency are selected as multiple target song pairs; For each target song pair, the collection songs in the target song pair are taken as positive example songs, and one collection song is selected from each collection song of the target song as a negative example song to obtain the preference triplet corresponding to the target song pair.

4. The method according to claim 3, It is characterized in that The obtaining of multiple sample collection playlists includes: Obtain initial sample collection playlists of multiple sample users; An initial sample collection song list in which the number of collected songs is greater than a preset number is determined as a sample collection song list.

5. A song recommendation method, It is characterized in that The method comprises: Acquire songs to be recommended and at least one associated song of each of the multiple users to be recommended, wherein the associated song is a song that has a preset interactive behavior with the user to be recommended; Inputting the song to be recommended and the plurality of the related songs into a trained song recommendation model to obtain the song audio features and song text features of the song to be recommended, as well as the song audio features and song text features of each of the related songs; wherein the song recommendation model is trained by the method described in any one of claims 1 to 4; The song audio features and the song text features of the song to be recommended are merged to obtain the song fusion features of the song to be recommended, and the song audio features and the song text features of each of the related songs are merged to obtain the song fusion features of each of the related songs; Based on the similarity between the song fusion feature of the song to be recommended and the song fusion features of each of the related songs, the song to be recommended is recommended to the multiple users to be recommended.

6. The method according to claim 5, It is characterized in that The associated songs are collection songs that the user to be recommended has collected; The step of recommending the song to be recommended to the plurality of users to be recommended based on the similarity between the song fusion feature of the song to be recommended and the song fusion features of each of the related songs comprises: For each of the collection songs of the target user to be recommended, determine the similarity between the song fusion feature of the collection song and the song fusion feature of the song to be recommended, so as to obtain the similarity between the collection song and the song to be recommended; the target user to be recommended is any user to be recommended among the multiple users to be recommended; Based on the similarity between each of the at least one favorite song of the target user to be recommended and the song to be recommended, the song to be recommended is recommended to the target user to be recommended.

7. The method according to claim 5, It is characterized in that The song to be recommended is any associated song of any of the multiple users to be recommended; or, the song to be recommended is different from each associated song of each user to be recommended.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

9. A computer-readable storage medium storing a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

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