Music recommendation model processing method, music recommendation method, device, and storage medium
By acquiring the features of sample users and associated music, a music recommendation model is trained, and the prediction interaction results under multiple prediction objectives are optimized. This solves the problem of mutual constraints among objectives in the music recommendation model and achieves higher recommendation accuracy and precision.
Patent Information
- Application Number
- CN202411022360.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2044-07-29
AI Technical Summary
Existing music recommendation models are prone to mutual constraints between different objectives when the relevance of the recommendation objectives is weak, resulting in low recommendation accuracy.
By acquiring features of sample users and associated music, including attention weight features and prior features, the features are concatenated and input into a masking network to train a music recommendation model. The prediction interaction results under multiple prediction objectives are optimized, and a fusion network is used for weighted processing to reduce the mutual constraints between objectives.
It improves the accuracy of music recommendations, enabling a better understanding of user preferences and needs, balancing various recommendation objectives, and enhancing the accuracy and precision of recommendations.
Smart Images

Figure CN118643182B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of music recommendation, in particular to a music recommendation model processing method, a music recommendation method, a computer device, a computer readable storage medium and a computer program product. BACKGROUND
[0002] With the development of music recommendation technology, a music recommendation technology using an artificial intelligence model, i.e., a music recommendation model, has appeared. The music recommendation model models the interactive behaviors of a user, such as the user's clicking, playing, collecting and sharing behaviors, to predict the user's interactive situation with respect to candidate music, thereby achieving music recommendation.
[0003] In the conventional technology, the model for implementing music recommendation can be an MMOE model. The MMOE model constructs multiple shared experts at the bottom layer, represents different information through different experts, and uses a gating mechanism at the upper layer to weight the information of each expert and input the information to different targets for modeling, thereby effectively representing a multi-target scenario without increasing the model parameter quantity too much.
[0004] However, in the current music recommendation model, in the case where the relevance of the recommendation targets is weak, a mutual restraint state occurs between the optimization of different targets, i.e., there can be a case where one target is optimized well but another target is optimized poorly. Therefore, the accuracy of music recommendation in the existing music recommendation model is low. SUMMARY
[0005] Therefore, it is necessary to provide a music recommendation model processing method, a music recommendation method, a device, a computer device, a computer readable storage medium and a computer program product capable of improving the accuracy of music recommendation to solve the above technical problems.
[0006] In a first aspect, the present application provides a music recommendation model processing method, comprising:
[0007] obtaining sample features of a sample user and at least one sample music, and music information sequences corresponding to the sample user; the music information sequences are composed of music information of multiple associated music, and the associated music is music that has a preset association behavior with the sample user;
[0008] inputting the sample features and the music information sequences into a music recommendation model to be trained, obtaining attention weight features of each sample music corresponding to different associated music through the music information sequences, and obtaining prior features corresponding to the sample user;
[0009] According to the sample characteristics, the attention weight characteristics, and the prior characteristics, a spliced feature is obtained, and the spliced feature is input into a mask network of the music recommendation model to obtain a predicted interaction result of the sample user on each sample music under multiple different prediction targets, the prediction targets including at least two of a predicted click rate, a predicted play amount, and a predicted play duration.
[0010] According to the predicted interaction result of the sample user on each sample music under multiple different prediction targets, the music recommendation model is trained.
[0011] In one of the embodiments, according to the predicted interaction result of the sample user on each sample music under multiple different prediction targets, the music recommendation model is trained, including: according to the predicted interaction result of the sample user on each sample music under multiple different prediction targets, a comprehensive predicted interaction result of the sample user on each sample music is obtained, and the music recommendation model is trained by using the comprehensive predicted interaction result.
[0012] In one of the embodiments, according to the predicted interaction result of the sample user on each sample music under multiple different prediction targets, the music recommendation model is trained, including: according to the predicted interaction result of the sample user on each sample music under multiple different prediction targets, a comprehensive predicted interaction result of the sample user on each sample music is obtained, and the music recommendation model is trained by using the comprehensive predicted interaction result.
[0013] In one of the embodiments, the music information sequence includes multiple; the types of the music information included in each of the music information sequences are different; and the obtaining of the attention weight characteristics of each sample music corresponding to different associated music and the obtaining of the prior characteristics corresponding to the sample user by using the music information sequence include: a first music information sequence is obtained from the multiple music information sequences, and music identifiers of each sample music are obtained; the type of the music information included in the first music information sequence is a preset type; the music identifiers of each sample music are subjected to target attention mechanism processing with the music information of each associated music included in the first music information sequence to obtain the attention weight characteristics of each sample music corresponding to different associated music; the similarity degrees of each associated music are obtained according to the first music information sequence, and the prior characteristics corresponding to the sample user are obtained based on the similarity degrees.
[0014] In one of the embodiments, the obtaining the concatenation feature according to the sample feature, the attention weight feature and the prior feature comprises: performing embedding processing on the sample feature to obtain a sparse feature; performing sum-pooling processing on a second music information sequence in the plurality of music information sequences to obtain a sum-pooling feature; the second music information sequence is a music information sequence other than a first music information sequence in the plurality of music information sequences; and performing concatenation processing on the sparse feature, the sum-pooling feature, the attention weight feature and the prior feature to obtain the concatenation feature.
[0015] In one of the embodiments, the similarity degree is represented by a cosine distance between corresponding music information of the associated music; and the obtaining the similarity degree of each associated music according to the first music information sequence and obtaining the prior feature corresponding to the sample user based on the similarity degree comprises: obtaining a current associated music, obtaining music information corresponding to the current associated music and music information corresponding to each of the remaining associated music from the first music information sequence; the current associated music is any one of the associated music, and the remaining associated music is other associated music other than the current associated music; constructing a similarity matrix according to the cosine distance between the music information corresponding to the current associated music and the music information corresponding to each of the remaining associated music, and using the cosine distance corresponding to each of the current associated music; and obtaining the maximum matrix element from the similarity matrix, and obtaining the prior feature according to the maximum matrix element and a pre-constructed normal distribution.
[0016] In one of the embodiments, the inputting the concatenation feature into the mask network of the music recommendation model to obtain the predicted interaction result of the sample user to each of the sample music under a plurality of different prediction targets comprises: inputting the concatenation feature into the mask network of the music recommendation model to obtain a mask feature matched with the concatenation feature; inputting the mask feature into a shared expert layer of the music recommendation model to obtain a predicted click rate of the sample user to each of the sample music and a predicted play amount of the sample user to each of the sample music; and obtaining a predicted play duration of the sample user to each of the sample music according to the mask feature, the predicted click rate of the sample user to each of the sample music and the predicted play amount of the sample user to each of the sample music.
[0017] In a second aspect, the present application provides a music recommendation method, comprising:
[0018] obtaining a target user to be recommended music and a plurality of candidate recommended music to be recommended to the target user;
[0019] input the music features of the target user and each of the candidate recommended music into a pre-trained music recommendation model, and obtain a predicted interaction result of the target user for each of the candidate recommended music under a plurality of different prediction targets through the music recommendation model; the music recommendation model is obtained through the music recommendation model processing method in any one of the first aspect and the embodiments of the first aspect;
[0020] According to the predicted interaction result of the target user for each of the candidate recommended music under a plurality of different prediction targets, a target recommended music in the plurality of candidate recommended music is recommended to the target user.
[0021] In a third aspect, the present application further provides a music recommendation model processing device, comprising:
[0022] A sample feature acquisition module is configured to acquire sample features of a sample user and at least one sample music, and a music information sequence corresponding to the sample user; the music information sequence is composed of music information of a plurality of associated music, and the associated music is music that has a preset association behavior with the sample user;
[0023] A sample feature processing module is configured to input the sample features and the music information sequence into a music recommendation model to be trained, acquire an attention weight feature corresponding to each of the sample music with respect to different associated music through the music information sequence, and acquire a prior feature corresponding to the sample user;
[0024] A sub-target prediction module is configured to obtain a spliced feature according to the sample features, the attention weight feature, and the prior feature, input the spliced feature into a mask network of the music recommendation model, and obtain a predicted interaction result of the sample user for each of the sample music under a plurality of different prediction targets, wherein the prediction target includes at least two of a predicted click rate, a predicted play amount, and a predicted play duration;
[0025] A recommendation model training module is configured to train the music recommendation model according to the predicted interaction result of the sample user for each of the sample music under a plurality of different prediction targets.
[0026] In a fourth aspect, the present application further provides a music recommendation device, comprising:
[0027] A recommendation information acquisition module is configured to acquire a target user to be recommended music, and a plurality of candidate recommended music to be recommended to the target user;
[0028] The prediction interaction obtaining module is configured to input the target user and music features of each candidate recommended music into a pre-trained music recommendation model, and obtain a prediction interaction result of the target user for each candidate recommended music under a plurality of different prediction targets through the music recommendation model; the music recommendation model is obtained by processing the music recommendation model through the music recommendation model processing method of any one of the first aspect.
[0029] The music recommendation module is configured to recommend a target recommended music in the plurality of candidate recommended musics to the target user according to the prediction interaction result of the target user for each candidate recommended music under a plurality of different prediction targets.
[0030] In a fifth aspect, the present application further provides a computer device, comprising a memory and a processor, the memory stores a computer program, and the processor implements the steps of the method according to any one of the embodiments of the first aspect or the second aspect when executing the computer program.
[0031] In a sixth aspect, the present application further provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the method according to any one of the embodiments of the first aspect or the second aspect when executed by a processor.
[0032] In a seventh aspect, the present application further provides a computer program product, comprising a computer program, and the computer program implements the steps of the method according to any one of the embodiments of the first aspect or the second aspect when executed by a processor.
[0033] The music recommendation model processing method, the music recommendation method, the device, the computer device, the computer readable storage medium, and the computer program product can obtain sample features of a sample user and at least one sample music, and a music information sequence corresponding to the sample user. The music information sequence is composed of music information of multiple associated musics, and the associated music is music that has a preset association behavior with the sample user. The sample features and the music information sequence are input into a music recommendation model to be trained. The music information sequence is used to obtain attention weight features of each sample music corresponding to different associated musics, and to obtain prior features corresponding to the sample user. The sample features, the attention weight features, and the prior features are used to obtain spliced features, which are input into a mask network of the music recommendation model to obtain predicted interaction results of the sample user on each sample music under multiple different prediction targets, the prediction targets including at least two of a predicted click rate, a predicted play amount, and a predicted play duration. The music recommendation model is trained according to the predicted interaction results of the sample user on each sample music under multiple different prediction targets. The present application can obtain a music sequence composed of music information of associated music that has a preset association behavior with the sample user, and then input the sample features and the music sequence into the music recommendation model, obtain the attention weight of each sample music corresponding to different associated musics through the music sequence, obtain the prior features corresponding to the sample user, and output at least two of the predicted click rate, the predicted play amount, and the predicted play duration of the sample user on each sample music by using the above information to train the music recommendation model. By introducing the prior features related to the associated music of the user into the model processing, the mutual restraint between different targets can be reduced, and the accuracy of music recommendation can be improved. BRIEF DESCRIPTION OF DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other related drawings can be obtained by those skilled in the art without any creative effort.
[0035] Figure 1 A flowchart of a music recommendation model processing method in an embodiment;
[0036] Figure 2 A flowchart of processing a music recommendation model using predicted interaction results in an embodiment;
[0037] Figure 3 A flowchart of obtaining attention weight features and prior features in an embodiment;
[0038] Figure 4A flowchart of a process for obtaining prior features based on similarity degrees in an embodiment;
[0039] Figure 5 A flowchart of a music recommendation method in an embodiment;
[0040] Figure 6 A structural diagram of a music recommendation model in an embodiment;
[0041] Figure 7 A structural block diagram of a music recommendation model processing apparatus in an embodiment;
[0042] Figure 8 A structural block diagram of a music recommendation apparatus in an embodiment;
[0043] Figure 9 An internal structural diagram of a computer device in an embodiment. DETAILED DESCRIPTION
[0044] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0045] In an embodiment, as shown in Figure 1 , a music recommendation model processing method is provided, and the present embodiment takes the method applied to a server as an example. It should be understood that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is realized through the interaction of the terminal and the server. In the present embodiment, the method includes the following steps:
[0046] In step S101, sample features of a sample user and at least one sample music are obtained, and a music information sequence corresponding to the sample user is obtained. The music information sequence is composed of music information of multiple associated music, and the associated music is music that has a preset association behavior with the sample user.
[0047] The sample user refers to a user used for training the music recommendation model, the sample music refers to music data used for training the music recommendation model, and the sample feature refers to a feature extracted from the sample user and the sample music, that is, the sample feature can include a user feature extracted from the sample user and a music feature extracted from the sample music, such as a sample feature obtained by splicing the user feature and the music feature. The music information sequence refers to a sequence composed of music information of associated music corresponding to the sample user, for example, a sequence composed of music identifiers of the associated music, or a sequence composed of authors corresponding to the associated music, and the like. The associated music refers to music having a certain pre-set association behavior with the sample user, and the association behavior can be a complete playback behavior, that is, the music played completely by the sample user within a set time period is set as the associated music, or the association behavior can be a collection behavior, that is, the music collected by the sample user is set as the associated music.
[0048] Specifically, when the music recommendation model is processed, on the one hand, the sample user and the sample music used for processing the music recommendation model are obtained, and the sample user and the sample music are feature extracted to obtain the sample feature, and on the other hand, the information sequence composed of the music information of the associated music of the sample user is obtained as the music information sequence corresponding to the sample user.
[0049] In step S102, the sample feature and the music information sequence are input into the music recommendation model to be trained, the attention weight feature corresponding to different associated music of each sample music is obtained through the music information sequence, and the prior feature corresponding to the sample user is obtained.
[0050] The music recommendation model to be trained refers to a music recommendation model that needs to be trained, the attention feature weight information refers to the attention weight corresponding to each associated music obtained after the sample music is processed by the attention mechanism, and the prior feature refers to the prior knowledge feature corresponding to the sample user. Since the music information sequence can be used to represent the music liked by the user, the prior feature can be used to represent the preference of the sample user for the music.
[0051] Specifically, the server can input the sample feature and the music information sequence obtained in step S101 into the music recommendation model, and obtain the attention weight feature corresponding to different associated music of each sample music and the prior feature corresponding to the sample user according to the input music information sequence.
[0052] In step S103, the splicing feature is obtained according to the sample feature, the attention weight feature and the prior feature, and the splicing feature is input into the mask network of the music recommendation model to obtain the predicted interaction results of the sample user to each sample music under multiple different prediction targets, the prediction targets including at least two of the predicted click rate, the predicted play quantity and the predicted play duration.
[0053] The splicing feature is a feature obtained by the sample feature, the attention weight feature and the prior feature, and the predicted click rate, the predicted play quantity and the predicted play duration correspond to different prediction targets respectively, wherein the predicted click rate represents the click possibility of the sample user to the sample music, the predicted play quantity represents the possible play quantity of the sample user to the sample music, and the predicted play duration represents the possible play duration of the sample user to the sample music. The predicted click rate, the predicted play quantity and the predicted play duration are respectively the predicted interaction results of the sample user to the sample music under different prediction targets.
[0054] Specifically, after obtaining the attention weight feature and the prior feature, the music recommendation model can further obtain the splicing feature according to the sample feature, the attention weight feature and the prior feature, and then the splicing feature can be input into the mask network of the music recommendation model, i.e., the masknet network, so that at least two of the predicted click rate, the predicted play quantity and the predicted play duration of the sample user to each sample music can be obtained through the mask network.
[0055] In step S104, the music recommendation model is trained according to the predicted interaction results of the sample user to each sample music under multiple different prediction targets.
[0056] Finally, the server can train the music recommendation model based on the predicted interaction results of the sample user to each sample music under multiple different prediction targets.
[0057] In the music recommendation model processing method, the music sequence composed of the music information of the associated music having the preset association behavior with the sample user can be obtained, so that the sample feature and the music sequence are input into the music recommendation model, the attention weight of each sample music corresponding to different associated music is obtained through the music sequence, the prior feature corresponding to the sample user is obtained, and the predicted click rate, the predicted play quantity and the predicted play duration of the sample user to each sample music are obtained by using the above information, and then the final predicted interaction result is obtained. By introducing the prior feature related to the associated music of the user in the model processing, since the prior feature can be used to represent the preference of the sample user to the music, the model can better understand the preference and demand of the user, so that the music recommendation model can more comprehensively capture the interest of the user, thereby balancing each target in the recommendation process, reducing the mutual restraint between different targets, and improving the accuracy of music recommendation.
[0058] In an embodiment, step S104 can further include obtaining a comprehensive predicted interaction result of the sample user for each sample music according to the predicted interaction results of the sample user for each sample music under multiple different prediction targets, and training the music recommendation model by using the comprehensive predicted interaction result.
[0059] The comprehensive predicted interaction result refers to a comprehensive prediction result obtained based on the predicted interaction results under multiple different prediction targets. Specifically, the server can obtain the comprehensive predicted interaction result of the sample user for each sample music according to the predicted click rate, the predicted play amount, and the predicted play duration, so as to process the music recommendation model by using the predicted interaction result.
[0060] In the embodiment, the server can also integrate the predicted interaction results under multiple different prediction targets to obtain the comprehensive predicted interaction result for model training. In this way, the music recommendation model can integrate the prediction results under different prediction targets, so as to further improve the accuracy of music recommendation.
[0061] Further, as shown in FIG. 2, obtaining a comprehensive predicted interaction result of the sample user for each sample music according to the predicted interaction results of the sample user for each sample music under multiple different prediction targets, and training the music recommendation model by using the comprehensive predicted interaction result can further include: Figure 2
[0062] Step S201 inputs the spliced features into a fusion network of the music recommendation model to obtain fusion weights corresponding to each prediction target respectively.
[0063] The fusion network is a network module of the music recommendation model for outputting fusion weights, which can be an auxiliary fusion network for example. After obtaining the spliced information, the server can directly input the spliced information into the fusion network of the music recommendation model to obtain the fusion weights corresponding to the predicted click rate, the predicted play amount, and the predicted play duration respectively.
[0064] Step S202 performs weighted processing on the predicted interaction results under each prediction target by using the fusion weights, and obtains a comprehensive predicted interaction result according to the weighted results.
[0065] Step S203 obtains an actual interaction result of the sample user for the sample music, and trains the music recommendation model according to the difference between the comprehensive predicted interaction result and the actual interaction result.
[0066] The actual interaction result refers to the real interaction result of the sample user for the sample music. After obtaining the fusion weight corresponding to each prediction target through the fusion network, the server can also use the fusion weight to perform weighted processing on the prediction interaction result under each prediction target, that is, to perform weighted processing on the predicted click rate, the predicted play amount, and the predicted play duration, to realize fusion of the predicted click rate, the predicted play amount, and the predicted play duration, so as to obtain a comprehensive prediction interaction result. Then, the difference between the comprehensive prediction interaction result and the actual interaction result of the sample user for the sample music can be used to train the music recommendation model, so as to realize processing of the music recommendation model.
[0067] In the embodiment, the fusion network of the music recommendation model can also be used to obtain the fusion weight corresponding to the predicted click rate, the predicted play amount, and the predicted play duration respectively, so as to obtain the final comprehensive prediction interaction result by weighting each prediction target through the fusion weight. Since the fusion weight can control the influence of different targets on the final result, the targets can be balanced according to the actual application requirements in the optimization process. When training the model, each target can be optimized in the direction of reducing the loss, so that the overall loss of the model can be minimized, thereby further improving the music recommendation accuracy of the obtained music recommendation model.
[0068] In one embodiment, the number of music information sequences is multiple; each music information sequence is used to represent music information of different types of associated music; for example Figure 3 As shown in FIG. 1, step S102 can further include:
[0069] Step S301, obtaining a first music information sequence from the multiple music information sequences, and obtaining music identifiers of each sample music.
[0070] In the embodiment, the music information sequence can be of multiple types, each corresponding to music information of different types of associated music. For example, the music information sequence A can be a sequence information composed of music identifiers of the associated music, and the music information sequence B can be a sequence information composed of authors of the associated music, and so on. The first music information sequence is selected according to a preset condition. For example, a certain type of music information can be preset, so that the music information sequence containing the preset type of music information is used as the first music information sequence. For example, if the preset type is the music identifier type, the server can use the music information sequence A composed of music identifiers as the first music information sequence. The music identifier of the sample music is used to identify the sample music, for example, the music id of the sample music. The music identifier of the sample music can be set in the sample feature, so that the server extracts it from the sample feature.
[0071] Specifically, the server can select, from the plurality of sets of music information sequences of the associated music, a set of music information sequences in which the type of music information included is the preset type, as the first set of music information, and obtain the music identifiers of the sample musics.
[0072] In step S302, the music identifiers of the sample musics are subjected to target attention mechanism processing with the music information of the associated music included in the first set of music information, to obtain the attention weight features of the sample musics corresponding to different associated music.
[0073] After the first set of music information is determined, the server can perform target attention mechanism processing, i.e., target attention, on the music identifiers of the sample musics respectively with the music information of the associated music included in the first set of music information, to obtain the attention weights of the sample musics corresponding to different associated music as the attention weight features.
[0074] In step S303, the similarity degrees of the associated music are obtained based on the first set of music information, and the prior features corresponding to the sample user are obtained based on the similarity degrees.
[0075] After the first set of music information is obtained, the music information of the associated music included in the first set of music information can also be used to obtain the similarity degrees between each pair of associated music, and finally the prior features corresponding to the sample user can be obtained based on the similarity degrees.
[0076] In this embodiment, the server can also filter the first set of music information from the sets of music information composed of multiple types of music information of the associated music, and obtain the attention weight features and the prior features through the first set of music information. In this way, the accuracy of obtaining the attention weight features and the prior features can be improved.
[0077] In one embodiment, step S103 can further include: embedding the sample features to obtain sparse features; performing sum-pooling processing on a second set of music information in the plurality of sets of music information to obtain sum-pooling features; the second set of music information being a set of music information in the plurality of sets of music information other than the first set of music information; and splicing the sparse features, the sum-pooling features, the attention weight features, and the prior features to obtain spliced features.
[0078] The sparse features refer to sparse features, which can be obtained by embedding the sample features, i.e., the user features of the sample user and the music features of the sample music.
[0079] The second music information sequence refers to a music information sequence other than the first music information sequence in the plurality of music information sequences. For example, the first music information sequence refers to an information sequence composed of music identifiers of the respective associated musics, and the second music information sequence can refer to an information sequence composed of music authors of the respective associated musics. The server can also perform sum pooling processing on the second music information sequence in the plurality of music information sequences, that is, sum pooling processing, to obtain a corresponding feature, that is, a sum pooling feature.
[0080] Finally, the server can also perform splicing processing on the sparse feature, the sum pooling feature, the attention weight feature, and the prior feature, for example, performing concat processing on the above features to obtain a spliced feature.
[0081] In this embodiment, the spliced feature can be obtained by splicing the sparse feature, the sum pooling feature, the attention weight feature, and the prior feature. The sparse feature can be obtained by embedding processing, and the sum pooling feature is obtained by sum pooling processing on the second music information sequence. In this way, the feature integrity of the spliced feature can be improved.
[0082] In one embodiment, the similarity degree is represented by the cosine distance between the music information corresponding to the associated music; as shown in Figure 4 As shown in FIG. 3, step S303 can further include:
[0083] Step S401: obtaining a current associated music, obtaining music information corresponding to the current associated music and music information corresponding to each of the remaining associated musics from the first music information sequence; the current associated music is any one of the associated musics, and the remaining associated musics are other associated musics except the current associated music.
[0084] The current associated music refers to any one of the associated musics corresponding to the sample user, and the remaining associated music refers to other associated music in the associated music except the current associated music. For example, the first music information sequence can include music information of associated music A, music information of associated music B, and music information of associated music C. If the server takes associated music A as the current associated music, then associated music B and associated music C are other associated musics. Similarly, if the server takes associated music B as the current associated music, then associated music A and associated music C are other associated musics.
[0085] Step S402: constructing a similarity matrix according to the cosine distance between the music information corresponding to the current associated music and the music information corresponding to each of the remaining associated musics, and using the cosine distance corresponding to each of the current associated musics.
[0086] In this embodiment, the similarity degree between the associated music can be calculated by the cosine distance between the music information of the associated music, and the similarity matrix is a matrix formed by the cosine distance between the music information of the associated music. Specifically, the server can take each associated music as the current associated music respectively, and determine the corresponding other associated music of each current associated music, and then calculate the cosine distance between the music information of each current associated music and the music information of each other associated music, so as to construct the similarity matrix by using the cosine distance.
[0087] In step S403, the maximum matrix element is obtained from the similarity matrix, and the prior feature is obtained according to the maximum matrix element and the normal distribution constructed in advance.
[0088] The maximum matrix element refers to the maximum matrix element value in the similarity matrix, that is, the maximum cosine distance between the music information of two associated music. After obtaining the similarity matrix, the server can also filter out the matrix element with the maximum element value, and then multiply the maximum matrix element and the normal distribution to obtain the prior feature.
[0089] In this embodiment, the server can also construct the similarity matrix by calculating the cosine distance between the music information of the associated music in the first music information sequence, and further obtain the prior feature by multiplying the maximum matrix element in the similarity matrix and the normal distribution. The prior feature can represent whether the preference of the sample user is concentrated (or single). Specifically, since the elements in the similarity matrix represent the similarity degree between each associated music, that is, the music interested by the sample user, the greater the prior feature is, the greater the maximum matrix element in the similarity matrix is, and the more non-single (non-single means dispersed, that is, the sample user likes multiple types of music) the preference of the sample user is. On the contrary, if the sample user only likes a certain type of music, the maximum matrix element in the similarity matrix will be smaller, that is, the preference of the sample user is more single.
[0090] Whether the preference of the user is single will affect the accuracy of the recommendation, for example, the preference of a single type can recommend similar type of music. Therefore, the prior feature obtained by the above method can reflect whether the music preference of the sample user is single, thereby providing a basis for music recommendation.
[0091] In an embodiment, step S103 can further include: inputting the spliced features into a mask network of the music recommendation model to obtain mask features matched with the spliced features; inputting the mask features into a shared expert layer of the music recommendation model to obtain a predicted click rate of each sample music by the sample user and a predicted play amount of each sample music by the sample user; and obtaining a predicted play duration of each sample music by the sample user according to the mask features, the predicted click rate of each sample music by the sample user and the predicted play amount of each sample music by the sample user.
[0092] The mask features refer to the features output after the mask network, and the shared expert layer can be implemented by an AdaTT+PPNet structure composed of 1 DCN and 2 DNNs. Specifically, the server can input the spliced features into the mask network in the recommendation model, output the mask features by the mask network, and then input the mask features into the shared expert layer to output the predicted click rate of each sample music by the sample user and the predicted play amount of each sample music by the sample user through the shared expert layer.
[0093] Then, since the predicted play duration of the sample music is the product after the click and the play, after obtaining the predicted click rate and the predicted play amount, the predicted click rate and the predicted play amount can be combined with the original mask features to be input into a task for predicting the music play duration, so as to obtain the predicted play duration of each sample music by the sample user.
[0094] In the embodiment, the server can also obtain the mask features through the mask network, and obtain the predicted click rate and the predicted play amount through the shared expert layer, and then combine the mask features, the predicted click rate and the predicted play amount to obtain the predicted play duration. In this way, the prediction accuracy of the click rate, the play amount and the play duration can be improved.
[0095] In an embodiment, as shown in FIG. 5, Figure 5 a music recommendation method is provided. It can be understood that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and can be realized through the interaction of the terminal and the server. In the embodiment, the method includes the following steps:
[0096] Step S501: obtaining a target user to be recommended music and candidate recommended music to be recommended to the target user.
[0097] The target user refers to a user who needs to be recommended music, for example, can be a user triggering a music recommendation request, and the candidate recommended music refers to music to be recommended to the target user, which can be all music in a music library or music pre-screened.
[0098] In step S502, the music features of the target user and each candidate recommended music are input into a pre-trained music recommendation model, and the predicted interaction results of the target user for each candidate recommended music under multiple different prediction targets are obtained through the music recommendation model. The music recommendation model is obtained by processing the music recommendation model through the music recommendation model processing method of any one of the above embodiments.
[0099] After obtaining the target user and each candidate recommended music, the features of the target user and each candidate recommended music can be input into the pre-processed music recommendation model, which can be obtained by processing the music recommendation model through the music recommendation model processing method provided in the above embodiments, so as to output the predicted interaction results of the target user for each candidate recommended music under multiple different prediction targets through the music recommendation model, for example, the predicted recommendation scores of the target user for each candidate recommended music under multiple different prediction targets.
[0100] In step S503, the target recommended music is obtained from the candidate recommended music according to the predicted interaction results, and the target recommended music is recommended to the target user.
[0101] The target recommended music refers to the music finally recommended to the target user. After obtaining the predicted interaction results of the target user for each candidate recommended music, the comprehensive predicted interaction results can be obtained based on the predicted interaction results under multiple different prediction targets, and the target recommended music is selected from the candidate recommended music and recommended to the target user, for example, a preset number of candidate recommended music with the highest comprehensive predicted recommendation score can be selected as the target recommended music according to the comprehensive predicted recommendation score of the target user for each candidate recommended music, and recommended to the target user.
[0102] In the music recommendation method, a target user to be recommended music and candidate recommendation music to be recommended to the target user are obtained; features of the target user and each candidate recommendation music are input into a pre-trained music recommendation model, and a predicted interaction result of the target user for each candidate recommendation music is obtained through the music recommendation model; the music recommendation model is obtained through the music recommendation model processing method in any one of the above embodiments; and the target recommendation music is obtained from the candidate recommendation music according to the predicted interaction result, and the target recommendation music is recommended to the target user. In the music recommendation method provided in the present application, music recommendation can be performed through a pre-processed music recommendation model, and the model introduces prior features related to user-associated music in the processing process, which can slow down the mutual restraint between different targets, so that the music recommendation implemented through the model can improve the accuracy of music recommendation.
[0103] In one embodiment, a music recommendation model training method and a music recommendation method implemented through the music recommendation model are also provided. The model can effectively represent user prior information, and end-to-end learning combines different prediction targets. By analyzing the similarity of the user's music information sequence feature and the candidate result and inputting them into the model, the model can effectively supplement the prior knowledge of whether the user's interest is single, and reduce the learning difficulty of the model. At the same time, auxiliary networks are added to optimize the loss direction of each prediction target, so that the model reaches the optimal in the overall loss direction.
[0104] The specific structure of the model can be as shown in Figure 6 The features input into the model include two kinds, one is sparse sample feature, i.e., sparse feature, and the other is music information sequence feature. In addition to the sum pooling and target attention operations in the traditional way, the sequence feature will additionally calculate a similarity matrix according to the user's music information sequence, multiply the maximum value in the similarity matrix by a normal distribution, and finally input the combined input information into the model. If the user's interest is relatively single, the music information of each associated music of the user is relatively close, the maximum value of the similarity matrix is relatively small, the value after multiplication by the normal distribution is relatively small, and the input prior feature value is also relatively small. Similarly, if the user's interest is diverse, the similarity matrix value is relatively large, and the input prior feature value is also relatively large. In this way, some prior knowledge such as music information sequence can be input into the model in advance, and the learning difficulty of the model can be reduced.
[0105] On the other hand, a fusion network of the music recommendation model is constructed, and the results of the network are weighted for each target. Finally, the combined results and the labels of each target are calculated for loss. In the process of model training, the calculation of the similarity matrix can provide prior knowledge for the model and reduce the difficulty of model learning. The auxiliary fusion network can learn the output of combining different targets, so that the model reaches the optimal in the overall loss direction. The specific training process can include the following steps:
[0106] Step 1, the model input contains user features of sample users and music features of sample music. The user features mainly include user attribute features and user sequence features. Specifically, the attribute features include user id, age, gender, city level, education, user platform activity, etc. The sequence features include the sequence of associated music information of the user's recent preset association behavior, i.e. complete playback behavior. The music features are divided into music attribute features and music popularity features. The attribute features include id, album, singer, release year, language, etc. The popularity features include the playback quantity, complete playback times, sharing quantity, etc. which can measure the normalized score of the popularity of the music.
[0107] Step 2, the music information sequence and sample music id are subjected to target attention to obtain the attention weight of each sample music corresponding to different associated music. At the same time, the cosine distance between the user sequence features is calculated to obtain the similarity matrix. The maximum distance score is selected and multiplied by the normal distribution as prior knowledge information. The user features and music features are embedded to obtain sample features, and the prior knowledge is input into the model.
[0108] Step 3, the mask network is used to screen the importance of the existing features. The prediction results of the click target and the play target are obtained through the upper layer shared expert. The shared expert is composed of an AdaTT+PPNet structure consisting of 1 DCN and 2 DNNs.
[0109] Step 4, since the duration is the product of click and play, the prediction results of the click target and the play target are input into the duration target task together with the mask feature to obtain the output result of the duration target.
[0110] Step 5, the auxiliary fusion network is constructed to weight the prediction results of the three targets to obtain the comprehensive prediction interaction result. The output of the three targets and the actual interaction result are calculated for BCE loss.
[0111] After the model training is completed, the music recommendation can be realized through the music recommendation model, which can include the following steps:
[0112] Step 1, the model online input user features and music features, and the scoring of each candidate music is obtained through the network of the ranking model.
[0113] Step 2, recommend the top k music according to the descending order of the model score.
[0114] In this embodiment, the similarity of the music information sequence composed of the music information of the associated music corresponding to the user is calculated to obtain prior knowledge to reduce the complexity of model learning, and the auxiliary fusion network is used to learn the optimal combination of different target outputs, so that the model reaches the optimal in the overall loss direction. Thus, multi-target modeling optimization is realized, and the precision of the recommended music of the model is improved.
[0115] It should be understood that, although each step in the flowchart involved in each embodiment as described above is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.
[0116] Based on the same inventive concept, the embodiments of the present application also provide a music recommendation model processing device and a music recommendation device for implementing the music recommendation model processing method and the music recommendation method described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more music recommendation model processing device and music recommendation device embodiments provided below can refer to the limitations of the music recommendation model processing method and the music recommendation method described above, and will not be repeated here.
[0117] In one embodiment, as shown in Figure 7 A music recommendation model processing device is provided, comprising: a sample feature acquisition module 701, a sample feature processing module 702, a sub-target prediction module 703, and a recommendation model processing module 704, wherein:
[0118] The sample feature acquisition module 701 is configured to acquire sample features of a sample user and at least one sample music, and a music information sequence corresponding to the sample user. The music information sequence is composed of music information of multiple associated music, and the associated music is music that has a preset association behavior with the sample user.
[0119] The sample feature processing module 702 is configured to input the sample features and the music information sequence into the music recommendation model to be trained, acquire the attention weight features of each sample music corresponding to different associated musics through the music information sequence, and acquire the prior features corresponding to the sample user.
[0120] The sub-target prediction module 703 is configured to acquire the spliced features according to the sample features, the attention weight features, and the prior features, input the spliced features into a mask network of the music recommendation model, and acquire the predicted interaction results of the sample user to each sample music under a plurality of different prediction targets, the prediction targets including at least two of the predicted click rate, the predicted play quantity, and the predicted play duration.
[0121] The recommendation model processing module 704 is configured to train the music recommendation model according to the predicted interaction results of the sample user to each sample music under a plurality of different prediction targets.
[0122] In one embodiment, as shown in FIG. 8, Figure 8 a music recommendation apparatus is provided, which includes a recommendation information acquisition module 801, a predicted interaction acquisition module 802, and a music recommendation module 803, wherein:
[0123] The recommendation information acquisition module 801 is configured to acquire a target user to be recommended music and a plurality of candidate recommendation musics to be recommended to the target user.
[0124] The predicted interaction acquisition module 802 is configured to input the music features of the target user and each candidate recommendation music into a pre-trained music recommendation model, acquire the predicted interaction results of the target user to each candidate recommendation music under a plurality of different prediction targets through the music recommendation model, and acquire the predicted interaction results of the target user to each candidate recommendation music under a plurality of different prediction targets through the music recommendation model.
[0125] The music recommendation module 803 is configured to recommend a target recommendation music in the plurality of candidate recommendation musics to the target user according to the predicted interaction results of the target user to each candidate recommendation music under a plurality of different prediction targets.
[0126] Each module in the music recommendation model processing apparatus and the music recommendation apparatus described above can be realized by software, hardware, and a combination thereof in whole or in part. Each module described above can be embedded in or independent of a processor in a computer device in a hardware form, or stored in a memory in a computer device in a software form, so as to be called and executed by a processor to perform the operations corresponding to each module.
[0127] In one exemplary embodiment, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in FIG. 9. Figure 9As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capability. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store sample data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with the terminal outside through the network connection. The computer program is executed by the processor to realize a music recommendation model processing method.
[0128] Those skilled in the art can understand that, Figure 9 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0129] In one embodiment, a computer device is also provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to realize the steps in each of the above method embodiments.
[0130] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by the processor to realize the steps in each of the above method embodiments.
[0131] In one embodiment, a computer program product is provided, including a computer program, and the computer program is executed by the processor to realize the steps in each of the above method embodiments.
[0132] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.
[0133] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0134] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.
[0135] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A music recommendation model processing method, characterized in that, The method comprises: obtaining sample features of a sample user and at least one sample music, and a music information sequence corresponding to the sample user; wherein: the sample features are obtained by splicing user features of the sample user and music features of the sample music; the music information sequence is composed of music information of a plurality of associated music, the associated music being music having a preset association behavior with the sample user; the music information sequence includes a plurality of; the music information included in each of the music information sequence is different in type; inputting the sample features and the music information sequence into a music recommendation model to be trained, obtaining, by the music recommendation model, attention weight features of each of the sample music corresponding to different associated music through the music information sequence, and obtaining prior features corresponding to the sample user through the music information sequence; comprising: obtaining a first music information sequence from a plurality of the music information sequence, the first music information sequence including music information of a preset type; performing target attention mechanism processing on music identifiers of each of the sample music and music information of each associated music included in the first music information sequence to obtain attention weight features of each of the sample music corresponding to different associated music; obtaining similarity degrees of each of the associated music according to the first music information sequence, and obtaining prior features corresponding to the sample user based on the similarity degrees; obtaining, by the music recommendation model, spliced features according to the sample features, the attention weight features and the prior features, inputting the spliced features into a mask network of the music recommendation model, and obtaining predicted interaction results of the sample user to each of the sample music under a plurality of different prediction targets, the prediction targets including at least two of predicted click rate, predicted play amount and predicted play duration; the obtaining of the spliced features according to the sample features, the attention weight features and the prior features comprises: performing embedded processing on the sample features to obtain sparse features; performing sum-pooling processing on a second music information sequence in a plurality of the music information sequence to obtain sum-pooling features; the second music information sequence being a music information sequence other than the first music information sequence in a plurality of the music information sequence; and performing splicing processing on the sparse features, the sum-pooling features, the attention weight features and the prior features to obtain the spliced features; training the music recommendation model according to the predicted interaction results of the sample user to each of the sample music under a plurality of different prediction targets.
2. The method of claim 1, wherein, The training of the music recommendation model according to the predicted interaction results of the sample user to each of the sample music under a plurality of different prediction targets comprises: obtaining comprehensive predicted interaction results of the sample user to each of the sample music according to the predicted interaction results of the sample user to each of the sample music under a plurality of different prediction targets, and training the music recommendation model using the comprehensive predicted interaction results.
3. The method of claim 2, wherein, The method comprises: inputting the spliced features into a fusion network of the music recommendation model to obtain fusion weights corresponding to each of the prediction targets respectively; performing weighted processing on the prediction interaction results under each of the prediction targets by using the fusion weights corresponding to each of the prediction targets respectively to obtain the comprehensive prediction interaction results of the sample user for the sample music; training the music recommendation model according to the difference between the actual interaction results of the sample user for the sample music and the comprehensive prediction interaction results.
4. The method of claim 1, wherein, The similarity degrees of the associated music are represented by cosine distances between the music information of the associated music; The method comprises: obtaining music information of a current associated music and music information of each of the remaining associated music from the first music information sequence; the current associated music is any one of the associated music, and the remaining associated music is the associated music other than the current associated music; constructing a similarity matrix according to the cosine distances between the music information of the current associated music and the music information of each of the remaining associated music; obtaining the prior feature corresponding to the sample user according to the maximum matrix element in the similarity matrix and a pre-constructed normal distribution.
5. The method of claim 1, wherein, The method comprises: inputting the spliced features into a mask network of the music recommendation model to obtain mask features matched with the spliced features; inputting the mask features into a shared expert layer of the music recommendation model to obtain a predicted click rate of the sample user for each of the sample music and a predicted play amount of the sample user for each of the sample music; obtaining a predicted play duration of the sample user for each of the sample music according to the mask features, the predicted click rate of the sample user for each of the sample music and the predicted play amount of the sample user for each of the sample music.
6. A music recommendation method characterized by, The method comprises: obtaining a target user to be recommended music and a plurality of candidate recommended music to be recommended to the target user; inputting music features of the target user and each of the candidate recommended music into a pre-trained music recommendation model to obtain prediction interaction results of the target user for each of the candidate recommended music under a plurality of different prediction targets by the music recommendation model; the music recommendation model is obtained by processing the music recommendation model processing method in any one of claims 1 to 5; recommending a target recommended music in the plurality of candidate recommended music to the target user according to the prediction interaction results of the target user for each of the candidate recommended music under a plurality of different prediction targets. 7.A music recommendation model processing apparatus, characterized by comprising: The device comprises: The sample feature acquisition module is configured to acquire sample features of a sample user and at least one sample music, and a music information sequence corresponding to the sample user; wherein: the sample features are obtained by splicing user features of the sample user and music features of the sample music; the music information sequence is composed of music information of a plurality of associated musics, the associated musics being musics having a preset association behavior with the sample user; the music information sequence includes a plurality of music information sequences; each of the music information sequences includes music information of different types; The sample feature processing module is configured to input the sample features and the music information sequence into a music recommendation model to be trained, acquire, by the music recommendation model, attention weight features of each of the sample musics corresponding to different associated musics through the music information sequence, and acquire a prior feature corresponding to the sample user through the music information sequence; further configured to acquire a first music information sequence from a plurality of the music information sequences, the first music information sequence including music information of a preset type; perform target attention mechanism processing on music identifiers of each of the sample musics and music information of each of the associated musics included in the first music information sequence, to obtain the attention weight features of each of the sample musics corresponding to different associated musics; acquire a similarity degree of each of the associated musics according to the first music information sequence, and obtain the prior feature corresponding to the sample user based on the similarity degree; The sub-target prediction module is configured to acquire, by the music recommendation model, a splicing feature from the sample features, the attention weight features, and the prior feature, input the splicing feature into a mask network of the music recommendation model, and obtain predicted interaction results of the sample user on each of the sample musics under a plurality of different prediction targets, the prediction targets including at least two of a predicted click rate, a predicted play amount, and a predicted play duration; further configured to perform embedded processing on the sample features to obtain a sparse feature; perform sum-pooling processing on a second music information sequence in the plurality of music information sequences to obtain a sum-pooling feature; the second music information sequence being a music information sequence other than the first music information sequence in the plurality of music information sequences; and perform splicing processing on the sparse feature, the sum-pooling feature, the attention weight features, and the prior feature to obtain the splicing feature; The recommendation model processing module is configured to train the music recommendation model according to the predicted interaction results of the sample user on each of the sample musics under a plurality of different prediction targets.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 6.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6. The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Music multi-modal data-based user long and short term preference recommendation prediction method
CN114254205A
Method for playing music according to road type and playing system
WO2018032138A1