Song recommendation model training method, computer device, and storage medium
By training a song feature extraction model through comparative learning and integrating song audio and text description information, the problem of insufficient recommendation accuracy in traditional song recommendation methods is solved, and more accurate song recommendations are achieved.
Patent Information
- Application Number
- CN202410747127.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2044-06-11
AI Technical Summary
Traditional song recommendation methods only analyze song audio, which cannot accurately and comprehensively reflect users' true listening preferences, resulting in insufficient recommendation accuracy.
A song feature extraction model is trained using a contrastive learning approach, which integrates song audio information and text description information. Song features are then concatenated through a song recommendation model, and the model is trained using positive and negative sample songs to improve recommendation accuracy.
It achieves cross-modal information fusion based on audio and text descriptions, improving the accuracy of song recommendation and enabling more accurate recommendations of songs that match user preferences.
Smart Images

Figure CN118585668B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, in particular to a song recommendation method, a song recommendation model training method and device, a computer device, a storage medium and a computer program product. BACKGROUND
[0002] In the music field, song recommendation can be achieved by analyzing user behavior and the relevance between songs, inferring the user's listening preferences, and pushing appropriate songs to the right people. Since the content and types of song audio are diverse, accurately recommending songs with content and types that users like to the corresponding users not only improves user experience, but also promotes and promotes song promotion.
[0003] Traditional technology mainly combines song audio and user behavior to analyze user listening preferences. However, since user listening preferences are not only related to song audio, the listening preferences obtained by only analyzing song audio cannot accurately and comprehensively reflect the user's true listening preferences, which is not conducive to improving the accuracy of song recommendation. SUMMARY
[0004] Therefore, it is necessary to provide a song recommendation model training method, device, computer device, computer readable storage medium and computer program product that can improve the accuracy of song recommendation.
[0005] In a first aspect, the present application provides a song recommendation model training method, comprising:
[0006] The song audio information of the first sample song, the first text description information of the first sample song, and the second text description information of the second sample song are used as training samples, and a song feature extraction model is trained in a contrast learning manner to obtain a trained song feature extraction model; wherein the first sample song and the second sample song are different;
[0007] The text description feature and the song audio feature of the third sample song are obtained by the trained song feature extraction model, the text description feature of the third sample song and the song audio feature of the third sample song are spliced by the song recommendation model to obtain the song fusion feature of the third sample song, and the song recommendation model is trained using the song fusion feature of the third sample song and the corresponding positive sample song and negative sample song of the third sample song to obtain a trained song recommendation model.
[0008] In one of the embodiments, the song audio information of the first sample song, the first text description information of the first sample song, and the second text description information of the second sample song are taken as training samples, a song feature extraction model is trained in a contrast learning manner to obtain a trained song feature extraction model, which comprises:
[0009] The song audio information, the first text description information, and the second text description information are input into the song feature extraction model to be trained to obtain the song audio feature of the first sample song, the text description feature of the first sample song, and the text description feature of the second sample song.
[0010] The song feature extraction model is trained according to the first similarity between the song audio feature and the text description feature of the first sample song and the second similarity between the song audio feature and the text description feature of the second sample song to obtain the trained song feature extraction model.
[0011] In one of the embodiments, the song audio information, the first text description information, and the second text description information are input into the song feature extraction model to be trained to obtain the song audio feature of the first sample song, the text description feature of the first sample song, and the text description feature of the second sample song, which comprises:
[0012] The song audio information is input into a first branch of the song feature extraction model to be trained to obtain the song audio feature of the first sample song; wherein the first branch is an audio feature extraction model.
[0013] The first text description information is input into a second branch of the song feature extraction model to be trained to obtain the text description feature of the first sample song; wherein the second branch is a text description feature extraction model.
[0014] The second text description information is input into the second branch of the song feature extraction model to be trained to obtain the text description feature of the second sample song.
[0015] In one of the embodiments, the song audio information is input into the first branch of the song feature extraction model to be trained to obtain the song audio feature of the first sample song, and the first text description information is input into the second branch of the song feature extraction model to be trained to obtain the text description feature of the first sample song, which comprises:
[0016] The song audio information is mapped to a first preset space through a first feature mapping network in the first branch to obtain a mapping feature corresponding to the song audio information.
[0017] convert the mapping feature corresponding to the song audio information into a song audio feature of the first sample song through a first feature conversion network in the first branch;
[0018] map the song audio information to a second preset space through a second feature mapping network in the second branch to obtain a mapping feature corresponding to the first text description information;
[0019] convert the mapping feature corresponding to the first text description information into a text description feature of the first sample song through a second feature conversion network in the second branch.
[0020] In one of the embodiments, the training of the song recommendation model by using the song fusion feature of the third sample song and the positive sample song and the negative sample song corresponding to the third sample song to obtain the trained song recommendation model comprises:
[0021] obtaining the song fusion feature of the positive sample song and the song fusion feature of the negative sample song;
[0022] training the to-be-trained song recommendation model according to a third similarity between the song fusion feature of the third sample song and the song fusion feature of the positive sample song and a fourth similarity between the song fusion feature of the third sample song and the song fusion feature of the negative sample song to obtain the trained song recommendation model.
[0023] In one of the embodiments, the method further comprises:
[0024] obtaining a first song set of the first type in the listening behavior data of the first sample user, a second song set of the second type in the listening behavior data of the first sample user, a third song set of the first type in the listening behavior data of the second sample user, and a fourth song set of the second type in the listening behavior data of the second sample user;
[0025] obtaining the third sample song and the positive sample song from the intersection between the first song set and the second song set;
[0026] obtaining the negative sample song from the intersection between the third song set and the fourth song set.
[0027] In a second aspect, the application further provides a song recommendation method, comprising:
[0028] obtaining song fusion features of the candidate song and song fusion features of a reference song through a pre-trained song feature extraction model; the reference song is a song of a preset type in the listening behavior data of the target object; the pre-trained song feature extraction model is trained by the method described above;
[0029] inputting the song fusion features of the candidate song and the song fusion features of the reference song into a pre-trained song recommendation model to obtain a similarity between the song fusion features of the candidate song and the song fusion features of the reference song;
[0030] outputting a song recommendation result according to the similarity between the song fusion features of the candidate song and the song fusion features of the reference song and a preset similarity condition; the song recommendation result represents whether the candidate song is recommended to the target object as a recommended song.
[0031] In a third aspect, the present application further provides a song recommendation model training device, comprising:
[0032] The extraction model training module is configured to use the song audio information of the first sample song, the first text description information of the first sample song and the second text description information of the second sample song as training samples, train a song feature extraction model in a contrast learning manner, and obtain a trained song feature extraction model; wherein the first sample song is different from the second sample song.
[0033] The recommendation model training module is configured to obtain text description features and song audio features of a third sample song through the trained song feature extraction model, splice the text description features of the third sample song and the song audio features of the third sample song through a song recommendation model, obtain song fusion features of the third sample song, and train the song recommendation model using the song fusion features of the third sample song and corresponding positive sample songs and negative sample songs of the third sample song, to obtain a trained song recommendation model.
[0034] In a fourth aspect, the present application further provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the computer program is executed by the processor to implement the steps of the above method.
[0035] In a fifth aspect, the present application further provides a computer readable storage medium. The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the steps of the above method.
[0036] In a sixth aspect, the present application also provides a computer program product. The computer program product comprises a computer program, which, when executed by a processor, implements the steps of the method described above.
[0037] The song recommendation method, the song recommendation model training method, the device, the computer equipment, the storage medium, and the computer program product described above extract the song audio feature and the text description feature of the first sample song and the text description feature of the second sample song one by one as training samples by using the song feature extraction model, and train the song feature extraction model based on the training samples, so that the output result of the song feature extraction model can fuse audio information and text description information, realize cross-modal information fusion, and provide a data basis for subsequent training of the song recommendation model; the song recommendation model is used to splice the text description feature and the song audio feature of the third sample song to obtain the song fusion feature of the third sample song, and the song recommendation model is trained in combination with the positive sample song and the negative sample song corresponding to the third sample song, so that the song recommendation model is based on the song fusion feature capable of expressing the audio feature and the text description feature of the song, fully analyzes and learns the difference / similarity between different types of sample songs, obtains the trained song recommendation model, and thus the trained song recommendation model can analyze whether the song needs to be recommended to the user from the angles of audio and text description, thereby improving the accuracy of song recommendation. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the embodiments or the related art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0039] Figure 1 An application environment diagram of a song recommendation model training method in an embodiment;
[0040] Figure 2 A flowchart of a song recommendation model training method in an embodiment;
[0041] Figure 3 A flowchart of training a song feature extraction model in an embodiment;
[0042] Figure 4 A flowchart of training a song recommendation model in an embodiment;
[0043] Figure 5 A block diagram of a song recommendation model training device in an embodiment;
[0044] Figure 6 Figure 1 is a schematic diagram of an internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0045] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.
[0046] The song recommendation model training method provided in the embodiments of the present application can be applied in an application environment as shown in Figure 1 The terminal 102 communicates with the server 104 through a network. The data storage system can store data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on a cloud or other network server. The server 104 takes the song audio information of a first sample song, the first text description information of the first sample song, and the second text description information of a second sample song as training samples, trains a song feature extraction model in a contrast learning manner, and obtains a trained song feature extraction model; wherein the first sample song is different from the second sample song. The server 104 obtains third text description information and song audio features of a third sample song through the trained song feature extraction model, splices the third text description information and the song audio features through a song recommendation model, obtains song fusion features of the third sample song, and trains the song recommendation model using the song fusion features of the third sample song and positive sample songs and negative sample songs corresponding to the third sample song, to obtain a trained song recommendation model. The terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0047] In one exemplary embodiment, as shown in Figure 2 A song recommendation model training method is provided. The method is described by taking a server as an example. It can be understood that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction of the terminal and the server. In the embodiments, the method includes the following steps:
[0048] Step S202, the song audio information of the first sample song, the first text description information of the first sample song, and the second text description information of the second sample song are taken as training samples, a song feature extraction model is trained in a contrast learning manner, and a trained song feature extraction model is obtained; wherein the first sample song and the second sample song are different.
[0049] The first sample song can refer to any song in the song database of the music platform.
[0050] The song audio information can refer to information representing the audio content of the song. In actual applications, the song audio information can include but is not limited to style information and genre information of the song.
[0051] The first text description information can refer to information describing the label of the first sample song. In actual applications, the first text description information can be used as the label information of the first sample song. The first text description information can include but is not limited to year information, award information, and song creation background information of the first sample song.
[0052] The second sample song can refer to any song different from the first sample song in the song database of the music platform.
[0053] The second text description information can refer to information describing the label of the second sample song. In actual applications, the second text description information can be used as the label information of the second sample song. The second text description information can include but is not limited to year information, award information, and song creation background information of the second sample song.
[0054] The song feature extraction model can refer to a model for extracting or determining the features of a song. In actual applications, the song feature extraction model can determine the song audio features of a song based on the song audio information of the song, and determine the text description features of the song based on the text description information of the song. In specific implementations, the song feature extraction model can encode and convert the song audio information of the song to obtain the song audio features of the song, and encode and convert the text description information of the song to obtain the text description features of the song.
[0055] As an example, song recommendation is an important way for users to listen to songs and new song promotion. Song recommendation can increase the stickiness of users to music products with song recommendation function by recommending suitable songs to suitable users, and can also be an important means for users to expand playlists, discover "treasure songs" (such as songs that users like), and improve music breadth. For example, current song recommendation forms (such as recommendation points) can include thirty songs per day, autoplay (automatic play), etc. The songs recommended to users in these recommendation points can include some new songs that need to be launched. Accurate pushing of new songs to suitable user groups is an important way for accurate distribution of traffic and a key to new song promotion. In order to accurately recommend suitable songs to suitable users, the server can build and train a song recommendation model to achieve accurate song recommendation. In order to train the song recommendation model, the server can obtain a first sample song and a second sample song (different from the first sample song) from a song database of a music platform. Then the server can obtain song audio information of the first sample song and first text description information of the first sample song, and obtain second text description information of the second sample song. The song audio information of the first sample song, the first text description information of the first sample song, and the second text description information of the second sample song can be used as training samples for training the song recommendation model. Then the server trains the song feature extraction model using the above training samples in a contrast learning manner, so that the song feature extraction model interacts the features corresponding to the song audio information and the features corresponding to the text description information in a contrast learning manner, obtains information fusion features, and obtains a trained song feature extraction model. The training target of the song feature extraction model can include that the distance between the song audio representation and the text description representation of the same song is closer, and the distance between the song audio representation and the text description representation of different songs is farther.
[0056] As an example, the server trains a song feature extraction model based on a first similarity between the audio features of a first sample song and its text description features, and a second similarity between the audio features of a first sample song and its text description features of a second sample song. Specifically, the server can use the distance between the audio feature vector of the first sample song and the text description feature vector of the second sample song as the first similarity between their respective features, and the distance between the audio feature vector of the first sample song and the text description feature vector of the second sample song as the second similarity between their respective features. The server trains a song feature extraction model using contrastive learning based on the first and second similarity levels between the text description features of the first sample song and the second sample song. The learning objective can include a greater first similarity between the audio features of the first sample song and the text description features of the first sample song (e.g., a smaller or closer distance between the audio feature vector and the text description feature vector of the first sample song) and a greater second similarity between the audio features of the first sample song and the text description features of the second sample song (e.g., a larger or farther distance between the audio feature vector and the text description feature vector of the second sample song).
[0057] Step S204: Obtain the text description features and audio features of the third sample song through the trained song feature extraction model. Concatenate the text description features and audio features of the third sample song through the song recommendation model to obtain the song fusion features of the third sample song. Use the song fusion features of the third sample song and the corresponding positive and negative sample songs to train the song recommendation model to obtain the trained song recommendation model.
[0058] The third sample song can refer to the song whose operation type is the first type in the user's listening behavior data. In practical applications, listening behavior data can represent the operation performed by the user on the song. The operation type in the listening behavior data can include the first type (such as the "like" operation) and the second type (such as the "dislike" operation).
[0059] The audio features of the third sample song can refer to the data obtained after the song feature extraction model encodes and transforms the audio information of the third sample song. In practical applications, the audio features of the third sample song can be represented as the audio feature vector of the third sample song.
[0060] The text description feature of the third sample song can be data obtained by encoding and converting the text description information of the third sample song by the song feature extraction model. In actual application, the text description feature of the third sample song can be represented as a text description feature vector of the third sample song. The feature dimension of the song audio feature of the third sample song and the feature dimension of the text description feature of the third sample song can be the same.
[0061] The positive sample song can be a song of the first type in the listening behavior data of the user.
[0062] The negative sample song can be a song of the second type in the listening behavior data of the user.
[0063] The song fusion feature of the third sample song can be a feature capable of representing the audio content and the label of the third sample song at the same time. In actual application, the song fusion feature can be obtained by fusing or splicing the song audio feature of the third sample song and the text description feature of the third sample song.
[0064] The song recommendation model can be a model used to determine whether a song needs to be recommended to a specific user. In actual application, the song recommendation model can determine the similarity between a song input into the song recommendation model and a song liked or collected by a specific user by analyzing the song fusion feature of the song input into the song recommendation model, and determine whether the song input into the song recommendation model needs to be recommended to the specific user based on the similarity.
[0065] As an example, after the song feature extraction model is trained, the server can input the song audio information of the third sample song and the third text description information of the third sample song into the trained song feature extraction model to obtain the song audio feature of the third sample song and the third text description feature of the third sample song. The server can fuse / splice the song audio feature of the third sample song and the third text description feature of the third sample song through the song recommendation model to obtain the song fusion feature of the third sample song. Then, the server can train the song recommendation model by using the song fusion feature. Training the song recommendation model by using the song fusion feature can make the song recommendation model analyze the song fusion feature and consider the influence of the audio feature and the text description feature on song recommendation at the same time, thereby improving the accuracy of song recommendation based on the song recommendation model. Specifically, the song recommendation model can analyze the similarity between the song fusion feature of the third sample song and the songs liked or collected by a specific user, and determine whether the third sample song needs to be recommended to the specific user based on the similarity. Since whether the third sample song needs to be recommended to the specific user is actually known, the server can train the song recommendation model according to the output result of the song recommendation model for whether the third sample song needs to be recommended to the specific user and whether the third sample song actually needs to be recommended to the specific user.
[0066] In the above song recommendation model training method, the song feature extraction model is used to extract the song audio feature and the text description feature of the first sample song and the text description feature of the second sample song as training samples one by one, and the song feature extraction model is trained based on the training samples, so that the output result of the song feature extraction model can fuse the audio information and the text description information, realize cross-modal information fusion, and provide a data basis for subsequent training of the song recommendation model. The song recommendation model is used to splice the text description feature and the song audio feature of the third sample song to obtain the song fusion feature of the third sample song, and the song recommendation model is trained in combination with the positive sample song and the negative sample song corresponding to the third sample song, so that the song recommendation model can fully analyze and learn the difference / similarity between different types of sample songs based on the song fusion feature that can express the audio feature and the text description feature of the song at the same time, and obtain the trained song recommendation model. Therefore, the trained song recommendation model can analyze whether a song needs to be recommended to a user from the perspectives of audio and text description at the same time, thereby improving the accuracy of song recommendation.
[0067] In one example embodiment, the song audio information of the first sample song, the first text description information of the first sample song, and the second text description information of the second sample song are taken as training samples, a song feature extraction model is trained in a contrast learning manner to obtain a trained song feature extraction model, including: inputting the song audio information, the first text description information, and the second text description information into the song feature extraction model to be trained to obtain the song audio feature of the first sample song, the text description feature of the first sample song, and the text description feature of the second sample song; training the song feature extraction model according to a first similarity degree between the song audio feature and the text description feature of the first sample song and a second similarity degree between the song audio feature and the text description feature of the second sample song to obtain the trained song feature extraction model.
[0068] The song audio feature of the first sample song can be data obtained by encoding and converting the song audio information of the first sample song by the song feature extraction model. In actual application, the song audio feature of the first sample song can be represented as a song audio feature vector of the first sample song.
[0069] The text description feature of the first sample song can be data obtained by encoding and converting the first text description information by the song feature extraction model. In actual application, the text description feature of the first sample song can be represented as a text description feature vector of the first sample song.
[0070] The text description feature of the second sample song can be data obtained by encoding and converting the second text description information by the song feature extraction model. In actual application, the text description feature of the second sample song can be represented as a text description feature vector of the second sample song.
[0071] The first similarity degree can be information describing the similarity between the song audio feature of the first sample song and the text description feature of the first sample song. In actual application, the first similarity degree can include the distance between the song audio feature vector of the first sample song and the text description feature vector of the first sample song.
[0072] The second similarity degree can be information describing the similarity between the song audio feature of the first sample song and the text description feature of the second sample song. In actual application, the second similarity degree can include the distance between the song audio feature vector of the first sample song and the text description feature vector of the second sample song.
[0073] As an example, the server inputs the song audio information, the first text description information, and the second text description information into the song feature extraction model to be trained. The song feature extraction model can encode and convert the song audio information, the first text description information, and the second text description information to obtain the song audio feature of the first sample song, the text description feature of the first sample song, and the text description feature of the second sample song.
[0074] Then, the server can train the song feature extraction model according to the first similarity between the song audio feature of the first sample song and the text description feature of the first sample song, and the second similarity between the song audio feature and the text description feature of the second sample song, to obtain the trained song feature extraction model. Specifically, the server can take the distance between the song audio feature vector of the first sample song and the text description feature vector of the second sample song as the first similarity between the song audio feature of the first sample song and the text description feature of the first sample song, and take the distance between the song audio feature vector of the first sample song and the text description feature vector of the second sample song as the second similarity between the song audio feature of the first sample song and the text description feature of the second sample song. The server trains the song feature extraction model in a contrast learning manner based on the first similarity and the second similarity, so that the song feature extraction model can achieve a learning goal. The learning goal can include that the first similarity between the song audio feature of the first sample song and the text description feature of the first sample song is greater (e.g., the distance between the song audio feature vector of the first sample song and the text description feature vector of the first sample song is smaller or closer), and the second similarity between the song audio feature of the first sample song and the text description feature of the second sample song is greater (e.g., the distance between the song audio feature vector of the first sample song and the text description feature vector of the second sample song is greater or farther).
[0075] In this embodiment, the song feature extraction model is trained by using the text description feature corresponding to the text description information of the song and the song audio feature corresponding to the song audio information of the song, so that the output result of the song feature extraction model can fuse the audio information and the text description information, realize cross-modal information fusion, improve the accuracy of the text description feature and the song audio feature, and provide a data basis for subsequent training of the song recommendation model.
[0076] In an example embodiment, the song audio information, the first text description information and the second text description information are input into the song feature extraction model to be trained to obtain the song audio feature of the first sample song, the text description feature of the first sample song and the text description feature of the second sample song, including: inputting the song audio information into the first branch of the song feature extraction model to be trained to obtain the song audio feature of the first sample song; wherein the first branch is an audio feature extraction model; inputting the first text description information into the second branch of the song feature extraction model to be trained to obtain the text description feature of the first sample song; wherein the second branch is a text description feature extraction model; and inputting the second text description information into the second branch of the song feature extraction model to be trained to obtain the text description feature of the second sample song.
[0077] The first branch can be a model for extracting or determining the song audio feature of a song. In actual application, the first branch can include an audio feature extraction model, which can include a first feature mapping network and a first feature conversion network.
[0078] The second branch can be a model for extracting or determining the text description feature of a song. In actual application, the second branch can include a text description feature extraction model, which can include a second feature mapping network and a second feature conversion network.
[0079] As an example, the song feature extraction model can have a double-tower input structure. The first branch of the song feature extraction model can be an audio feature extraction model. The server inputs the song audio information of the first sample song into the first branch of the song feature extraction model to be trained to obtain the song audio feature of the first sample song. The second branch of the song feature extraction model can be a text description feature extraction model. The server inputs the first text description information into the second branch of the song feature extraction model to be trained to obtain the text description feature of the first sample song. Similarly, the server inputs the second text description information into the second branch of the song feature extraction model to be trained to obtain the text description feature of the second sample song.
[0080] In this embodiment, the first branch and the second branch of the song feature extraction model are used to extract audio features and text description features respectively, to determine corresponding song features from the audio and text description perspectives respectively, to provide a data basis for subsequent comparative learning training of the song feature extraction model, to make the song audio feature and the text description feature generated by the song feature extraction model for the same song closer, to optimize the performance of the song feature extraction model, and to further improve the accuracy of song recommendation based on song features.
[0081] In some embodiments, the song audio information is input into a first branch of a song feature extraction model to be trained to obtain song audio features of the first sample song; and the first text description information is input into a second branch of the song feature extraction model to be trained to obtain text description features of the first sample song, including: mapping the song audio information to a first preset space through a first feature mapping network in the first branch to obtain mapping features corresponding to the song audio information; converting the mapping features corresponding to the song audio information into the song audio features of the first sample song through a first feature conversion network in the first branch; mapping the song audio information to a second preset space through a second feature mapping network in the second branch to obtain mapping features corresponding to the first text description information; and converting the mapping features corresponding to the first text description information into the text description features of the first sample song through a second feature conversion network in the second branch.
[0082] The first feature mapping network can be a model for mapping the song audio information to the first preset space. In actual applications, the first feature mapping network can encode the song audio information. In specific implementations, the first feature mapping network can include a mert (representation) model, which is a pre-trained large model with good music representation performance. The mert (representation) model can be used to map audio signals to a new audio embedding space (such as the first preset space) and effectively compress the original audio information of the song.
[0083] The first preset space can be a vector space for representing audio features of a song.
[0084] The first feature conversion network can be a model for converting the mapping features corresponding to the song audio information in feature dimension. In actual applications, the first feature conversion network can include an MLP module, which is a type of neural network.
[0085] The mapping features corresponding to the song audio information can be information obtained by mapping the song audio information to the first preset space through the first feature mapping network.
[0086] The second feature mapping network can be a model for mapping the text description information of the song to the second preset space. In actual applications, the second feature mapping network can encode the text description information. In specific implementations, the second feature mapping network can include a BERT model, which is a type of language model. The BERT model is a pre-trained large model with good text representation performance. The text description (such as song title, singer name, lyrics, creation background, award-winning situation, etc.) available for the song is summarized in one sentence and input into the BERT model to obtain text embedding (such as the mapping features corresponding to the first text description information).
[0087] The second preset space can be a vector space used to represent the text description feature of the song.
[0088] The second feature conversion network can be a model for converting the feature dimension of the mapping feature corresponding to the text description information. In actual applications, the second feature conversion network can include an MLP module (a type of neural network).
[0089] The mapping feature corresponding to the first text description information can be information obtained by mapping the text description information to the second preset space (such as a text embedding space) through the second feature mapping network.
[0090] As an example, as shown in Figure 3 A flowchart for training a song feature extraction model is provided. The server can map the song audio information to the first preset space through the first feature mapping network (such as the mert model) in the first branch (such as the audio encoding branch) to obtain the mapping feature (such as the audio embedding) corresponding to the song audio information. Then, the server can convert the mapping feature corresponding to the song audio information into the song audio feature of the first sample song through the first feature conversion network (such as the MLP module 1) in the first branch. The server can map the song audio information to the second preset space through the second feature mapping network (such as the bert model) in the second branch to obtain the mapping feature (such as the text embedding) corresponding to the first text description information. Then, the server can convert the mapping feature corresponding to the first text description information into the text description feature of the first sample song through the second feature conversion network (such as the MLP module 2) in the second branch. In actual applications, the MLP module can convert the audio embedding and the text embedding into more specific embeddings, while performing dimension transformation. The song audio feature of the first sample song and the text description feature of the first sample song obtained after the dimension transformation can have the same feature dimension.
[0091] In one of the example embodiments, for the audio embedding output by the mert model, only the description of the song style, timbre, emotion, rhythm, and playing instrument is contained, and any text information related to the singer and lyrics is not contained. Similarly, the text embedding output by the bert model cannot completely summarize the specific performance of the audio information in the song. Therefore, the server can map the audio embedding and the text embedding into vectors of the same dimension (such as song audio features and text description features) through the first feature conversion network and the second feature conversion network, and then the server can perform contrastive learning on the song audio features and the text description features (or the audio embedding and the text embedding) to obtain information fusion embedding, thereby performing contrastive learning training on the song feature extraction model. The loss function of the contrastive learning can be represented as:
[0092] ,
[0093] wherein the numerator of the loss function is the dot product of q and k+, which represents the distance between the vector q and the vector k+, and the denominator is the sum of the dot products of all positive examples and all negative examples, wherein q can be understood as the song audio a, k+ is the text description of the song audio a, a and k+ form a positive example, and a and the text description of other song audios form a negative example. Similarly, other song audios and the text description of a also form a negative example. The parameter τ can be a preset parameter for controlling the range of the loss function.
[0094] After the song feature extraction model is trained, the song audio information and the corresponding text description information of the song can be processed by the MLP model in the trained song feature extraction model to obtain feature representations of the audio dimension and the text description dimension, respectively. Compared with the feature representations output by the mert model and the bert model, the feature representations of the audio dimension and the text description dimension have cross-modal information fusion, which is beneficial to the training of the subsequent song recommendation model.
[0095] In this embodiment, the song audio information is gradually converted into song audio features by the first feature mapping network and the first feature conversion network in the first branch, and the text description information is gradually converted into text description features by the second feature mapping network and the second feature conversion network in the second branch. This can facilitate the song feature extraction model to map the song audio features and the text description features to the same representation space through contrastive learning, so that the features output by the trained song feature extraction model have cross-modal information fusion, thereby optimizing the performance of the song feature extraction model and improving the accuracy of song recommendation based on song features.
[0096] In some embodiments, the song recommendation model is trained by using the song fusion feature of the third sample song and the positive sample song and the negative sample song corresponding to the third sample song, to obtain a trained song recommendation model, including: obtaining the song fusion feature of the positive sample song and the song fusion feature of the negative sample song; training the to-be-trained song recommendation model according to the third similarity between the song fusion feature of the third sample song and the song fusion feature of the positive sample song, and the fourth similarity between the song fusion feature of the third sample song and the song fusion feature of the negative sample song, to obtain the trained song recommendation model.
[0097] The positive sample song can be any song in the intersection between the first song set of the first type of operation in the listening behavior data of the first sample user and the third song set of the first type of operation in the listening behavior data of the second sample user. In actual application, the listening behavior data can represent the operation performed by the user on the song, and the operation type in the listening behavior data can include the first type (such as the “like” operation) and the second type (such as the “dislike” operation). The third sample song and the positive sample song corresponding to the third sample song can be a pair of positive examples.
[0098] The negative sample song can be any song in the intersection between the second song set of the second type of operation in the listening behavior data of the first sample user and the fourth song set of the second type of operation in the listening behavior data of the second sample user. The third sample song and the negative sample song corresponding to the third sample song can be a pair of negative examples.
[0099] As an example, the server obtains the third sample song, the positive sample song and the negative sample song corresponding to the third sample song, and inputs the song audio information and the text description information of the third sample song into the trained song feature extraction model to obtain the song audio feature and the text description feature of the third sample song. The to-be-trained song recommendation model can splice the song audio feature of the third sample song and the text description feature of the third sample song to obtain the song fusion feature of the third sample song. Similarly, the server can obtain the song fusion feature of the positive sample song and the song fusion feature of the negative sample song through the trained song feature extraction model and the to-be-trained song recommendation model respectively.
[0100] Then the server can train the to-be-trained song recommendation model according to the third similarity degree between the song fusion features of the third sample song and the song fusion features of the positive sample song and the fourth similarity degree between the song fusion features of the third sample song and the song fusion features of the negative sample song, to obtain the trained song recommendation model. Specifically, the server can take the distance between the song fusion features of the third sample song and the song fusion features of the positive sample song as the third similarity degree d(a, p) (distance of a pair of positive examples), and take the distance between the song fusion features of the third sample song and the song fusion features of the negative sample song as the fourth similarity degree d(a, n) (distance of a pair of negative examples). The server can calculate the loss function of the song recommendation model according to the third similarity degree d(a, p) and the fourth similarity degree d(a, n), and train the song recommendation model based on the loss function of the song recommendation model. The loss function can be expressed as:
[0101] ,
[0102] wherein the parameter of margin can be a specific numerical value set in advance, and margin is used to control the range of the loss function. The trained song recommendation model can realize cross-modal song recommendation.
[0103] In this embodiment, by analyzing the similarity degrees between the song fusion features of the third sample song, the positive sample song corresponding to the third sample song and the negative sample song, the song recommendation model is trained so that the song recommendation model can analyze the similarity degrees between the fusion features of songs, and perform cross-modal song recommendation from the modalities such as audio features and text description features, thereby improving the accuracy of song recommendation.
[0104] In some embodiments, obtaining the third sample song and the positive sample song and the negative sample song corresponding to the third sample song comprises: obtaining a first song set of the first type of operation in the listening behavior data of the first sample user, a second song set of the second type of operation in the listening behavior data of the first sample user, a third song set of the first type of operation in the listening behavior data of the second sample user, and a fourth song set of the second type of operation in the listening behavior data of the second sample user; obtaining the third sample song and the positive sample song from the intersection between the first song set and the second song set; and obtaining the negative sample song from the intersection between the third song set and the fourth song set.
[0105] wherein the first sample user can be any user or user account in a music platform that needs to be recommended songs.
[0106] The listening behavior data can be data representing operations performed by the user on the song. In actual application, the listening behavior data can record specific operations performed by the user on the song.
[0107] The operation type can be information representing specific operations performed by the user on the song in the listening behavior data. The operation type can include a "like" operation, a "dislike" operation, and a "collection" operation.
[0108] The first type can be a "like" operation.
[0109] The first song set can be a song on which the first sample user has performed the first type of operation. In actual application, the first song set can include a song on which the first sample user has added a "like" mark or label in a song database of a music platform.
[0110] The second type can be a "dislike" operation.
[0111] The second song set can be a song on which the first sample user has performed the second type of operation. In actual application, the second song set can include a song on which the first sample user has added a "dislike" mark or label in a song database of a music platform.
[0112] The second sample user can be a user or a user account different from the first sample user in a music platform requiring song recommendation.
[0113] The third song set can be a song on which the second sample user has performed the first type of operation. In actual application, the third song set can include a song on which the second sample user has added a "like" mark or label in a song database of a music platform.
[0114] The fourth song set can be a song on which the second sample user has performed the second type of operation. In actual application, the fourth song set can include a song on which the second sample user has added a "dislike" mark or label in a song database of a music platform.
[0115] As an example, the server can obtain a training set from a large number of user listening histories by collaborative filtering, the training set including a third sample song, a positive sample song corresponding to the third sample song, and a negative sample song. For example, the server obtains a first song set of a first type (such as a “like” operation) in the listening behavior data of a first sample user A, a second song set of a second type (such as a “dislike” operation) in the listening behavior data of the first sample user A, a third song set of the first type (such as a “like” operation) in the listening behavior data of a second sample user B, and a fourth song set of the second type (such as a “dislike” operation) in the listening behavior data of the second sample user B. Then the server can take the intersection between the first song set and the second song set as a positive example set, the server can obtain the third sample song and the positive sample song from the positive example set, and any two songs in the positive example set can be combined as a positive example. Therefore, when an arbitrary song in the positive example set is selected as the third sample song, another arbitrary song in the positive example set can be selected as the positive sample song corresponding to the third sample song. The server can take the intersection between the third song set and the fourth song set as a negative example set, and the server can obtain an arbitrary song from the negative example set as the negative sample song corresponding to the third sample song.
[0116] In this embodiment, the third sample song and the positive sample song and the negative sample song corresponding to the third sample song are selected from the listening history of the sample user, so as to analyze the historical listening behavior of the sample user, obtain a suitable sample, and train the song recommendation model. The song recommendation model can accurately determine whether the song needs to be recommended to the user, thereby improving the accuracy of song recommendation.
[0117] In one exemplary embodiment, a song recommendation method is provided, which includes obtaining a song fusion feature of a candidate song and a song fusion feature of a reference song by a pre-trained song feature extraction model; inputting the song fusion feature of the candidate song and the song fusion feature of the reference song into a pre-trained song recommendation model to obtain a similarity between the song fusion feature of the candidate song and the song fusion feature of the reference song; outputting a song recommendation result according to the similarity between the song fusion feature of the candidate song and the song fusion feature of the reference song and a preset similarity condition; and the song recommendation result representing whether the candidate song is a recommended song recommended to a target object.
[0118] The candidate song can be a song used for the song recommendation model to determine whether it needs to be recommended to the target object.
[0119] The reference song can be a song on which the target object performs a preset type of operation. In actual applications, the reference song can include a song of which the operation type in the listening behavior data of the target object is the preset type (such as a “like” operation, a “collection” operation, or the like).
[0120] The pre-trained song feature extraction model can be trained by using the training method of the song feature extraction model.
[0121] The similarity between the song fusion feature of the candidate song and the song fusion feature of the reference song can be a distance between the song fusion feature of the candidate song and the song fusion feature of the reference song.
[0122] The similarity condition can be information that is set in advance and used to determine whether the candidate song needs to be recommended to the target object. In actual applications, the similarity condition can include that the similarity between the song fusion feature of the candidate song and the song fusion feature of the reference song is greater than a preset similarity threshold.
[0123] The song recommendation result can be information representing whether the candidate song needs to be recommended to the target object. In actual applications, when the song recommendation result represents that the candidate song needs to be recommended to the target object, the candidate song can be used as a recommended song. When the song recommendation result represents that the candidate song does not need to be recommended to the target object, the candidate song cannot be used as a recommended song.
[0124] The recommended song can be a song that needs to be recommended to the target object.
[0125] As an example, when it is necessary to determine whether the candidate song X needs to be recommended to the target object, the server can input the song audio information and the text description information of the candidate song X into the trained song feature extraction model to obtain the song audio feature of the candidate song X and the text description feature of the candidate song X. The server splices the song audio feature of the candidate song X and the text description feature of the candidate song X to obtain the song fusion feature of the candidate song X. Similarly, the server obtains the song fusion feature of a reference song (such as a song collected by the target object) from the listening history data of the target object. Then, the server calculates the distance between the song fusion feature of the candidate song X and the song fusion feature of the reference song to obtain the similarity between the song fusion feature of the candidate song and the song fusion feature of the reference song. When the similarity between the song fusion feature of the candidate song and the song fusion feature of the reference song satisfies a preset similarity condition, the server uses the candidate song as a recommended song recommended to the target object.
[0126] In this embodiment, by analyzing the song fusion features of the candidate song and the song fusion features of the reference song, it is determined whether the candidate song needs to be recommended to the user. In the case of fusing the features in the song audio dimension and the features in the song text information dimension, the song recommendation model can accurately analyze whether the song needs to be recommended to the user, thereby improving the accuracy of song recommendation.
[0127] In some embodiments, as shown in Figure 4 A flowchart for training a song recommendation model is provided. First, the server can pre-train a song feature extraction model to obtain a trained song feature extraction model. Then, the server can filter a training set containing a third sample song, a positive sample song corresponding to the third sample song, and a negative sample song corresponding to the third sample song from the user song listening history data of a first sample user and the user song listening history data of a second sample user using collaborative filtering. The server inputs the third sample song, the positive sample song corresponding to the third sample song, and the negative sample song corresponding to the third sample song into the trained song feature extraction model. The song feature extraction model can process the song audio information through a first branch (model branch 1) to obtain song audio features (such as audio embedding). The song feature extraction model can process the text description information of the song through a second branch (model branch 2) to obtain text description features (such as text embedding). The server concatenates the song audio features and the text description features to obtain song fusion features (such as concatenated embedding or fused embedding). Therefore, the server can determine the song fusion features corresponding to the third sample song (such as A song), the positive sample song (such as A positive example song) and the negative sample song (such as a negative example song) corresponding to the third sample song using the song feature extraction model and the song recommendation model. The server calculates a triplet loss according to the song fusion features corresponding to the third sample song (such as A song), the positive sample song (such as A positive example song) and the negative sample song (such as a negative example song) corresponding to the third sample song, and modifies the model parameters of the song recommendation model according to the function value of the triplet loss until the song recommendation model is trained to obtain a trained song recommendation model.
[0128] In this embodiment, the song recommendation model is trained based on the audio features of the song and combined with the text description information of the song, so that the song recommendation model can more comprehensively and deeply mine the relevance in the song, thereby accurately analyzing whether the song needs to be recommended to the user, and further improving the accuracy of song recommendation.
[0129] It should be understood that although the steps in the flowcharts involved in the embodiments described above are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the embodiments described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or steps or stages in other steps.
[0130] Based on the same inventive concept, the embodiments of the present application also provide a song recommendation model training device for implementing the song recommendation model training method described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more song recommendation model training device embodiments provided below can refer to the limitations of the song recommendation model training method described above, which will not be repeated here.
[0131] In one exemplary embodiment, as shown in Figure 5 A song recommendation model training device is provided, comprising: an extraction model training module 502 and a recommendation model training module 504, wherein:
[0132] The extraction model training module 502 is configured to use the song audio information of the first sample song, the first text description information of the first sample song, and the second text description information of the second sample song as training samples, train a song feature extraction model in a contrast learning manner, and obtain a trained song feature extraction model; wherein the first sample song and the second sample song are different.
[0133] The recommendation model training module 504 is configured to obtain text description features and song audio features of a third sample song through the trained song feature extraction model, splice the text description features of the third sample song and the song audio features of the third sample song through a song recommendation model, obtain song fusion features of the third sample song, and train the song recommendation model using the song fusion features of the third sample song and corresponding positive sample songs and negative sample songs of the third sample song, to obtain a trained song recommendation model.
[0134] In an example embodiment, the extraction model training module 502 is further configured to input the song audio information, the first text description information, and the second text description information into a song feature extraction model to be trained, to obtain a song audio feature of the first sample song, a text description feature of the first sample song, and a text description feature of the second sample song; and train the song feature extraction model according to a first similarity degree between the song audio feature and the text description feature of the first sample song, and a second similarity degree between the song audio feature and the text description feature of the second sample song, to obtain the trained song feature extraction model.
[0135] In an example embodiment, the extraction model training module 502 is further configured to input the song audio information into a first branch of the song feature extraction model to be trained, to obtain the song audio feature of the first sample song; the first branch is an audio feature extraction model; input the first text description information into a second branch of the song feature extraction model to be trained, to obtain the text description feature of the first sample song; the second branch is a text description feature extraction model; and input the second text description information into the second branch of the song feature extraction model to be trained, to obtain the text description feature of the second sample song.
[0136] In an example embodiment, the extraction model training module 502 is further configured to map the song audio information to a first preset space through a first feature mapping network in the first branch, to obtain a mapping feature corresponding to the song audio information; convert the mapping feature corresponding to the song audio information into the song audio feature of the first sample song through a first feature conversion network in the first branch; map the song audio information to a second preset space through a second feature mapping network in the second branch, to obtain a mapping feature corresponding to the first text description information; and convert the mapping feature corresponding to the first text description information into the text description feature of the first sample song through a second feature conversion network in the second branch.
[0137] In an example embodiment, the recommendation model training module 504 is further configured to obtain a song fusion feature of the positive sample song and a song fusion feature of the negative sample song; and train the song recommendation model to be trained according to a third similarity degree between the song fusion feature of the third sample song and the song fusion feature of the positive sample song, and a fourth similarity degree between the song fusion feature of the third sample song and the song fusion feature of the negative sample song, to obtain the trained song recommendation model.
[0138] In an example embodiment, the recommendation model training module 504 is further configured to obtain a first set of songs of a first type from the listening behavior data of the first sample user, a second set of songs of a second type from the listening behavior data of the first sample user, a third set of songs of the first type from the listening behavior data of the second sample user, and a fourth set of songs of the second type from the listening behavior data of the second sample user; obtain the third sample song and the positive sample song from an intersection between the first set of songs and the second set of songs; and obtain the negative sample song from an intersection between the third set of songs and the fourth set of songs.
[0139] The modules in the song recommendation model training apparatus can be implemented in whole or in part by software, hardware, or a combination thereof. The modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in the computer device in software form, so as to be invoked and executed by the processor to perform the operations corresponding to the modules.
[0140] In an example embodiment, a song recommendation apparatus is provided, comprising a feature fusion module, a degree determination module, and a song recommendation module, wherein:
[0141] The feature fusion module is configured to obtain song fusion features of a candidate song and song fusion features of a reference song by using a pre-trained song feature extraction model; the reference song is a song of a preset type from the listening behavior data of a target object; and the pre-trained song feature extraction model is trained by using any of the methods described above.
[0142] The degree determination module is configured to input the song fusion features of the candidate song and the song fusion features of the reference song into a pre-trained song recommendation model to obtain a similarity degree between the song fusion features of the candidate song and the song fusion features of the reference song.
[0143] The song recommendation module is configured to output a song recommendation result according to the similarity degree between the song fusion features of the candidate song and the song fusion features of the reference song and a preset similarity degree condition; and the song recommendation result represents whether the candidate song is recommended to the target object as a recommended song.
[0144] The modules in the song recommendation apparatus can be implemented in whole or in part by software, hardware, or a combination thereof. The modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in the computer device in software form, so as to be invoked and executed by the processor to perform the operations corresponding to the modules.
[0145] In an exemplary embodiment, a computer device, which can be a terminal, is provided, and an internal structure diagram of the computer device can be as shown in FIG. 1. Figure 6 The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to perform wired or wireless communication with external terminals. The wireless communication can be achieved through WIFI, mobile cellular network, NFC (Near Field Communication) or other technologies. The computer program is executed by the processor to implement a song recommendation model training method. The display unit of the computer device is configured to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or can be a key, a trackball or a touchpad arranged on the shell of the computer device, or can be an external keyboard, a touchpad or a mouse, etc.
[0146] Those skilled in the art can understand that Figure 6 The structure shown in the above embodiment is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the diagram, or combine certain components, or have a different arrangement of components.
[0147] In an embodiment, a computer device is also provided, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0148] In an embodiment, a computer readable storage medium is provided, which stores a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.
[0149] In an embodiment, a computer program product is provided, which includes a computer program. The computer program is executed by a processor to implement the steps in the above method embodiments.
[0150] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.
[0151] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, it can include the processes of the above-mentioned embodiments of each method. Any reference to memory, database or other medium used in the embodiments provided by the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided by the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided by the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0152] The technical features of the above embodiments can be combined in any way. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present disclosure.
[0153] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A method for training a song recommendation model, characterized in that, The method comprises: The song audio information of a first sample song, the first text description information of the first sample song, and the second text description information of a second sample song are taken as training samples, a song feature extraction model is trained in a contrast learning manner, and a trained song feature extraction model is obtained; wherein the first sample song is different from the second sample song; Text description features and song audio features of a third sample song are obtained through the trained song feature extraction model, and the text description features of the third sample song and the song audio features of the third sample song are spliced through a song recommendation model to obtain song fusion features of the third sample song; Song fusion features of a positive sample song corresponding to the third sample song and song fusion features of a negative sample song corresponding to the third sample song are obtained; A song recommendation model to be trained is trained according to a third similarity degree between the song fusion features of the third sample song and the song fusion features of the positive sample song, and a fourth similarity degree between the song fusion features of the third sample song and the song fusion features of the negative sample song, to obtain a trained song recommendation model; The method further comprises: A first song set of a first type of operation in listening behavior data of a first sample user, a second song set of a second type of operation in the listening behavior data of the first sample user, a third song set of the first type of operation in listening behavior data of a second sample user, and a fourth song set of the second type of operation in the listening behavior data of the second sample user are obtained; The third sample song and the positive sample song are obtained from an intersection between the first song set and the second song set; The negative sample song is obtained from an intersection between the third song set and the fourth song set.
2. The method of claim 1, wherein, The method of taking the song audio information of a first sample song, the first text description information of the first sample song, and the second text description information of a second sample song as training samples, training a song feature extraction model in a contrast learning manner, and obtaining a trained song feature extraction model comprises: The song audio information, the first text description information, and the second text description information are input into a song feature extraction model to be trained to obtain song audio features of the first sample song, text description features of the first sample song, and text description features of the second sample song; The song feature extraction model is trained according to a first similarity degree between the song audio features and the text description features of the first sample song, and a second similarity degree between the song audio features and the text description features of the second sample song, to obtain the trained song feature extraction model.
3. The method of claim 2, wherein, The inputting the song audio information, the first text description information and the second text description information into the song feature extraction model to be trained comprises: The inputting the song audio information into the first branch of the song feature extraction model to be trained to obtain the song audio feature of the first sample song, wherein the first branch is an audio feature extraction model; The inputting the first text description information into the second branch of the song feature extraction model to be trained to obtain the text description feature of the first sample song, wherein the second branch is a text description feature extraction model; The inputting the second text description information into the second branch of the song feature extraction model to be trained to obtain the text description feature of the second sample song.
4. The method of claim 3, wherein, The inputting the song audio information into the first branch of the song feature extraction model to be trained to obtain the song audio feature of the first sample song; The inputting the first text description information into the second branch of the song feature extraction model to be trained to obtain the text description feature of the first sample song, comprising: mapping the song audio information to a first preset space through a first feature mapping network in the first branch to obtain a mapping feature corresponding to the song audio information; converting the mapping feature corresponding to the song audio information into the song audio feature of the first sample song through a first feature conversion network in the first branch; mapping the song audio information to a second preset space through a second feature mapping network in the second branch to obtain a mapping feature corresponding to the first text description information; converting the mapping feature corresponding to the first text description information into the text description feature of the first sample song through a second feature conversion network in the second branch.
5. A song recommendation method characterized by comprising: The method comprises: obtaining a song fusion feature of a candidate song and a song fusion feature of a reference song through a pre-trained song feature extraction model; the reference song is a song of a preset type in the listening behavior data of a target object; the pre-trained song feature extraction model is trained by the method in any one of claims 1 to 4; inputting the song fusion feature of the candidate song and the song fusion feature of the reference song into a pre-trained song recommendation model to obtain a similarity between the song fusion feature of the candidate song and the song fusion feature of the reference song; outputting a song recommendation result according to the similarity between the song fusion feature of the candidate song and the song fusion feature of the reference song and a preset similarity condition; the song recommendation result represents whether the candidate song is recommended to the target object as a recommended song. 6.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-5 when the computer program is executed by the processor. The processor executes the computer program to implement the steps of the method in any one of claims 1 to 5.
7. A computer-readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 5.
8. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 5.
Citation Information
Patent Citations
Recognition method for multi-mode fused song emotion based on deep study
CN106228977A
Recommendation model training method, song recommendation method and related device
CN115934996A