Song recommendation model training method, song recommendation method and related device
By extracting and aggregating the audio and text features in the target user's playlist, the comparison learning model is trained, and the song recommendation problem that cannot fully utilize cross-modal comparison learning in the existing technology is solved, and end-to-end song recommendation and Better recommended results.
Patent Information
- Application Number
- CN202411532224.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-07
AI Technical Summary
The existing technology cannot fully play the role of cross-modal contrast learning, resulting in the song recommendation model being unable to be used directly. It requires the pre-trained model to extract features for training, and separate the song characterization extraction and recommendation model training.
By extracting and aggregating the audio and text features in the target user's playlist, the comparison loss value is determined, and training based on the comparison learning model is performed to directly generate the song recommendation model.
It realizes end-to-end song recommendations, directly portraying user preference behaviors without subsequent training, and improving the recommendation effect.
Smart Images

Figure CN119397052A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a song recommendation model training method, a song recommendation method and related devices. Background Art
[0002] Existing cross-modal contrastive learning methods can only be used as pre-trained models and cannot be used directly as song recommendation models. The recommendation model needs to be trained using the features extracted by the pre-trained model, so it is a non-end-to-end method. The recommendation model trained in a non-end-to-end manner separates song representation extraction and recommendation model training, and cannot fully play the role of contrastive learning. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide a song recommendation model training method, a song recommendation method and related devices, which solve the technical problem that the conventional technology cannot give full play to the role of comparative learning.
[0004] In order to solve the above technical problems, the present invention provides a song recommendation method, comprising:
[0005] Performing audio feature extraction on the audio corresponding to each song in the target user's playlist to obtain the audio feature corresponding to each song, and performing feature extraction on the song text of the target user's playlist to obtain the target text feature corresponding to the target user's playlist;
[0006] Aggregate multiple audio features in the target user's playlist to obtain target audio features corresponding to the target user's playlist; wherein the aggregation process is a processing method that can obtain overall features that simultaneously characterize multiple audio features after processing multiple audio features;
[0007] The target text features and the target audio features are used to determine a contrast loss value, and a contrast learning model is trained according to the contrast loss value to obtain a target song recommendation model; wherein the goal of the contrast learning model is that the distance in space between audio features and text features belonging to the same user playlist is smaller than the distance in space between audio features and text features that do not belong to the same user playlist.
[0008] Optionally, the target user playlist includes at least one of a favorite playlist, a completed playlist, and a listening time playlist; wherein the listening time playlist is a playlist with a listening time greater than a preset time threshold.
[0009] Optionally, the method further includes:
[0010] Perform dimensionality reduction processing on the audio features corresponding to each song to obtain dimensionality-reduced audio features;
[0011] The aggregating multiple audio features in the target user's playlist to obtain a target audio feature corresponding to the target user's playlist includes:
[0012] Aggregate multiple dimensionality-reduced audio features in the target user's playlist to obtain target audio features corresponding to the target user's playlist;
[0013] The method further comprises:
[0014] Performing dimensionality reduction processing on the target text feature to obtain the target reduced-dimensionality text feature;
[0015] The determining of the contrast loss value by using the target text feature and the target audio feature includes:
[0016] The contrast loss value is determined using the target reduced-dimensionality text feature and the target audio feature.
[0017] Optionally, feature extraction is performed on the song text of the target user's song list to obtain target text features corresponding to the target user's song list, including:
[0018] Counting the song texts in the target user's playlist to determine target text information; wherein the target text information includes at least one of the proportion of each singer, the proportion of each language, the proportion of each genre, the album region, and the song rhythm;
[0019] Feature extraction is performed on the target text information to obtain the target text features corresponding to the target user's playlist.
[0020] Optionally, the number of the target user playlists is at least two, and each of the target user playlists constitutes a target playlist set; determining a contrast loss value using the target text feature and the target audio feature, and training a contrast learning model according to the contrast loss value to obtain a target song recommendation model, including:
[0021] The target dimension-reduced audio features and the first target dimension-reduced text features corresponding to the first target user's playlist are taken as positive samples;
[0022] The second target reduced-dimensionality text features corresponding to the second target user's playlist and the target reduced-dimensionality audio features corresponding to the first target user are used as negative samples; wherein the second target user's playlist and the first target user's playlist both belong to the target playlist set;
[0023] Determining a first distance between features corresponding to the positive samples, and determining a second distance between features corresponding to the negative samples;
[0024] Determine the contrast loss value when the first distance is smaller than the second distance, and use the parameters corresponding to the contrast loss value as the parameters of the contrast learning model to obtain the target song recommendation model.
[0025] Optionally, audio features are extracted from the audio corresponding to each song in the target user's playlist to obtain audio features corresponding to each song, including:
[0026] The music audio understanding model is used to extract audio features from the audio in the target user's playlist to obtain the audio features.
[0027] Optionally, before extracting audio features from the audio corresponding to each song in the target user's playlist to obtain the audio features corresponding to each song, the method further includes:
[0028] Determine whether the length of the songs in the current playlist is greater than a preset length threshold; wherein the length of the songs in the playlist is determined according to the number of songs;
[0029] When the length of the songs in the current playlist is greater than the preset length threshold, determining to use the current playlist as the target user playlist;
[0030] When the length of the songs in the current playlist is not greater than the preset length threshold, it is determined to remove the current playlist.
[0031] The present application also provides a song recommendation method, comprising:
[0032] Obtaining songs to be recommended, and determining predicted audio features of the songs to be recommended using a target song recommendation model; wherein the target song recommendation model is a model obtained by the song recommendation model training method described above;
[0033] Calculating a plurality of recommended distances between the predicted audio feature and text features corresponding to the playlists of a plurality of user objects, and selecting a target recommended distance that meets a distance condition from the plurality of recommended distances;
[0034] The user corresponding to the target recommendation distance is taken as the target recommendation object for song recommendation.
[0035] Optionally, selecting a target recommended distance that meets the distance condition from the multiple recommended distances includes:
[0036] Determine whether the current recommended distance is greater than a preset recommended distance threshold;
[0037] When the current recommended distance is greater than the preset recommended distance threshold, taking the current recommended distance as the target recommended distance;
[0038] When the current recommended distance is not greater than the preset recommended distance threshold, the current recommended distance is eliminated.
[0039] The present application also provides a song recommendation model training device, comprising:
[0040] A feature extraction module is used to extract audio features from the audio corresponding to each song in the target user's playlist to obtain audio features corresponding to each song, and to extract features from the song text of the target user's playlist to obtain target text features corresponding to the target user's playlist;
[0041] A processing module, used to aggregate multiple audio features in the target user's playlist to obtain target audio features corresponding to the target user's playlist; wherein the aggregation processing is a processing method that can obtain overall features that simultaneously characterize multiple audio features after processing multiple audio features;
[0042] A model training module is used to determine a contrast loss value using the target text features and the target audio features, and train a contrast learning model based on the contrast loss value to obtain a target song recommendation model; wherein the goal of the contrast learning model is that the distance in space between audio features and text features belonging to the same user playlist is smaller than the distance in space between audio features and text features that do not belong to the same user playlist.
[0043] The present application also provides a song recommendation device, comprising:
[0044] A predicted audio feature determination module, used to obtain songs to be recommended, and determine the predicted audio features of the songs to be recommended using a target song recommendation model; wherein the target song recommendation model is a model obtained according to the song recommendation model training method described above;
[0045] A recommended distance determination module, used to calculate a plurality of recommended distances between the predicted audio feature and text features corresponding to the playlists of a plurality of user objects, and select a target recommended distance that meets a distance condition from the plurality of recommended distances;
[0046] The recommendation module is used to recommend songs to users corresponding to the target recommendation distance as target recommendation objects.
[0047] The present application also provides an electronic device, including:
[0048] Memory for storing computer programs;
[0049] A processor is used to implement the steps of the above method when executing the computer program.
[0050] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.
[0051] A computer program product comprises a computer program / instruction, wherein the computer program / instruction implements the steps of the above method when executed by a processor.
[0052] It can be seen that the present invention obtains the audio features corresponding to each song in the target user's playlist by performing audio feature extraction on the audio corresponding to each song, and obtains the target text features corresponding to the target user's playlist by performing feature extraction on the song text of the target user's playlist; performs aggregation processing on multiple audio features in the target user's playlist to obtain the target audio features corresponding to the target user's playlist; wherein the aggregation processing is a processing method that can obtain the overall features that simultaneously characterize multiple audio features after processing multiple audio features; determines the contrast loss value using the target text features and the target audio features, and trains the contrast learning model according to the contrast loss value to obtain the target song recommendation model; wherein the goal of the contrast learning model is that the distance in space between the audio features and the text features belonging to the same user's playlist is smaller than the distance in space between the audio features and the text features that do not belong to the same user's playlist. Compared with the current recommendation model that needs to be trained using the features extracted by the pre-trained model and cannot directly use the trained contrastive learning model to achieve song recommendation in a non-end-to-end manner, the beneficial effects of the present invention are: introducing user behavior (the target user playlist corresponding to each user) and song cross-modal information (audio features and text features) into the contrastive learning framework at the same time, the trained contrastive learning model can directly characterize the user's preference behavior without the need for subsequent training, thereby achieving end-to-end song recommendation and achieving better results.
[0053] In addition, the present invention also provides a song recommendation model training device, equipment and computer-readable storage medium, a song recommendation method, device, equipment and computer-readable storage medium, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0055] Figure 1 A flowchart of a song recommendation model training method provided by an embodiment of the present invention;
[0056] Figure 2 A flowchart of a song recommendation model training method provided by an embodiment of the present invention;
[0057] Figure 3 A schematic diagram of a framework of a song recommendation model training method provided by an embodiment of the present invention;
[0058] Figure 4 A flowchart of a song recommendation method provided by an embodiment of the present invention;
[0059] Figure 5 A structural schematic diagram of a song recommendation model training device provided by an embodiment of the present invention;
[0060] Figure 6 A structural schematic diagram of a song recommendation device provided by an embodiment of the present invention;
[0061] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0063] Please refer to Figure 1 , Figure 1 A flowchart of a song recommendation model training method provided by an embodiment of the present invention. The method may include:
[0064] S101, extract audio features from the audio corresponding to each song in the target user's playlist to obtain audio features corresponding to each song, and extract features from the song text in the target user's playlist to obtain target text features corresponding to the target user's playlist.
[0065] The execution subject in this embodiment is an electronic device. This embodiment does not limit the specific electronic device. For example, the electronic device in this embodiment may be a computer; or the electronic device in this embodiment may be a mobile phone; or the electronic device in this embodiment may also be a server.
[0066] This embodiment does not limit the specific target user song list, as long as it is a song list set by the user according to his or her own needs. For example, the target user song list in this embodiment can be a song list collected by user A and a song list collected by user B; or the target user song list in this embodiment can be a song list of user A's finished play list, which refers to a song list that has been added and has been played, as well as a song list of user B's finished play list. In this embodiment, there are multiple target user song lists, and the target user song list includes song lists corresponding to multiple users. In this embodiment, each user can correspond to one song list, and each user can also correspond to multiple song lists, because each user can like multiple types of songs, and a song list corresponding to each user can be used as a target user song list.
[0067] The audio in this embodiment is sound. This embodiment does not limit the specific method of extracting audio features from the audio corresponding to each song. For example, this embodiment can use the MERT (Music Audio Understanding Model for Self-supervised Learning) model to extract audio features. MERT uses large-scale unlabeled music data for training, reducing the reliance on manual labeling, thereby reducing the application cost. This self-supervised learning method not only improves the learning efficiency of the model, but also enhances its versatility in various tasks; or this embodiment can also use the MULE (Musicset Unsupervised Large Embedding) model to extract audio features. When extracting audio features in this embodiment, the extraction is performed on a song-by-song basis. The song text in this embodiment can be text data after statistics. For example, the song text in this embodiment can be at least one of singer information, language information, genre information, album region information, and song rhythm soothing information. The song text in this embodiment is lyrics. This embodiment does not limit the specific method of extracting text features. For example, the method for extracting text features in this embodiment may be to use the BERT (Bidirectional Encoder Representations from Transformers, natural language processing model) model for extraction. BERT uses bidirectional encoding and can simultaneously consider the contextual information of words. This bidirectionality enables BERT to understand the context of the language more comprehensively; or the method for extracting text features in this embodiment may also be to use the RoBert (Robustly Optimized BERT Approach, improved natural language processing model) model for extraction. The RoBert model is an improved natural language processing model based on BERT (Bidirectional Encoder Representations from Transformers), which improves the performance and generalization ability of the model by adopting robust optimization technology. On the basis of maintaining the original advantages of BERT, the RoBert model further enhances the adaptability and stability of the model, so that it can show better performance when facing various noise data and uncertainties. When extracting text features, this embodiment can perform unified feature extraction on the text features of all playlists in the target user's playlist to obtain text features.
[0068] It should be further explained that in order to improve the accuracy of the target user's song list acquisition, the target user's song list includes at least one of a favorite song list, a finished song list, and a song listening time song list; wherein, the song listening time song list is a song list whose listening time is longer than a preset time threshold. The favorite song list in this embodiment refers to the user adding a song list created by others to his favorites for future listening, but does not have the editing authority to the song list. In this embodiment, the finished song list refers to the user listening to each song in the song list at least once in its entirety, thereby increasing the amount of playback of the song list. In this embodiment, a complete playback can be considered as an effective playback only when the playback time of a song exceeds the preset playback time (usually more than one minute). The song listening time song list in this embodiment means that when the user plays the songs in the song list, only when the playback time of each song exceeds the preset time threshold (usually 30 seconds or one minute), it will be counted in the playback statistics. By providing multiple target user song lists, this embodiment makes the acquisition of the target user song list more accurate and comprehensive during training.
[0069] It should be further explained that, in order to improve the accuracy of determining text features, the above-mentioned feature extraction of the song text of the target user's playlist to obtain the target text features corresponding to the target user's playlist may include:
[0070] S1011, collect statistics on the song texts in the target user's playlist to determine target text information; wherein the target text information includes at least one of the proportion of each singer, the proportion of each language, the proportion of each genre, the album region and the song rhythm.
[0071] S102, extracting features from the target text information to obtain text features corresponding to the target user's playlist.
[0072] In this embodiment, statistics are made on the song texts in the target user's song list, which means that statistics are made on the lyrics texts preferred by the user in the table of all the song texts in the target user's song list. In this embodiment, the lyrics texts preferred by the user in the table may include at least one of the proportion of each singer, the proportion of each language, the proportion of each genre, the album region and the rhythm of the song. When determining the target text information, this embodiment can process the various preferred lyrics texts obtained according to a certain rule to obtain the target text information. For example, the text information of the three aspects of singer, language and genre can be used to count the proportion of each singer, the proportion of each language and the proportion of each genre in the user's song list. The text is constructed as "the proportion of xx singer in the user's song list is xx, the proportion of xx singer is xx, ..., the proportion of xx language is xx, the proportion of xx language is xx, ..., the proportion of xx genre is xx, the proportion of xx genre is xx, ...", and the constructed text is used to input the text feature extraction model to extract text features. This embodiment extracts features of the target text information determined by statistically analyzing the song text, so that the obtained text features are more accurate, and because the text is reduced during the text feature extraction, the efficiency of text feature extraction can be improved.
[0073] It should be further explained that in order to improve the accuracy of determining the target user's song list, so as to accurately analyze the user's preference, before extracting the audio features corresponding to each song in the target user's song list and obtaining the audio features corresponding to each song, it may also include: judging whether the song length of the current song list is greater than the preset length threshold; wherein the song length of the song list is determined according to the number of songs; when the song length of the current song list is greater than the preset length threshold, determining to use the current song list as the target user's song list; when the song length of the current song list is not greater than the preset length threshold, determining to remove the current song list. The target user's song list in this embodiment is any one of the multiple target user's song lists. This embodiment does not limit the specific preset length threshold. For example, the preset length threshold in this embodiment may be 10 songs; or the preset threshold in this embodiment may be 15 songs. It is understandable that when the songs in the song list are too short, the user's preference cannot be accurately expressed. When the song length of the current song list is greater than the preset length threshold, the song list is user behavior data with high confidence. This embodiment screens the song list by the preset length threshold to determine that the song list can accurately express the user's song preference.
[0074] S102, aggregate multiple audio features in the target user's playlist to obtain target audio features corresponding to the target user's playlist; wherein, the aggregation processing is a processing method that can obtain overall features that simultaneously characterize multiple audio features after processing multiple audio features.
[0075] This embodiment does not limit the specific way of performing the aggregation processing. For example, this embodiment can perform mean processing on multiple audio features in the target user's song list to obtain the target audio features corresponding to the target user's song list; in this embodiment, each song in the target user's song list corresponds to an initial dimensionality reduction audio feature. In order to characterize the audio features of the entire target user's song list, it is necessary to perform mean processing on multiple initial dimensionality reduction audio features to obtain the target dimensionality reduction audio features corresponding to the target user's song list. In this embodiment, performing mean processing on multiple initial dimensionality reduction audio features in the target user's song list means summing up multiple initial dimensionality reduction audio features to obtain the summed result, and dividing the summed result by the number of audios in the target user's song list. Or this embodiment can determine the audio feature with the most audio features among multiple audio features in the target user's song list as the target audio feature corresponding to the target user's song list.
[0076] S103, using the target text features and the target audio features to determine the contrast loss value, and training the contrast learning model according to the contrast loss value to obtain a target song recommendation model; wherein the goal of the contrast learning model is to ensure that the distance in space between audio features and text features belonging to the same user playlist is smaller than the distance in space between audio features and text features that do not belong to the same user playlist.
[0077] In this embodiment, the same user playlist refers to the A playlist belonging to user A, that is, a playlist of a certain user. In this embodiment, not belonging to the same user playlist means that the B playlist belongs to user B and the A playlist belongs to user A. In this case, the A playlist and the B playlist do not belong to the same user playlist. Or in this embodiment, the A playlist of user A belongs to the m style and the B playlist of user A belongs to the n style. In this case, the A playlist and the B playlist of user A can also be regarded as not belonging to the same user playlist.
[0078] It should be further explained that in order to improve the efficiency of determining the contrast loss value, the above method may also include: performing dimensionality reduction processing on the audio features corresponding to each song to obtain the dimensionality reduction audio features; accordingly, aggregating multiple audio features in the target user's song list to obtain the target audio features corresponding to the target user's song list, which may include: aggregating multiple dimensionality reduction audio features in the target user's song list to obtain the target audio features corresponding to the target user's song list; performing dimensionality reduction processing on the target text features to obtain the target dimensionality reduction text features; using the target text features and the target audio features to determine the contrast loss value, which may include: using the target dimensionality reduction text features and the target audio features to determine the contrast loss value. This embodiment does not limit the specific method of dimensionality reduction processing of audio features and text features, for example, it can be MLP (Multi-Layer Perceptron); or it can also be a principal component analysis method. It should be further explained that when MLP is used for dimensionality reduction processing, the multilayer perceptron has a strong nonlinear processing capability and good adaptability in dimensionality reduction processing, and can capture complex relationships in data through its multi-layer structure and nonlinear activation function. It is understandable that the dimensions of the initial dimensionality reduction audio features and the target dimensionality reduction audio features in this embodiment are consistent. This embodiment can remove redundant information and retain key features through dimensionality reduction processing, thereby improving the training speed and prediction efficiency of the model.
[0079] In this embodiment, the process of determining the contrast loss value using the target dimension reduction text feature and the target dimension reduction audio feature can be to determine the contrast loss function (to ensure that in the space after dimension reduction, the feature vectors of the same category (such as the audio and text describing the same playlist) are close to each other, while the feature vectors of different categories are far away from each other), determine the contrast loss value through the contrast loss function, and when determining the contrast loss value, the contrast loss function can be minimized to make the similarity within the audio and text belonging to the same target user playlist high, and the similarity between the audio and text belonging to different target user playlists low, and iteratively update the model parameters to minimize the loss value to obtain the contrast loss value. The core of the contrast learning model in this embodiment is to construct positive sample pairs and negative sample pairs, and make the distance between the positive sample pairs smaller than the distance between the negative sample pairs through learning. This embodiment does not limit the specific contrast learning model, and the contrast learning model in this embodiment can be an unsupervised learning model; or the contrast learning model in this embodiment can also be a self-supervised learning model. This embodiment does not limit the specific method for determining the distance in space. For example, the method for determining the distance in space in this embodiment can be a metric method such as cosine similarity or Euclidean distance. In this embodiment, the contrastive learning model is trained according to the contrastive loss value to obtain the target song recommendation model, which means that the similarity between the audio and text features after dimensionality reduction is calculated according to the distance in space, and by minimizing the contrastive loss value, the similarity within the same modality is high and the similarity between different modalities is low, that is, the distance between the audio features and text features of the same playlist in space is smaller than the distance between the audio features and text features of different playlists in space, thereby iteratively updating the contrastive learning model parameters to minimize the contrastive loss value.
[0080] It should be further explained that, in order to improve the accuracy of determining the contrast loss value, the number of the target user playlists is at least two, and each target user playlist constitutes a target playlist set; determining the contrast loss value using the target text features and the target audio features, and training the contrast learning model according to the contrast loss value to obtain the target song recommendation model may include:
[0081] S1041, taking the target dimensionality reduction audio features and the first target dimensionality reduction text features corresponding to the first target user playlist as positive samples.
[0082] S1042, taking the second target dimensionality reduction text features corresponding to the second target user's playlist and the target dimensionality reduction audio features corresponding to the first target user as negative samples; wherein the second target user's playlist and the first target user's playlist both belong to the target playlist set.
[0083] S1043, determining a first distance between features corresponding to the positive samples, and determining a second distance between features corresponding to the negative samples.
[0084] S1044, determining the contrast loss value when the first distance is smaller than the second distance, and using the parameters corresponding to the contrast loss value as the parameters of the contrast learning model to obtain the target song recommendation model.
[0085] In this embodiment, the first target user playlist and the second target user playlist refer to two different target user playlists in the target user playlist. In this embodiment, the target dimension reduction audio features and target dimension reduction text features corresponding to the same target user playlist are used as positive samples. When the target dimension reduction audio features and target dimension reduction text features belong to different users, the target dimension reduction audio features and target dimension reduction text features are used as negative samples. The dot product in this embodiment refers to the product of two vectors in Euclidean space, and the result is a scalar (i.e., a single value). For example, the contrast loss function model is ; is the contrast loss value corresponding to the current target dimensionality reduction audio feature, m is the parameter that controls the range of the loss function (generally 1 to positive infinity), k+ is the target dimensionality reduction text feature corresponding to the current target dimensionality reduction audio feature, k i is the reduced dimension text feature of other playlists (not the playlist corresponding to the current target reduced dimension audio feature), q is the target reduced dimension audio feature, the denominator is the sum of the dot products of all positive examples (positive samples) and all negative examples (negative samples), q and k + Belonging to the same playlist as a pair of positive examples, q and k i Belonging to different playlists as negative examples. This embodiment trains the contrast loss function by taking the target dimensionality reduction audio features and target dimensionality reduction text features corresponding to the same target user playlist as positive samples, and the target dimensionality reduction audio features and target dimensionality reduction text features that do not belong to the same target user playlist as negative samples (i.e., the target dimensionality reduction audio features belong to the features corresponding to the first target user playlist, and the target dimensionality reduction text features belong to the features corresponding to the second user playlist), and obtains a contrast loss value that can make the first distance smaller than the second distance, so that the distance in space between the audio features and text features of the same playlist is smaller than the distance in space between the audio features and text features of different playlists, so that the model can learn the user's behavioral preferences.
[0086] A flowchart of a song recommendation model training method provided by an embodiment of the present invention may include: S101, extracting audio features from the audio corresponding to each song in the target user's playlist to obtain the audio features corresponding to each song, and extracting features from the song texts in the target user's playlist to obtain target text features corresponding to the target user's playlist; S102, performing aggregation processing on multiple audio features in the target user's playlist to obtain target audio features corresponding to the target user's playlist; wherein the aggregation processing is a processing method that can obtain overall features that simultaneously characterize multiple audio features after processing multiple audio features; S103, determining a contrast loss value using target text features and target audio features, and training a contrast learning model based on the contrast loss value to obtain a target song recommendation model; wherein the goal of the contrast learning model is that the distance in space between audio features and text features belonging to the same user's playlist is smaller than the distance in space between audio features and text features that do not belong to the same user's playlist. Compared with the current recommendation model that needs to be trained using features extracted from a pre-trained model to achieve song recommendation in a non-end-to-end manner, the beneficial effect of the present invention is that user behavior (the target user playlist corresponding to each user is used as user behavior data) and song cross-modal information (audio features and text features) are simultaneously introduced into the contrastive learning framework, and the trained contrastive learning model (target song recommendation model) can directly characterize the user's preference behavior without the need for subsequent training, thereby achieving end-to-end song recommendation and achieving better results.
[0087] In order to make the present invention easier to understand, please refer to Figure 2 , Figure 2 A flow chart of a song recommendation model training method provided by an embodiment of the present invention may specifically include:
[0088] S201, obtain multiple initial playlists corresponding to multiple users, and filter the initial playlists according to the number of songs to obtain multiple target user playlists.
[0089] In this embodiment, each user corresponds to a target user song list. Multiple target user song lists constitute a set of target user song lists required for training.
[0090] S202, input each song in the target user's playlist into the music audio understanding model to extract multiple audio features.
[0091] S203, using a multi-layer perceptron to perform dimensionality reduction processing on the multiple audio features to obtain reduced-dimensional audio features.
[0092] S204, performing mean processing on multiple dimensionality reduction audio features to obtain target dimensionality reduction audio features corresponding to the target user's playlist.
[0093] S205, counting the song texts of the target user's playlist to determine the target text information; wherein each text dimension information includes the proportion of each singer, the proportion of each language, and the proportion of each genre.
[0094] S206, extracting features of the target text information, and inputting the extracted text features into a multi-layer perceptron to obtain target dimension-reduced text features.
[0095] S207, using the target reduced dimensionality audio features and the target reduced dimensionality text features to determine the contrast loss value, and training the contrast learning model according to the contrast loss value to obtain a target song recommendation model; wherein the goal of the contrast learning model is to ensure that the distance in space between audio features and text features belonging to the same target user playlist is smaller than the distance in space between audio features and text features that do not belong to the same target user playlist.
[0096] In order to introduce user behavior information, the modeling dimension adopted by the embodiment of the present invention is multiple songs. Each individual (user) here corresponds to a target user playlist. The songs in these target user playlists are songs collected by the user, and the text description is a summary description of the playlist. For example, the existing comparative learning method describes the genre of a song as: change the genre of the song to punk. The summary description of the playlist used in this case is: 60% of the user's favorite songs are punk and 40% are rock. In this way, the learning goal of comparative learning is transformed from the correlation between songs and texts to the description of song preference playlists and preferences. The trained comparative learning model can directly characterize the user's preference behavior without the need for subsequent training.
[0097] In order to make the present invention easier to understand, please refer to Figure 3 , Figure 3A framework schematic diagram of a song recommendation model training method provided for an embodiment of the present invention may specifically include: Step 1: Obtain a user favorite song list corresponding to each user (the user favorite song list corresponding to each user in this embodiment is used as a target user song list), use MERT to extract features from the song audio in each user's favorite song list to obtain audio features, use an MLP module to reduce the dimension of the audio features to obtain reduced-dimensional audio features, and calculate the mean of all reduced-dimensional audio features in each favorite song list to obtain target reduced-dimensional audio features; summarize the song text description information of each user's favorite song list to obtain target text information, use a BERT model to extract features from the target text information to obtain target text features, use an MLP model to reduce the dimension of the target text features to obtain target reduced-dimensional text features, and construct positive and negative examples using the target reduced-dimensional audio features and target text features according to different users, use the target reduced-dimensional audio features and target text features in the favorite song list of the same user as positive examples, and use the target reduced-dimensional audio features and target text features corresponding to different users as negative examples, thereby hiding the behavior description of each user and comparing the learning model, so that the model can remember the behavior preferences of each user.
[0098] The present invention proposes a song recommendation model training method based on cross-modal contrastive learning, which not only integrates the features of two modalities, song audio and song text characteristics, but also introduces user behavior (text features of each user) into the contrastive learning framework, thereby realizing an end-to-end contrastive learning recommendation system. It can improve the performance of the current non-end-to-end contrastive learning recommendation model and provide users with a better song listening experience.
[0099] In order to make the present invention easier to understand, please refer to Figure 4 , Figure 4 A flowchart of a song recommendation method provided by an embodiment of the present invention may specifically include:
[0100] S401, obtaining songs to be recommended, and using a target song recommendation model to determine predicted audio features of the songs to be recommended; wherein the target song recommendation model is a model obtained according to the above-mentioned song recommendation model training method.
[0101] The executor of this embodiment is an electronic device. The electronic device in this embodiment may be a computer; or the electronic device in this embodiment may be a server. The songs to be recommended in this embodiment are songs that have not yet been recommended according to the target song recommendation model provided by the embodiment of the present invention. This embodiment can directly use the model obtained by the above song recommendation model training method to extract audio features from the audio of the songs to be recommended to obtain predicted audio features.
[0102] S402, calculating a plurality of recommended distances between the predicted audio features and the text features corresponding to the playlists of a plurality of user objects, and selecting a target recommended distance that meets the distance condition from the plurality of recommended distances.
[0103] The text features corresponding to the playlists of multiple user objects in this embodiment are the text features used in the training process of the song recommendation model mentioned above, and there is no need to re-extract them. This embodiment does not limit the specific method for determining the distance between the predicted audio features and the text features. For example, the method for determining the distance between the predicted audio features and the text features in this embodiment may be a measurement method such as cosine similarity or Euclidean distance. In this embodiment, multiple recommended distances can be obtained by calculating the distance between the predicted audio features corresponding to the songs to be recommended and the text features of each user. This embodiment does not limit the specific method for determining the distance condition. For example, this embodiment may directly use the distance where the recommended distance is greater than the preset recommended distance as the distance condition; or this embodiment may also use the distance where the recommended distance is greater than the preset recommended distance and the user's listening frequency is higher than the preset frequency threshold as the distance condition. The preset recommendation frequency is considered because users with a high music frequency can listen to songs in a timely manner, thereby improving the success rate of song recommendations.
[0104] S403, taking the user corresponding to the target recommendation distance as the target recommendation object for song recommendation.
[0105] This embodiment directly uses the user corresponding to the text feature corresponding to the target recommendation distance as the target recommendation object, thereby performing song recommendations based on the target recommendation object. It is understandable that in order to improve the success rate of recommendation, when determining the target recommendation object corresponding to the target recommendation distance, this embodiment can analyze the time when the target recommendation object turns on the music playback device, determine the high-frequency opening time (the high-frequency is the frequency greater than the preset frequency threshold), and recommend the songs to be recommended during the high-frequency opening time, so that users can pay attention to the songs to be recommended in time, thereby improving the effect of song recommendation.
[0106] It should be further explained that, in order to improve the effect of recommendation, selecting a target recommended distance that meets the distance condition from multiple recommended distances may include: determining whether the current recommended distance is greater than a preset recommended distance threshold; when the current recommended distance is greater than the preset recommended distance threshold, using the current recommended distance as the target recommended distance; when the current recommended distance is not greater than the preset recommended distance threshold, eliminating the current recommended distance. This embodiment determines the target recommended distance by directly comparing the recommended distance between the preset recommended song and the corresponding text feature of each user with the preset recommended distance threshold (distance condition), so that the target recommended distance can be quickly determined.
[0107] The song recommendation model in the embodiment of the present invention is a model trained according to the above-mentioned song recommendation model training method, that is, the trained contrastive learning model can be directly used as the song recommendation model without additional training, thereby realizing an end-to-end contrastive learning recommendation system, which can improve the performance of the current non-end-to-end contrastive learning recommendation model and provide users with a better song listening experience.
[0108] The song recommendation model training device provided in an embodiment of the present invention is introduced below. The song recommendation model training device described below and the song recommendation model training method described above can be referenced to each other.
[0109] Please refer to Figure 5 , Figure 5 A structural diagram of a song recommendation model training device provided by an embodiment of the present invention may include:
[0110] The feature extraction module 100 is used to extract audio features from the audio corresponding to each song in the target user's playlist to obtain audio features corresponding to each song, and to extract features from the song text of the target user's playlist to obtain target text features corresponding to the target user's playlist;
[0111] The processing module 200 is used to aggregate the multiple audio features in the target user's playlist to obtain the target audio features corresponding to the target user's playlist; wherein the aggregation processing is a processing method that can obtain the overall features that simultaneously characterize the multiple audio features after processing the multiple audio features;
[0112] The model training module 300 is used to determine the contrast loss value using the target text features and the target audio features, and train the contrast learning model according to the contrast loss value to obtain a target song recommendation model; wherein the goal of the contrast learning model is that the distance in space between the audio features and text features belonging to the same user playlist is smaller than the distance in space between the audio features and text features that do not belong to the same user playlist.
[0113] Further, based on the above embodiment, the above-mentioned target user playlist includes at least one of a favorite playlist, a completed playlist and a listening time playlist; wherein, the listening time playlist is a playlist with a listening time greater than a preset time threshold.
[0114] Further, based on any of the above embodiments, the song recommendation model training device may further include:
[0115] An audio feature dimensionality reduction processing module is used to perform dimensionality reduction processing on the audio features corresponding to each song to obtain dimensionality-reduced audio features;
[0116] The processing module 200 includes:
[0117] An aggregation processing unit, used for performing aggregation processing on a plurality of dimensionality reduction audio features in the target user's song list to obtain a target audio feature corresponding to the target user's song list;
[0118] A text feature dimensionality reduction processing module is used to perform dimensionality reduction processing on the target text feature to obtain the target reduced-dimensionality text feature;
[0119] The model training module 300 includes:
[0120] A model training unit is used to determine a contrast loss value using the target reduced-dimensionality text feature and the target audio feature.
[0121] Further, based on any of the above embodiments, the feature extraction module 100 may include:
[0122] A target text information determination unit, configured to collect statistics on the song texts in the target user's playlist to determine target text information; wherein the target text information includes at least one of the proportion of each singer, the proportion of each language, the proportion of each genre, the album region, and the song rhythm;
[0123] A text feature extraction unit is used to extract features from the target text information to obtain the target text features corresponding to the target user's playlist.
[0124] Further, based on any of the above embodiments, the above model training module 300 may include:
[0125] A positive sample determination unit, configured to use the target dimensionality reduction audio feature and the first target dimensionality reduction text feature corresponding to the first target user playlist as positive samples;
[0126] A negative sample determination unit, configured to use a second target dimensionality reduction text feature corresponding to a second target user's playlist and a target dimensionality reduction audio feature corresponding to the first target user as negative samples; wherein the second target user's playlist and the first target user's playlist both belong to the target playlist set;
[0127] a distance determining unit, configured to determine a first distance between features corresponding to the positive samples, and to determine a second distance between features corresponding to the negative samples;
[0128] The target song recommendation module determination unit is used to determine the contrast loss value when the first distance is smaller than the second distance, and use the parameters corresponding to the contrast loss value as the parameters of the contrast learning model to obtain the target song recommendation model.
[0129] Further, based on any of the above embodiments, the feature extraction module 100 may include:
[0130] The feature extraction unit is used to extract audio features from the audio in the target user's playlist using a music audio understanding model to obtain the audio features.
[0131] Further, based on any of the above embodiments, the song recommendation model training device may further include:
[0132] A judgment module, used to judge whether the length of the songs in the current playlist is greater than a preset length threshold; wherein the length of the songs in the playlist is determined according to the number of songs;
[0133] A target user song list determination module, used to determine that the current song list is used as the target user song list when the length of the songs in the current song list is greater than the preset length threshold;
[0134] The elimination module is used to determine to eliminate the current playlist when the length of the songs in the current playlist is not greater than the preset length threshold.
[0135] It should be noted that the order of the modules and units in the above-mentioned song recommendation model training device can be changed without affecting the logic.
[0136] The song recommendation model training device provided by the embodiment of the present invention may include: a feature extraction module 100, which is used to extract audio features from the audio corresponding to each song in the target user's playlist to obtain the audio features corresponding to each song, and to extract features from the song text of the target user's playlist to obtain the target text features corresponding to the target user's playlist; a processing module 200, which is used to aggregate multiple audio features in the target user's playlist to obtain the target audio features corresponding to the target user's playlist; wherein the aggregation processing is a processing method that can obtain overall features that simultaneously characterize multiple audio features after processing multiple audio features; a model training module 300, which is used to determine a contrast loss value using the target text features and the target audio features, and train a contrast learning model based on the contrast loss value to obtain a target song recommendation model; wherein the goal of the contrast learning model is that the distance in space between audio features and text features belonging to the same user's playlist is smaller than the distance in space between audio features and text features that do not belong to the same user's playlist. Compared with the current recommendation model that needs to be trained using features extracted from a pre-trained model to achieve song recommendation in a non-end-to-end manner, the beneficial effect of the present invention is that user behavior (the target user playlist corresponding to each user is used as user behavior data) and song cross-modal information (audio features and text features) are simultaneously introduced into the contrastive learning framework, and the trained contrastive learning model (target song recommendation model) can directly characterize the user's preference behavior without the need for subsequent training, thereby achieving end-to-end song recommendation and achieving better results.
[0137] The song recommendation device provided by the embodiment of the present invention is introduced below. The song recommendation device described below and the song recommendation method described above can be referred to each other.
[0138] Please refer to Figure 6 , Figure 6 A structural diagram of a song recommendation device provided by an embodiment of the present invention may include:
[0139] The predicted audio feature determination module 400 is used to obtain songs to be recommended and determine the predicted audio features of the songs to be recommended using a target song recommendation model; wherein the target song recommendation model is a model obtained according to the song recommendation model training method described above;
[0140] A recommended distance determination module 500 is used to calculate a plurality of recommended distances between the predicted audio feature and text features corresponding to the playlists of a plurality of user objects, and select a target recommended distance that meets a distance condition from the plurality of recommended distances;
[0141] The recommendation module 600 is used to recommend songs to users corresponding to the target recommendation distance as target recommendation objects.
[0142] Further, based on the above embodiment, the recommended distance determination module 500 may include:
[0143] A distance determination unit, used to determine whether the current recommended distance is greater than a preset recommended distance threshold;
[0144] a target recommended distance determination unit, configured to use the current recommended distance as the target recommended distance when the current recommended distance is greater than the preset recommended distance threshold;
[0145] The song elimination unit is used to eliminate the current recommended distance when the current recommended distance is not greater than the preset recommended distance threshold.
[0146] It should be noted that the order of the modules and units in the above-mentioned song recommendation device can be changed without affecting the logic.
[0147] The song recommendation device provided in the embodiment of the present invention may include: a predicted audio feature determination module 400, which is used to obtain songs to be recommended, and determine the predicted audio features of the songs to be recommended using a target song recommendation model; wherein the target song recommendation model is a model obtained according to the above-mentioned song recommendation model training method; a recommended distance determination module 500, which is used to calculate multiple recommended distances between the predicted audio features and text features corresponding to the song lists of multiple user objects, and select a target recommended distance that meets the distance condition from the multiple recommended distances; a recommendation module 600, which is used to recommend songs to the user corresponding to the target recommended distance as the target recommendation object. The song recommendation model in the embodiment of the present invention is a model trained according to the above-mentioned song recommendation model training method, that is, the trained contrastive learning model can be directly used as the song recommendation model without additional training, thereby realizing an end-to-end contrastive learning recommendation system, which can improve the performance of the current non-end-to-end contrastive learning recommendation model and provide users with a better listening experience.
[0148] An electronic device provided by an embodiment of the present invention is introduced below. The electronic device described below and the song recommendation model training method and / or song recommendation method described above can refer to each other.
[0149] Please refer to Figure 7 , Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention may include:
[0150] A memory 10, used for storing computer programs;
[0151] The processor 20 is used to execute a computer program to implement the above-mentioned song recommendation model training method and / or song recommendation method;
[0152] The memory 10 , the processor 20 , and the communication interface 30 all communicate with each other via a communication bus 40 .
[0153] In the embodiment of the present invention, the memory 10 is used to store one or more programs, and the program may include program code, and the program code includes computer operation instructions. In the embodiment of the present invention, the memory 10 may store programs for implementing the following functions:
[0154] Perform audio feature extraction on the audio corresponding to each song in the target user's playlist to obtain the audio features corresponding to each song, and perform feature extraction on the song text of the target user's playlist to obtain the target text features corresponding to the target user's playlist;
[0155] Aggregate multiple audio features in the target user's playlist to obtain target audio features corresponding to the target user's playlist; wherein the aggregation process is a processing method that can obtain overall features that simultaneously characterize multiple audio features after processing multiple audio features;
[0156] The contrast loss value is determined using the target text features and the target audio features, and the contrastive learning model is trained according to the contrastive loss value to obtain a target song recommendation model; wherein the goal of the contrastive learning model is that the distance in space between audio features and text features belonging to the same user playlist is smaller than the distance in space between audio features and text features that do not belong to the same user playlist.
[0157] Alternatively, the memory 10 may store a program for implementing the following functions:
[0158] Obtain songs to be recommended, and use a target song recommendation model to determine predicted audio features of the songs to be recommended; wherein the target song recommendation model is a model obtained according to the song recommendation model training method described above;
[0159] Calculate multiple recommended distances between the predicted audio features and the text features corresponding to the playlists of multiple user objects, and select a target recommended distance that meets the distance condition from the multiple recommended distances;
[0160] The user corresponding to the target recommendation distance is taken as the target recommendation object for song recommendation.
[0161] In a possible implementation, the memory 10 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function, etc.; the data storage area may store data created during use.
[0162] In addition, the memory 10 may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include an NVRAM. The memory stores an operating system and operating instructions, executable modules or data structures, or a subset thereof, or an extended set thereof, wherein the operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and processing hardware-based tasks.
[0163] The processor 20 may be a central processing unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array or other programmable logic device, a microprocessor or any conventional processor, etc. The processor 20 may call a program stored in the memory 10 .
[0164] The communication interface 30 may be an interface of a communication module, and is used to connect to other devices or systems.
[0165] Of course, it should be noted that Figure 7 The structure shown does not constitute a limitation on the electronic device in the embodiment of the present invention. In actual applications, the electronic device may include Figure 7 More or fewer components than shown, or combinations of certain components.
[0166] The computer-readable storage medium provided in an embodiment of the present invention is introduced below. The computer-readable storage medium described below and the song recommendation model training method and / or song recommendation method described above can be referenced to each other.
[0167] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned song recommendation model training method and / or song recommendation method are implemented.
[0168] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0169] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0170] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0171] Finally, it should be noted that, in this article, relationships such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variations are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0172] The above is a detailed introduction to a song recommendation model training method, a song recommendation method and related devices provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A song recommendation model training method, characterized in that: include: Performing audio feature extraction on the audio corresponding to each song in the target user's playlist to obtain the audio feature corresponding to each song, and performing feature extraction on the song text of the target user's playlist to obtain the target text feature corresponding to the target user's playlist; Aggregate multiple audio features in the target user's playlist to obtain target audio features corresponding to the target user's playlist; wherein the aggregation process is a processing method that can obtain overall features that simultaneously characterize multiple audio features after processing multiple audio features; The target text features and the target audio features are used to determine a contrast loss value, and a contrast learning model is trained according to the contrast loss value to obtain a target song recommendation model; wherein the goal of the contrast learning model is that the distance in space between audio features and text features belonging to the same user playlist is smaller than the distance in space between audio features and text features that do not belong to the same user playlist.
2. The song recommendation model training method according to claim 1, characterized in that: The target user playlist includes at least one of a favorite playlist, a finished playlist, and a listening time playlist; wherein the listening time playlist is a playlist whose listening time is greater than a preset time threshold.
3. The song recommendation model training method according to claim 1, characterized in that: The method further comprises: Perform dimensionality reduction processing on the audio features corresponding to each song to obtain dimensionality-reduced audio features; The aggregating multiple audio features in the target user's playlist to obtain a target audio feature corresponding to the target user's playlist includes: Aggregate multiple dimensionality-reduced audio features in the target user's playlist to obtain target audio features corresponding to the target user's playlist; The method further comprises: Performing dimensionality reduction processing on the target text feature to obtain the target reduced-dimensionality text feature; The determining of the contrast loss value by using the target text feature and the target audio feature includes: The contrast loss value is determined using the target reduced-dimensionality text feature and the target audio feature.
4. The song recommendation model training method according to claim 1, characterized in that: Performing feature extraction on the song text of the target user's song list to obtain target text features corresponding to the target user's song list includes: Counting the song texts in the target user's playlist to determine target text information; wherein the target text information includes at least one of the proportion of each singer, the proportion of each language, the proportion of each genre, the album region, and the song rhythm; Feature extraction is performed on the target text information to obtain the target text features corresponding to the target user's playlist.
5. The song recommendation model training method according to any one of claims 1 to 4, characterized in that: The number of the target user playlists is at least two, and each of the target user playlists constitutes a target playlist set; the contrast loss value is determined by using the target text feature and the target audio feature, and a contrast learning model is trained according to the contrast loss value to obtain a target song recommendation model, including: The target dimension-reduced audio features and the first target dimension-reduced text features corresponding to the first target user's playlist are taken as positive samples; The second target reduced-dimensionality text features corresponding to the second target user's playlist and the target reduced-dimensionality audio features corresponding to the first target user are used as negative samples; wherein the second target user's playlist and the first target user's playlist both belong to the target playlist set; Determining a first distance between features corresponding to the positive samples, and determining a second distance between features corresponding to the negative samples; Determine the contrast loss value when the first distance is smaller than the second distance, and use the parameters corresponding to the contrast loss value as the parameters of the contrast learning model to obtain the target song recommendation model.
6. The song recommendation model training method according to claim 1, characterized in that: Perform audio feature extraction on the audio corresponding to each song in the target user's playlist to obtain the audio features corresponding to each song, including: The music audio understanding model is used to extract audio features from the audio in the target user's playlist to obtain the audio features.
7. The song recommendation model training method according to claim 1, characterized in that: Before extracting audio features from the audio corresponding to each song in the target user's playlist to obtain the audio features corresponding to each song, the following steps are also included: Determine whether the length of the songs in the current playlist is greater than a preset length threshold; wherein the length of the songs in the playlist is determined according to the number of songs; When the length of the songs in the current playlist is greater than the preset length threshold, determining to use the current playlist as the target user playlist; When the length of the songs in the current playlist is not greater than the preset length threshold, it is determined to remove the current playlist.
8. A song recommendation method, characterized in that: include: Obtaining songs to be recommended, and determining predicted audio features of the songs to be recommended using a target song recommendation model; wherein the target song recommendation model is a model obtained by the song recommendation model training method according to any one of claims 1 to 7; Calculating a plurality of recommended distances between the predicted audio feature and text features corresponding to the playlists of a plurality of user objects, and selecting a target recommended distance that meets a distance condition from the plurality of recommended distances; The user corresponding to the target recommendation distance is taken as the target recommendation object for song recommendation.
9. The song recommendation method according to claim 8, characterized in that: Selecting a target recommended distance that meets a distance condition from the multiple recommended distances includes: Determine whether the current recommended distance is greater than a preset recommended distance threshold; When the current recommended distance is greater than the preset recommended distance threshold, taking the current recommended distance as the target recommended distance; When the current recommended distance is not greater than the preset recommended distance threshold, the current recommended distance is eliminated.
10. A song recommendation model training device, characterized in that: include: A feature extraction module is used to extract audio features from the audio corresponding to each song in the target user's playlist to obtain audio features corresponding to each song, and to extract features from the song text of the target user's playlist to obtain target text features corresponding to the target user's playlist; A processing module, used to aggregate multiple audio features in the target user's playlist to obtain target audio features corresponding to the target user's playlist; wherein the aggregation processing is a processing method that can obtain overall features that simultaneously characterize multiple audio features after processing multiple audio features; A model training module is used to determine a contrast loss value using the target text features and the target audio features, and train a contrast learning model based on the contrast loss value to obtain a target song recommendation model; wherein the goal of the contrast learning model is that the distance in space between audio features and text features belonging to the same user playlist is smaller than the distance in space between audio features and text features that do not belong to the same user playlist.
11. A song recommendation device, characterized in that: include: A predicted audio feature determination module, used to obtain songs to be recommended, and determine the predicted audio features of the songs to be recommended using a target song recommendation model; wherein the target song recommendation model is a model obtained by the song recommendation model training method according to any one of claims 1 to 7; A recommended distance determination module, used to calculate a plurality of recommended distances between the predicted audio feature and text features corresponding to the playlists of a plurality of user objects, and select a target recommended distance that meets a distance condition from the plurality of recommended distances; The recommendation module is used to recommend songs to users corresponding to the target recommendation distance as target recommendation objects.
12. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the method according to any one of claims 1 to 9 when executing the computer program.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
14. A computer program product, characterized in that The invention comprises a computer program / instruction, which implements the steps of the above method when executed by a processor.