Music recommendation method and device, computer device and storage medium
By acquiring the latent feature vectors of users and music, and using a pre-trained model to calculate preference values, this approach solves the problem that existing recommendation systems fail to incorporate user features, thus achieving more accurate music recommendations.
Patent Information
- Application Number
- CN202111360530.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-17
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2041-11-17
AI Technical Summary
Existing recommendation systems typically rely solely on existing data within the system when making recommendations, failing to incorporate user characteristics, resulting in low recommendation accuracy.
By obtaining the latent feature vectors of the target user and the latent feature vectors of the candidate music, and using a pre-trained music feature prediction model, the user's preference value for the candidate music is calculated, thereby determining the target music to be recommended.
It improves the accuracy of music recommendations, enabling more precise recommendations of music that matches the user's interests.
Smart Images

Figure CN114168787B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a music recommendation method, apparatus, computer device, storage medium, and computer program product. Background Technology
[0002] With the development of artificial intelligence technology, various recommendation systems have emerged, such as music recommendation systems and product recommendation systems. These systems can provide relevant recommendations to users, thereby improving their experience.
[0003] However, current recommendation systems generally only make recommendations based on data already existing in the system, and do not take into account the user's own characteristics, ultimately resulting in low recommendation accuracy. Summary of the Invention
[0004] Therefore, it is necessary to provide a music recommendation method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve the accuracy of music recommendation in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides a music recommendation method, the method comprising:
[0006] Obtain the latent feature vector of the target user, which is used to represent the user's degree of interest and preference for music;
[0007] The method for determining the potential feature vectors of each candidate music is as follows: acquiring the audio data and attribute data of the candidate music, inputting the audio data and attribute data of the candidate music into a pre-trained music feature prediction model, and obtaining the potential feature vectors of the candidate music.
[0008] Based on the user's latent feature vector and the music's latent feature vector, the target user's preference value for each of the candidate music pieces is determined, and based on the preference value of each candidate music piece, the target music to be recommended to the target user is determined from the candidate music pieces.
[0009] In one embodiment, the method for determining the latent feature vector of the target user includes:
[0010] Obtain music listening records, which include information about each user and the music listened to by each user;
[0011] The music listening records are processed into a matrix to obtain an association matrix showing the correspondence between each user and each piece of music.
[0012] The correlation matrix is decomposed to obtain the latent feature vectors of each user, including the target user.
[0013] In one embodiment, the training process of the music feature prediction model includes:
[0014] Obtain a sample dataset, which includes sample audio data and sample attribute data of the sample music;
[0015] The sample audio data is processed using a music feature prediction model to be trained to obtain an audio vector of the sample audio data; the sample attribute data is encoded to obtain an attribute vector of the sample attribute data; and the audio vector and the attribute vector are fully connected to obtain a predicted music latent feature vector.
[0016] If the training termination condition is met, the music feature prediction model to be trained is used as the music feature prediction model. Otherwise, based on the comparison results between the predicted music latent feature vector and the target music latent feature vector of the sample music, the music feature prediction model to be trained is adjusted, and the sample audio data is processed using the music feature prediction model to be trained until the training termination condition is met.
[0017] In one embodiment, the music feature prediction model to be trained includes: a Fourier transform, a filter, a first up-dimensional network model, an encoder, a second up-dimensional network model, and a fully connected layer;
[0018] The Fourier transformer performs a Fourier transform on the sample audio data, the filter performs filtering processing on the Fourier transformed sample audio data to obtain an initial audio vector, and the first upscaling network model performs upscaling processing on the initial audio vector to obtain the audio vector of the sample audio data.
[0019] The encoder encodes the sample attribute data to obtain an initial attribute vector, and the second up-dimensional network model up-dimensionalizes the initial attribute vector to obtain the attribute vector of the sample attribute data.
[0020] The fully connected layer performs fully connected processing on the audio vector and the attribute vector to obtain the predicted music latent feature vector.
[0021] In one embodiment, the music feature prediction model to be trained further includes: a word embedding processing module;
[0022] The word embedding processing module performs word embedding processing on the initial attribute vector to obtain the word-embedded attribute vector.
[0023] The second up-dimensional network model performs up-dimensional processing on the attribute vector after word embedding to obtain the attribute vector of the sample attribute data.
[0024] In one embodiment, the fully connected layer performs a fully connected process on the audio vector and the attribute vector to obtain a predicted music latent feature vector, including:
[0025] The fully connected layer concatenates the audio vector and the attribute vector to obtain a concatenated music vector; and performs dimensionality reduction on the concatenated music vector to obtain a predicted music latent feature vector.
[0026] In one embodiment, determining the target user's preference value for each of the candidate music pieces based on the user's latent feature vector and the music's latent feature vector includes:
[0027] Calculate the inner product of the user's latent feature vector and the music's latent feature vector, and use the inner product as the target user's preference value for each of the candidate music tracks.
[0028] Secondly, this application also provides a music recommendation device, the device comprising:
[0029] The user latent feature vector acquisition module is used to acquire the user latent feature vector of the target user, which represents the user's degree of interest and preference for music.
[0030] The music latent feature vector acquisition module is used to acquire the music latent feature vector of each candidate music. The method for determining the music latent feature vector of the candidate music includes: acquiring the audio data and attribute data of the candidate music, inputting the audio data and attribute data of the candidate music into a pre-trained music feature prediction model, and obtaining the music latent feature vector of the candidate music.
[0031] The target music determination module is used to determine the target user's preference value for each of the candidate music based on the user's latent feature vector and the music's latent feature vector, and to determine the target music to recommend to the target user from the candidate music according to the preference value of each of the candidate music.
[0032] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described music recommendation method.
[0033] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described music recommendation method.
[0034] Fourthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described music recommendation method.
[0035] The aforementioned music recommendation method, apparatus, computer equipment, storage medium, and computer program product, by acquiring the latent feature vector of the target user and the latent feature vector of each candidate music, determine the target user's preference value for each candidate music, and finally determine the target music to recommend to the target user from among the candidate music based on the preference value of each candidate music, thereby improving the accuracy of music recommendation. In particular, by acquiring the audio data and attribute data of the candidate music, the audio data and attribute data of the candidate music are input into a pre-trained music feature prediction model to obtain the latent feature vector of the candidate music. Attached Figure Description
[0036] Figure 1 This is a diagram illustrating the application environment of a music recommendation method in one embodiment;
[0037] Figure 2 This is a flowchart illustrating a music recommendation method in one embodiment;
[0038] Figure 3 This is a schematic diagram of the sample audio data processing flow of a music recommendation method in one embodiment;
[0039] Figure 4 This is a flowchart illustrating the music recommendation method in another embodiment;
[0040] Figure 5 This is a structural block diagram of a music recommendation device in one embodiment;
[0041] Figure 6 This is an internal structural diagram of a computer device in one embodiment;
[0042] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0044] The music recommendation method provided in this application embodiment can be applied to, for example, Figure 1The application environment shown can involve only terminal 102, only server 104, or both terminal 102 and server 104. Terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated on server 104 or located in the cloud or on other network servers. Specifically, terminal 102 or server 104 performs a music recommendation method. This method includes obtaining a latent feature vector of a target user, which represents the user's interest and preference for music; obtaining latent feature vectors of candidate music, wherein the determination of the latent feature vectors of candidate music includes: obtaining audio data and attribute data of the candidate music; inputting the audio data and attribute data of the candidate music into a pre-trained music feature prediction model to obtain the latent feature vectors of the candidate music; determining the target user's preference value for each candidate music based on the latent feature vectors of the user and the latent feature vectors of the music; and determining the target music to recommend to the target user from among the candidate music based on the preference values of each candidate music.
[0045] When terminal 102 completes the music recommendation method, it can directly obtain the stored latent feature vector of the target user, or it can obtain the latent feature vector of the target user from server 104 or other data storage systems or servers. The pre-trained music feature prediction model can be trained by terminal 102, or it can be trained by server 104 and then obtained by terminal 102 from server 104, or it can be trained by a third-party device and then obtained by server 104 from the third-party device.
[0046] Specifically, when server 104 completes the music recommendation method, server 104 can obtain the potential feature vector of the target user from terminal 102, other databases, or other servers. The pre-trained music feature prediction model can be trained by server 104 itself, or it can be trained by terminal 102 and then obtained by server 104 from terminal 102, or it can be trained by a third-party device and then obtained by server 104 from the third-party device.
[0047] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0048] In one embodiment, such as Figure 2 As shown, a music recommendation method is provided, which is applied to... Figure 1 Taking server 104 as an example, the following steps are included:
[0049] Step S202: Obtain the latent feature vector of the target user, which is used to represent the user's degree of interest and preference for music.
[0050] Among them, the target user can be the user who is recommended music. There can be one or more target users. Specifically, the target user can be the user who has enabled music recommendation permission. The user's latent feature vector is used to represent the user's degree of interest and preference for music.
[0051] Step S204: Obtain the music potential feature vector of each candidate music. The method for determining the music potential feature vector of the candidate music includes: obtaining the audio data and attribute data of the candidate music, inputting the audio data and attribute data of the candidate music into a pre-trained music feature prediction model, and obtaining the music potential feature vector of the candidate music.
[0052] Candidate music can be music that may be recommended to the target user. Candidate music can be newly released music, music that the target user has listened to in the past, or a combination of newly released music and music that the target user has listened to in the past. Audio data can be used to describe the frequency range and sound of candidate music, and attribute data can refer to music tags, release year, artist identifiers, and other identifying information.
[0053] In one embodiment, the music feature prediction model is pre-trained. When in use, the audio data and attribute data of the candidate music are input into the pre-trained music feature prediction model. Based on the music feature prediction model, the audio data and attribute data of the candidate music are processed to obtain the music potential feature vector corresponding to each candidate music.
[0054] Step S206: Based on the user latent feature vector and the music latent feature vector, determine the target user's preference value for each of the candidate music pieces, and determine the target music to recommend to the target user from among the candidate music pieces according to the preference value of each candidate music piece.
[0055] The target user's preference value for each candidate music can be used to represent the degree of liking for each candidate music. The preference value can be a specific score, or any numerical value, letter, or feature code that can represent the degree of liking. After obtaining the user's latent feature vector and the music's latent feature vector, the target user's preference value for each candidate music can be determined, and the target music to be recommended to the target user can be determined from the candidate music based on the preference value of each candidate music.
[0056] In the aforementioned music recommendation method, by obtaining the latent feature vector of the target user and the latent feature vector of each candidate music, the target user's preference value for each candidate music is determined. Finally, based on the preference value of each candidate music, the target music to be recommended to the target user is determined from among the candidate music, thereby improving the accuracy of music recommendation. Specifically, by obtaining the audio data and attribute data of the candidate music, the audio data and attribute data of the candidate music are input into a pre-trained music feature prediction model to obtain the latent feature vector of the candidate music.
[0057] In one embodiment, the method for determining the latent feature vector of the target user includes:
[0058] Obtain music listening records, which include information about each user and the music listened to by each user;
[0059] The music listening records are processed into a matrix to obtain an association matrix showing the correspondence between each user and each piece of music.
[0060] The correlation matrix is decomposed to obtain the latent feature vectors of each user, including the target user.
[0061] In one embodiment, the music listening records include information about each user and the music listened to by each user. After obtaining the music listening records, the music listening records can be processed into a matrix. Specifically, when constructing the association matrix of the correspondence between each user and each piece of music, the association matrix can be set to a user list as the behavior and a music name as the column. The values of the matrix elements are 1 and 0, where 1 can represent that a user has listened to the music and 0 can represent that a user has not listened to the music.
[0062] After obtaining the correlation matrix, it can be decomposed using a weighted matrix algorithm. This allows us to obtain the latent feature vectors of each user using the methods described above. The objective function of the weighted matrix algorithm is:
[0063]
[0064] Among them, P ui Let x be a binary preference vector representing user u's preference for music i. u and y i c are the latent feature vectors of user u and music i, respectively; ui Let λ(∑) be the confidence variable, representing the probability that user u likes music i; u ||x u || 2 +∑ i ||y i || 2 ) represents the regularization term. User u's rating of music i is represented by their respective latent feature vectors x. u and y i The product is represented by the vector with a dimension of 50.
[0065] In one embodiment, the training process of the music feature prediction model includes:
[0066] Obtain a sample dataset, which includes sample audio data and sample attribute data of the sample music;
[0067] The sample audio data is processed using a music feature prediction model to be trained to obtain an audio vector of the sample audio data; the sample attribute data is encoded to obtain an attribute vector of the sample attribute data; and the audio vector and the attribute vector are fully connected to obtain a predicted music latent feature vector.
[0068] If the training termination condition is met, the music feature prediction model to be trained is used as the music feature prediction model. Otherwise, based on the comparison results between the predicted music latent feature vector and the target music latent feature vector of the sample music, the music feature prediction model to be trained is adjusted, and the sample audio data is processed using the music feature prediction model to be trained until the training termination condition is met.
[0069] In one implementation, the sample dataset can come from the audio data and attribute data of multiple songs. Processing the sample audio data can involve adjusting the audio size of the sample audio data to obtain sample audio data of appropriate size. Encoding can involve performing one-hot encoding on the samples to obtain the attribute vectors of the sample attribute data. Fully connected processing refers to feature fusion processing on the audio vectors and attribute vectors to obtain the potential feature vectors of the predicted music.
[0070] Among them, the training termination condition refers to the pre-set condition that can end the model training process. The model training termination condition can be the set expected error range, the set number of iterations, etc. For example, when the comparison result between the predicted music latent feature vector and the target music latent feature vector of the sample music meets the set expected error range, the training termination condition is reached, and the music feature prediction model can be obtained. Or, when the number of iterations reaches the set number, the training termination condition is reached.
[0071] If the training termination condition is not met, the music feature prediction model to be trained is adjusted based on the comparison results between the predicted music latent feature vector and the target music latent feature vector of the sample music. The model is then used to process the sample audio data. Thus, a music feature prediction model can be obtained through the above method.
[0072] In one embodiment, the music feature prediction model to be trained includes: a Fourier transform, a filter, a first up-dimensional network model, an encoder, a second up-dimensional network model, and a fully connected layer;
[0073] The Fourier transformer performs a Fourier transform on the sample audio data, the filter performs filtering processing on the Fourier transformed sample audio data to obtain an initial audio vector, and the first upscaling network model performs upscaling processing on the initial audio vector to obtain the audio vector of the sample audio data.
[0074] The encoder encodes the sample attribute data to obtain an initial attribute vector, and the second up-dimensional network model up-dimensionalizes the initial attribute vector to obtain the attribute vector of the sample attribute data.
[0075] The fully connected layer performs fully connected processing on the audio vector and the attribute vector to obtain the predicted music latent feature vector.
[0076] In one embodiment, reference Figure 3The diagram shows a flowchart of sample audio data processing. After obtaining the sample audio data, the time window width and jump distance can be set, such as a time window width of 1024 audio frames and a jump distance of 512 audio frames. Then, frame-by-frame windowing processing is performed. The Fourier transform can be a short-time Fourier transform (SFT). The SFT performs a SFT on the frame-by-frame windowed sample audio data to obtain the SFT-transformed sample audio data. The filter can be a Mel filter. The Mel filter then transforms the SFT-transformed sample audio data to obtain a Mel spectrum vector. This Mel vector is used as the initial audio vector, thus obtaining an audio signal with almost identical frequency perception capability. The dimension of the Mel vector can be set according to the actual situation. In this embodiment, 128 Mel filters are used to obtain a 128-dimensional Mel spectrum vector.
[0077] The first dimension-upgrading network model can be a Long Short-Term Memory (LSTM) network. By inputting the initial audio vector into the LSTM network, the initial audio vector can be dimension-upgraded. When choosing the final dimension, 512, 1024, etc. are suitable as feature lengths. In this embodiment, the 128-dimensional Mel spectrum vector is upgraded to a 512-dimensional Mel spectrum vector, and the 512-dimensional Mel spectrum vector is used as the audio vector of the sample audio data.
[0078] The second-dimensional upscaling network model can be a multilayer perceptron model. After the encoder encodes the sample attribute data, it obtains an initial attribute vector. The initial attribute vector can be set to 128 dimensions. The second-dimensional upscaling network model then upscales the initial attribute vector to obtain a 512-dimensional attribute vector, which is used as the attribute vector for the sample attribute data. The fully connected layer concatenates the 512-dimensional Mel-frequency spectrum vector and the 512-dimensional attribute vector into a 1024-dimensional latent music feature vector. Therefore, the predicted latent music feature vector can be determined using the above method.
[0079] In one embodiment, if the training termination condition is not met, the process returns to the music feature prediction model to be trained. Specifically, it can return to the steps of the Fourier transformer processing the sample audio data and the encoder processing the sample attribute data to obtain the reprocessed initial audio vector and initial attribute vector. Based on the reprocessed initial audio vector and initial attribute vector, subsequent steps are performed to obtain the predicted music latent feature vector. Alternatively, it can directly return to the steps of the first upscaling network model processing the initial audio vector and the second upscaling network model processing the initial attribute vector, and then perform subsequent steps to obtain the predicted music latent feature vector.
[0080] In one embodiment, the music feature prediction model to be trained further includes: a word embedding processing module;
[0081] The word embedding processing module performs word embedding processing on the initial attribute vector to obtain the word-embedded attribute vector.
[0082] The second up-dimensional network model performs up-dimensional processing on the attribute vector after word embedding to obtain the attribute vector of the sample attribute data.
[0083] In one embodiment, word embedding is a way of representing text. It can represent the initial attribute vector as a real value vector in a high-dimensional space. The attribute vector after word embedding is then upgraded by a second up-dimensional network model. Thus, the attribute vector of the sample attribute data can be obtained by the above method.
[0084] In one embodiment, the fully connected layer performs a fully connected process on the audio vector and the attribute vector to obtain a predicted music latent feature vector, including:
[0085] The fully connected layer concatenates the audio vector and the attribute vector to obtain a concatenated music vector; and performs dimensionality reduction on the concatenated music vector to obtain a predicted music latent feature vector.
[0086] In one embodiment, after the fully connected layer concatenates the 512-dimensional Mel spectrum vector and the 512-dimensional attribute vector into a 1024-dimensional music feature vector, the 1024-dimensional music feature vector can be dimensionality reduced. Specifically, a 50-dimensional music latent feature vector can be output, thereby simplifying the calculation process and improving the calculation speed.
[0087] In one embodiment, determining the target user's preference value for each of the candidate music pieces based on the user's latent feature vector and the music's latent feature vector includes:
[0088] Calculate the inner product of the user's latent feature vector and the music's latent feature vector, and use the inner product as the target user's preference value for each of the candidate music tracks.
[0089] In one embodiment, after obtaining the user latent feature vector and the music latent feature vector, the user latent feature vector and the music latent feature vector can be multiplied to obtain an inner product, and the inner product is used as the target user's preference value for each candidate music. Thus, the target user's preference value for candidate music can be determined using the above method.
[0090] In one embodiment, reference Figure 4 The image shown is a flowchart illustrating a music recommendation method in a specific embodiment:
[0091] This embodiment uses recommending candidate music to a target user as an example for illustration. The candidate music can be music that may be recommended to the target user. The candidate music can be newly released music, music that the target user has listened to in the past, or a combination of newly released music and music that the target user has listened to in the past.
[0092] When determining whether to recommend candidate music, the latent feature vector of the target user can be obtained. This latent feature vector represents the user's level of interest and preference for music. Specifically, to determine the latent feature vector of the target user, the music listening records of each user can be obtained and matrixed. Specifically, when constructing the association matrix between each user and each piece of music, the matrix can be set with a user list as the row and music names as the column. The matrix elements have values of 1 and 0, where 1 represents that a user has listened to the music and 0 represents that a user has not listened to the music. After obtaining the association matrix, it can be decomposed using a weighted matrix algorithm. Thus, the latent feature vector of each user can be obtained using the above method. The objective function of the weighted matrix algorithm is:
[0093]
[0094] Among them, P ui Let x be a binary preference vector representing user u's preference for music i. u and y i c are the latent feature vectors of user u and music i, respectively; ui Let λ(∑) be the confidence variable, representing the probability that user u likes music i; u ||x u || 2 +∑ i ||y i || 2 ) represents the regularization term. User u's rating of music i is represented by their respective latent feature vectors x. u and y i The product is represented by the vector with a dimension of 50.
[0095] In addition, the potential feature vectors of each candidate music can be obtained. The determination of the potential feature vectors of candidate music includes: obtaining the audio data and attribute data of the candidate music, inputting the audio data and attribute data of the candidate music into a pre-trained music feature prediction model, and obtaining the potential feature vectors of the candidate music. The audio data can be used to describe the frequency range and sound of the candidate music, and the attribute data can refer to music tags, release year, artist identification and other marker information.
[0096] The music feature prediction model is pre-trained. When using it, the audio data and attribute data of the candidate music are input into the pre-trained music feature prediction model. Based on the music feature prediction model, the audio data and attribute data of the candidate music are processed to obtain the music potential feature vector corresponding to each candidate music.
[0097] The music feature prediction model to be trained includes: a Fourier transform, a filter, a first-dimensional network model, an encoder, a second-dimensional network model, and a fully connected layer. A sample dataset is obtained, which can come from the audio and attribute data of multiple songs. Processing the sample audio data involves adjusting its size to obtain appropriately sized sample audio data. Encoding involves performing one-hot encoding on the samples to obtain attribute vectors from the sample attribute data. Fully connected processing refers to feature fusion processing of the audio vectors and attribute vectors to obtain the latent feature vectors for predicting the music.
[0098] Specifically, after obtaining the sample audio data, the time window width and jump distance can be set, such as a time window width of 1024 audio frames and a jump distance of 512 audio frames. Then, frame-by-frame windowing processing is performed. The Fourier transform can be a short-time Fourier transform (SFT). The SFT can be used to perform a SFT on the frame-by-frame windowed sample audio data to obtain the SFT-transformed sample audio data. The filter can be a Mel filter. Then, the Mel filter is used to transform the SFT-transformed sample audio data to obtain a Mel spectrum vector. The Mel vector is used as the initial audio vector, thereby obtaining an audio signal with almost the same frequency perception capability. The dimension of the Mel vector can be set according to the actual situation. In this embodiment, 128 Mel filters are used to obtain a 128-dimensional Mel spectrum vector.
[0099] The first dimension-upgrading network model can be a Long Short-Term Memory (LSTM) network. By inputting the initial audio vector into the LSTM network, the initial audio vector can be dimension-upgraded. When choosing the final dimension, 512, 1024, etc. are suitable as feature lengths. In this embodiment, the 128-dimensional Mel spectrum vector is upgraded to a 512-dimensional Mel spectrum vector, and the 512-dimensional Mel spectrum vector is used as the audio vector of the sample audio data.
[0100] The second upscaling network model can be a multilayer perceptron model. After the encoder encodes the sample attribute data, it obtains an initial attribute vector, which can be set to 128 dimensions. The second upscaling network model then upscales the initial attribute vector to obtain a 512-dimensional attribute vector, which is used as the attribute vector for the sample attribute data. The fully connected layer concatenates the 512-dimensional Mel-frequency spectrum vector and the 512-dimensional attribute vector into a 1024-dimensional music latent feature vector. After this concatenation, the 1024-dimensional music feature vector can be downscaled, specifically outputting a 50-dimensional music latent feature vector, thus simplifying the computation process and improving computational speed.
[0101] Finally, by using the user's latent feature vector and the music's latent feature vector, the target user's preference value for each candidate music is determined. Based on the preference value of each candidate music, the target music to be recommended to the target user is selected from among the candidate music. The preference value of each candidate music can represent the degree of liking for each candidate music. The preference value can be a specific score, or any numerical value, letter, or feature code that can represent the degree of liking.
[0102] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0103] Based on the same inventive concept, this application also provides a music recommendation device for implementing the music recommendation method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more music recommendation device embodiments provided below can be found in the limitations of the music recommendation method described above, and will not be repeated here.
[0104] In one embodiment, such as Figure 5As shown, a music recommendation device is provided, including: a user latent feature vector acquisition module, a music latent feature vector acquisition module, and a target music determination module, wherein:
[0105] User latent feature vector acquisition module 502 is used to acquire the user latent feature vector of the target user, wherein the user latent feature vector is used to represent the degree of user interest and preference for music.
[0106] The music latent feature vector acquisition module 504 is used to acquire the music latent feature vector of each candidate music. The method for determining the music latent feature vector of the candidate music includes: acquiring the audio data and attribute data of the candidate music, inputting the audio data and attribute data of the candidate music into a pre-trained music feature prediction model, and obtaining the music latent feature vector of the candidate music.
[0107] The target music determination module 506 is used to determine the target user's preference value for each of the candidate music based on the user's latent feature vector and the music's latent feature vector, and to determine the target music to recommend to the target user from the candidate music according to the preference value of each of the candidate music.
[0108] In one embodiment, the user latent feature vector acquisition module is used to acquire music listening records, the music listening records including information about each user and the music listened to by each user; perform matrix processing on the music listening records to obtain an association matrix of the correspondence between each user and each piece of music; decompose the association matrix to obtain the user latent feature vector of each user, each user including the target user.
[0109] In one embodiment, the music latent feature vector acquisition module includes: a music feature prediction model training module;
[0110] The music feature model training module is used to acquire a sample dataset, which includes sample audio data and sample attribute data of sample music; process the sample audio data using the music feature prediction model to be trained to obtain audio vectors of the sample audio data; encode the sample attribute data to obtain attribute vectors of the sample attribute data; and perform fully connected processing on the audio vectors and the attribute vectors to obtain predicted music latent feature vectors; if the training termination condition is met, the music feature prediction model to be trained is used as the music feature prediction model; otherwise, based on the comparison result between the predicted music latent feature vector and the target music latent feature vector of the sample music, the music feature prediction model to be trained is adjusted, and the process returns to using the music feature prediction model to be trained to process the sample audio data until the training termination condition is met.
[0111] In one embodiment, the music feature model training module includes a Fourier transform, a filter, a first upscaling network model, an encoder, a second upscaling network model, and a fully connected layer. The Fourier transform performs a Fourier transform on the sample audio data; the filter performs filtering processing on the Fourier-transformed sample audio data to obtain an initial audio vector; the first upscaling network model performs upscaling processing on the initial audio vector to obtain an audio vector of the sample audio data; the encoder encodes the sample attribute data to obtain an initial attribute vector; the second upscaling network model performs upscaling processing on the initial attribute vector to obtain an attribute vector of the sample attribute data; and the fully connected layer performs a fully connected processing on the audio vector and the attribute vector to obtain a predicted music latent feature vector.
[0112] In one embodiment, the music feature prediction model training module further includes: a word embedding processing module;
[0113] The word embedding processing module is used to perform word embedding processing on the initial attribute vector to obtain the word-embedded attribute vector; the second up-dimensional network model performs up-dimensional processing on the word-embedded attribute vector to obtain the attribute vector of the sample attribute data.
[0114] In one embodiment, the fully connected layer concatenates the audio vector and the attribute vector to obtain a concatenated music vector; and performs dimensionality reduction processing on the concatenated music vector to obtain a predicted music latent feature vector.
[0115] In one embodiment, the target music determination module is used to calculate the inner product of the user's latent feature vector and the music's latent feature vector, and use the inner product as the target user's preference value for each of the candidate music tracks.
[0116] Each module in the aforementioned music recommendation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0117] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores feature vector data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a music recommendation method.
[0118] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a music recommendation method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0119] Those skilled in the art will understand that Figure 6 , 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0120] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the music recommendation method described above.
[0121] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the music recommendation method described above.
[0122] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the music recommendation method described above.
[0123] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0124] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0125] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0126] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A music recommendation method, characterized in that, The method includes: The method for obtaining the latent feature vector of the target user, which represents the user's interest and preference for music, includes: obtaining music listening records, which include information about each user and the music listened to by each user; performing matrix processing on the music listening records to obtain an association matrix of the correspondence between each user and each piece of music; and decomposing the association matrix using a weighted matrix algorithm to obtain the latent feature vector of each user, where each user includes the target user. The method for determining the potential feature vectors of each candidate music is as follows: acquiring the audio data and attribute data of the candidate music, wherein the candidate music includes a combination of newly released music and music previously listened to by the target user, and inputting the audio data and attribute data of the candidate music into a pre-trained music feature prediction model to obtain the potential feature vectors of the candidate music. The music feature prediction model includes: a Fourier transform, a filter, a first upscaling network model, an encoder, a second upscaling network model, and a fully connected layer. The Fourier transform performs a Fourier transform on the sample audio data; the filter filters the Fourier-transformed sample audio data to obtain an initial audio vector; the first upscaling network model upscales the initial audio vector to obtain an audio vector of the sample audio data; the encoder encodes the sample attribute data to obtain an initial attribute vector; the second upscaling network model upscales the initial attribute vector to obtain an attribute vector of the sample attribute data; and the fully connected layer fully connects the audio vector and the attribute vector to obtain the latent music feature vector of the candidate music. The first upscaling network model includes a Long Short-Term Memory network for upscaling the initial audio vector; the second upscaling network model includes a multilayer perceptron model for upscaling the initial attribute vector to obtain an attribute vector; the fully connected layer performs full connection processing on the audio vector and the attribute vector, including concatenating the audio vector and the attribute vector to obtain a concatenated music vector; and then performing dimensionality reduction processing on the concatenated music vector. Based on the user latent feature vector and the music latent feature vector, the target user's preference value for each of the candidate music is determined, and based on the preference value of each of the candidate music, the target music to be recommended to the target user is determined from the candidate music; determining the target user's preference value for each of the candidate music includes: calculating the inner product of the user latent feature vector and the music latent feature vector, and using the inner product as the target user's preference value for each of the candidate music, wherein the preference value includes a specific score, letter, and feature code.
2. The method according to claim 1, characterized in that, The training process of the music feature prediction model includes: Obtain a sample dataset, which includes sample audio data and sample attribute data of the sample music; The sample audio data is processed using a music feature prediction model to be trained to obtain an audio vector of the sample audio data; the sample attribute data is encoded to obtain an attribute vector of the sample attribute data; and the audio vector and the attribute vector are fully connected to obtain a predicted music latent feature vector. If the training termination condition is met, the music feature prediction model to be trained is used as the music feature prediction model. Otherwise, based on the comparison results between the predicted music latent feature vector and the target music latent feature vector of the sample music, the music feature prediction model to be trained is adjusted, and the sample audio data is processed using the music feature prediction model to be trained until the training termination condition is met.
3. The method according to claim 1, characterized in that, The music feature prediction model also includes: a word embedding processing module; The word embedding processing module performs word embedding processing on the initial attribute vector to obtain the word-embedded attribute vector. The second up-dimensional network model performs up-dimensional processing on the attribute vector after word embedding to obtain the attribute vector of the sample attribute data.
4. The method according to claim 1, characterized in that, In the first upscaling network model, the final dimension after upscaling is 512 or 1024.
5. The method according to claim 1, characterized in that, In the second up-dimensional network model, the dimension of the attribute vector is the same as the dimension of the audio vector.
6. A music recommendation device, characterized in that, The device includes: The user latent feature vector acquisition module is used to acquire the user latent feature vector of the target user. The user latent feature vector represents the user's interest and preference for music. The user latent feature vector acquisition module is used to acquire music listening records, which include information about each user and the music listened to by each user; perform matrix processing on the music listening records to obtain an association matrix of the correspondence between each user and each piece of music; decompose the association matrix using a weighted matrix algorithm to obtain the user latent feature vector of each user, including the target user; The music latent feature vector acquisition module is used to acquire the music latent feature vectors of each candidate music. The method for determining the music latent feature vectors of the candidate music includes: acquiring the audio data and attribute data of the candidate music, wherein the candidate music includes a combination of newly released music and music previously listened to by the target user; inputting the audio data and attribute data of the candidate music into a pre-trained music feature prediction model to obtain the music latent feature vectors of the candidate music. The music latent feature vector acquisition module includes: a music feature prediction model training module; the music feature model training module includes a Fourier transform, a filter, a first upscaling network model, an encoder, a second upscaling network model, and a fully connected layer; the Fourier transform performs Fourier transform on the sample audio data, the filter performs filtering processing on the Fourier transformed sample audio data to obtain an initial audio vector, the first upscaling network model performs upscaling processing on the initial audio vector to obtain the audio vector of the sample audio data; the encoder performs encoding processing on the sample attribute data to obtain an initial attribute vector, the second upscaling network model performs upscaling processing on the initial attribute vector to obtain the attribute vector of the sample attribute data; the fully connected layer performs fully connected processing on the audio vector and the attribute vector to obtain the music latent feature vector of the candidate music; The first upscaling network model includes a Long Short-Term Memory network for upscaling the initial audio vector; the second upscaling network model includes a multilayer perceptron model for upscaling the initial attribute vector to obtain an attribute vector; the fully connected layer performs full connection processing on the audio vector and the attribute vector, including concatenating the audio vector and the attribute vector to obtain a concatenated music vector; and then performing dimensionality reduction processing on the concatenated music vector. The target music determination module is used to calculate the inner product of the user's latent feature vector and the music's latent feature vector, and use the inner product as the target user's preference value for each of the candidate music tracks. Based on the preference value of each candidate music track, the module determines the target music to recommend to the target user from the candidate music tracks. The preference value includes a specific score, letters, and feature codes.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Music recommendation method based on time residence and state residence mixed model
CN113220929A