Model training method, music recommendation method, device and computer program product
By performing feature extraction and user feature fusion training on the emotion recognition model, combined with the weight correction module, the problem of inaccurate emotions recognition of different users in the prior art is solved, and higher accuracy and personalized application of emotion recognition are achieved.
Patent Information
- Application Number
- CN202411783917.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-28
AI Technical Summary
The existing emotion recognition model cannot accurately identify the emotions of different users about music, resulting in low recognition accuracy and affecting practical applications.
The pre-trained feature extraction module is used to extract the sample songs, and the training recognition module is trained to obtain the sentiment analysis model. This model uses the weight correction module to adjust the intermediate layer feature weight of the objective emotion recognition module based on user characteristics, and captures the sensitivity of different users to songs.
The accuracy of the emotion recognition model for song emotions is improved, personalized recognition of the emotions of different users is realized, and the application value of the model in practical applications is enhanced.
Smart Images

Figure CN119719776A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and more specifically, to a model training method, a music recommendation method, a model training device, a music recommendation device, a computer program product, and an electronic device. Background Art
[0002] With the rapid development of the Internet and computer technology, users can listen to their favorite music at any time through various music platforms. Currently, more music of interest can be recommended to users by processing the audio signals of songs, or identifying the emotions brought by music through multimodal information (such as audio and text), or combining audio signal processing and multimodal information recognition to determine the emotions brought by music. However, the current emotion recognition model cannot accurately identify the emotions of different users towards music, and the recognition accuracy of the emotion recognition model is not high, which affects the practical application of the emotion recognition model to a certain extent.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0004] The purpose of the present disclosure is to provide a model training method and device, a music recommendation method and device, a computer program product and an electronic device, thereby improving the accuracy of analyzing music emotions by an emotion analysis model at least to a certain extent.
[0005] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0006] According to one aspect of the present disclosure, a model training method is provided, including: extracting features of sample songs based on a pre-trained feature extraction module to obtain song features; training a first recognition module to be trained according to the song features, sample songs and first emotion labels of the sample songs to obtain an objective emotion recognition module; determining a second recognition module to be trained according to the objective emotion recognition module and a weight correction module, the weight correction module being used to adjust the weights of intermediate layer features of a target intermediate layer of the objective emotion recognition module based on user features; obtaining sample user features corresponding to sample users and second emotion labels of sample users for sample songs; training the second recognition module to be trained according to the sample user features, sample songs, song features and second emotion labels, so as to determine an emotion analysis model according to the obtained recognition module and the pre-trained feature extraction module.
[0007] In an exemplary embodiment of the present disclosure, a second recognition module to be trained is trained according to sample user features, sample songs, song features and a second emotion label, including: inputting song features and sample songs into an objective emotion recognition module, and extracting intermediate layer features of a target intermediate layer of the objective emotion recognition module; fusing the intermediate layer features with sample user features through a weight correction module to obtain fused features; inserting the fused features into the objective emotion recognition module as the output of the target intermediate layer, so that the objective emotion recognition module outputs an emotion prediction result, and adjusting the parameters in the second recognition module to be trained according to the model loss determined according to the emotion prediction result and the second emotion label.
[0008] In an exemplary embodiment of the present disclosure, sample user features include user attribute features and user interaction features; the intermediate layer features and the sample user features are fused and calculated through a weight correction module to obtain fused features, including: the user attribute features and the user interaction features are fused and calculated through a weight correction module to obtain reference features; according to preset weight information, the reference features and the intermediate layer features are fused and calculated to obtain fused features.
[0009] In an exemplary embodiment of the present disclosure, the intermediate layer features and the sample user features are fused and calculated through a weight correction module to obtain fused features, including: obtaining scene features corresponding to the sample user, the scene features are used to indicate the current listening scene of the sample user; the intermediate layer features, the sample user features and the scene features are fused and calculated through a weight correction module to obtain fused features.
[0010] In an exemplary embodiment of the present disclosure, the first emotion label is an expert experience label, and the second emotion label is a non-expert experience label; obtaining sample user features corresponding to the sample user and the second emotion label of the sample user for the sample song includes: extracting reference user features of the sample user, and dividing the sample users into multiple user category groups according to the reference user features; for each user category group, determining the sample user features corresponding to the user category group according to the reference user features in the user category group, so as to determine the sample user features corresponding to the user category group as the sample user features corresponding to the sample users in the user category group; for each user category group, determining the second emotion label according to the reference emotion label of the sample users in the user category group for the sample song.
[0011] In an exemplary embodiment of the present disclosure, for each user category group, a second emotion label is determined based on a reference emotion label of a sample song by sample users in the user category group, including: clustering the reference emotion labels of the sample songs by sample users in the user category group to obtain a plurality of label clusters; and determining the second emotion label of the sample songs by the sample users in the user category group from the plurality of label clusters.
[0012] In an exemplary embodiment of the present disclosure, a sentiment analysis model is determined based on an obtained recognition module and a pre-trained feature extraction module, including: cascading the pre-trained feature extraction module with the target objective emotion recognition module in the obtained recognition module; and inserting a target weight correction module in the obtained recognition module after the target intermediate layer in the target objective recognition emotion recognition module, so that the target weight correction module adjusts the weight of the intermediate layer features of the target intermediate layer in the target objective recognition emotion recognition module.
[0013] According to one aspect of the present disclosure, a music recommendation method is provided, including: obtaining user information and listened songs of a current user; based on the user information and listened songs, obtaining the current emotion of the current user towards the listened songs through a sentiment analysis model; wherein the sentiment analysis model is obtained by the model training method of any one of the embodiments of the present disclosure; and recommending songs to the current user based on the current emotion.
[0014] In an exemplary embodiment of the present disclosure, obtaining user information of the current user includes: responding to a touch operation for song listening interaction information, and obtaining user information corresponding to the touch operation; wherein the song listening interaction information is used to indicate whether the current user actively initiates music recommendation.
[0015] In an exemplary embodiment of the present disclosure, the method further includes: obtaining, based on the user information, sample user features corresponding to the sample user and a second emotion label for the sample song, for iterative training of the emotion analysis model.
[0016] According to one aspect of the present disclosure, a model training device is provided, including: a song feature extraction module, used to extract features of sample songs based on a pre-trained feature extraction module to obtain song features; a first training module, used to train a first recognition module to be trained according to song features, sample songs and first emotion labels of sample songs to obtain an objective emotion recognition module; a weight feature module, used to determine a second recognition module to be trained according to the objective emotion recognition module and a weight correction module, the weight correction module being used to adjust the weights of intermediate layer features of a target intermediate layer of the objective emotion recognition module based on user features; a user feature acquisition module, used to obtain sample user features corresponding to sample users and second emotion labels of sample users for sample songs; a second training module, used to train the second recognition module to be trained according to sample user features, sample songs, song features and second emotion labels, so as to determine an emotion analysis model according to the obtained recognition module and the pre-trained feature extraction module.
[0017] According to one aspect of the present disclosure, a music recommendation device is provided, including: an information acquisition module, used to obtain user information and listened songs of a current user; an emotion recognition module, used to obtain the current emotion of the current user towards the listened songs through an emotion analysis model based on the user information and listened songs; wherein the emotion analysis model is obtained by model training based on the model training method of any one of the embodiments of the present disclosure; and a music recommendation module, used to recommend songs to the current user according to the current emotion.
[0018] According to one aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, any one of the above methods is implemented.
[0019] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any one of the above methods by executing the executable instructions.
[0020] The technical solution in the exemplary embodiment of the present disclosure, on the one hand, extracts features of sample songs based on a pre-trained feature extraction module to obtain song features, and trains a first recognition module to be trained based on the song features, sample songs and the first emotion labels of the sample songs to obtain an objective emotion recognition module, which can objectively analyze the emotions of songs; on the other hand, a second recognition module to be trained is determined based on the objective emotion recognition module and the weight correction module, and the weight correction module is used to adjust the weights of the intermediate layer features of the target intermediate layer of the objective emotion recognition module based on user features, and then obtains the sample user features corresponding to the sample users and the second emotion labels of the sample users for the sample songs, and finally, the second emotion labels of the sample users for the sample songs are obtained based on the sample user features. The second recognition module to be trained is trained based on the features, song samples, song features and second emotion labels, so as to determine the emotion analysis model according to the obtained recognition module and the pre-trained feature extraction module. The process adjusts the weights of the intermediate layer features of the objective emotion module based on the user features through the weight correction module, so as to capture the sensitivity of different users to songs, so that the obtained recognition module can analyze the objective emotions of the song while being able to predict the emotions of different users to the song in a targeted manner. That is, the trained emotion analysis model increases the user's subjective emotion recognition of the song when analyzing the emotion of the song, which can realize the emotion recognition of thousands of songs with different faces, and improves the accuracy of the emotion recognition model in identifying the emotion of the song.
[0021] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the following detailed description with reference to the accompanying drawings, in which several embodiments of the present disclosure are shown in an exemplary and non-limiting manner.
[0023] Figure 1 A schematic diagram showing the stages involved in a music emotion analysis solution according to an exemplary embodiment of the present disclosure is shown.
[0024] Figure 2 A flowchart of a model training method according to an exemplary embodiment of the present disclosure is shown.
[0025] Figure 3 A schematic diagram of training a first recognition module according to an exemplary embodiment of the present disclosure is shown.
[0026] Figure 4 A schematic diagram of training a second recognition module to be trained according to an exemplary embodiment of the present disclosure is shown.
[0027] Figure 5 A flowchart of an implementation method for training a second recognition module to be trained according to an exemplary embodiment of the present disclosure is shown.
[0028] Figure 6 A schematic diagram of a sentiment analysis model according to an exemplary embodiment of the present disclosure is shown.
[0029] Figure 7 A flow chart of an implementation method for acquiring a second emotion tag according to an exemplary embodiment of the present disclosure is shown.
[0030] Figure 8 A flowchart of a music recommendation method according to an exemplary embodiment of the present disclosure is shown.
[0031] Fig. 9 A schematic diagram of the composition of a model training device according to an exemplary embodiment of the present disclosure is shown.
[0032] Fig.10 A schematic diagram showing the composition of a music recommendation device according to an exemplary embodiment of the present disclosure is shown.
[0033] Fig.11 A block diagram of an electronic device according to an exemplary embodiment of the present disclosure is shown.
[0034] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION
[0035] The exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the present disclosure will be more comprehensive and complete and the concepts of the exemplary embodiments will be fully conveyed to those skilled in the art. The same reference numerals in the figures represent the same or similar structures, and thus their detailed description will be omitted.
[0036] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known structures, methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0037] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or these functional entities or parts of functional entities may be implemented in one or more software hardened modules, or these functional entities may be implemented in different networks and / or processor devices and / or microcontroller devices.
[0038] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0039] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0040] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning.
[0041] The technical solution provided by the embodiment of the present disclosure involves machine learning technology of artificial intelligence, which uses machine learning technology to train the model based on features extracted from sample songs and sample users to obtain an emotion analysis model for identifying music emotions. It should be noted that the emotion analysis model of the embodiment of the present disclosure can be applied to any scenario that requires accurate analysis of the user's listening emotions, such as a music listening program or a music listening web page, and there is no specific limitation on this.
[0042] Figure 1 A schematic diagram of the stages involved in the music emotion analysis solution of the embodiment of the present disclosure is shown, such as Figure 1 As shown, the technical solution of the embodiment of the present disclosure includes a model training stage and a model application stage.
[0043] In the embodiments of the present disclosure, the provided model training method and music recommendation method can be executed by a terminal device. In this way, all steps in the model training method and music recommendation method provided in the embodiments of the present disclosure can be executed by the terminal device, and all steps can be executed by the processor of the terminal device.
[0044] The terminal device can be an intelligent device with data processing capabilities, such as monitoring equipment, smart phones, computers, tablet computers, vehicle-mounted devices, wearable devices and other intelligent devices. The terminal device can also be called a mobile terminal, terminal, mobile device, etc. The present disclosure does not limit the type of terminal device.
[0045] Furthermore, the technical solution provided in the embodiment of the present disclosure may also be executed by a server. Correspondingly, in this mode of execution by a server, the server may start executing the steps in the technical solution of the embodiment of the present disclosure in response to a trigger instruction, wherein the trigger instruction may be sent by a terminal device used by a user, or may be triggered locally by the server in response to some automation events. The server may be a background system that provides relevant services in the embodiment of the present disclosure, and may include a single electronic device with computing functions such as a portable computer, a desktop computer, a smart phone, or a cluster formed by multiple electronic devices.
[0046] In addition, the technical solution of the embodiment of the present disclosure can also be executed by the terminal device and the server in collaboration. In this way of collaborative execution by the electronic device and the server, some steps in the technical solution provided by the embodiment of the present disclosure are executed by the terminal device, while other steps are executed by the server. For example, the technical solution provided by the embodiment of the present disclosure can be executed by the server in the model training phase, and the trained emotion analysis model is sent to the terminal device, and the terminal device executes the model application phase.
[0047] It should be noted that in this method of collaborative execution by the terminal device and the server, the steps respectively executed by the terminal device and the server can be dynamically adjusted according to actual conditions, and the embodiments of the present disclosure do not impose any special restrictions on this.
[0048] In the current music emotion analysis methods, they mainly rely on audio signal processing technology, or identify the emotions brought by music through multimodal information (such as audio, text), or combine audio signal processing and multimodal information recognition to determine the emotions brought by music. However, this emotion recognition method often ignores the emotional experience of different users to music, and cannot accurately reflect the emotional response of different users to the same music. For example, people of different ages, genders, regions, and cultures will have different emotions when listening to the same song due to individual differences. However, the current emotion recognition model cannot accurately identify the emotions of different users to music, and the recognition accuracy of the emotion recognition model is not high, which affects the practical application of the emotion recognition model to a certain extent.
[0049] It should be noted that the information involved in the embodiments of the present disclosure (including but not limited to: information input by the user, for example, information input by the user into the input box), data (including but not limited to data used for analysis, stored data, displayed data, etc., for example, user information and information on songs listened to by the user, etc.) are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards. For example, the user information and songs listened to by the current user involved in the embodiments of the present disclosure, the sample songs used for model training, the relevant information of the sample user, etc. are all obtained with full authorization.
[0050] like Figure 2 The flowchart of a model training method of an exemplary embodiment of the present disclosure is shown, and the model training method includes steps S210 to S250, which are specifically as follows:
[0051] In step S210, feature extraction is performed on the sample song based on the pre-trained feature extraction module to obtain song features.
[0052] In an exemplary embodiment of the present disclosure, the pre-trained feature extraction module is trained based on multi-dimensional sample song features. The pre-trained feature extraction module may adopt an autoencoder structure, such as a feature extraction module based on a Transformer (a language processing model) structure. There is no specific restriction on the network structure of the feature extraction module.
[0053] Among them, the multi-dimensional sample song features of the sample songs can be collected, including but not limited to rhythm, BPM (Beat Per Minute), loudness, melody contour, lyrics, harmony, timbre, paragraph division, mode, singing skills (such as falsetto, real voice), music genre, etc. When training the feature extraction module, the audio of the sample song can be input into the feature extraction model to be trained to obtain a classifier for song feature recognition, that is, a feature extraction model.
[0054] By training the feature extraction model with multi-dimensional sample song features, the objective features of the song (i.e., song features) can be provided for a comprehensive understanding of the subsequent sentiment analysis, which is conducive to a better understanding of the emotions conveyed by the song and improving the emotion recognition accuracy of the sentiment analysis model.
[0055] In step S220, the first recognition module to be trained is trained according to the song features, the sample songs and the first emotion labels of the sample songs to obtain an objective emotion recognition module.
[0056] In an exemplary embodiment of the present disclosure, the sample songs can be selected from various types of songs of different styles and languages, and the first emotion label of the sample songs is an expert experience label, which can be obtained by experts who are proficient in the field of music or themes labeling the sample songs. Among them, the first emotion label can be selected from excitement, anger, happiness, calmness, sadness, depression, relaxation and other emotions, and there is no limitation on this.
[0057] Among them, the first recognition module to be trained can be constructed using a lightweight neural network, such as CNN (Convolutional Neural Network), RNN (Recurrent Neural Networks), DNN (Deep Neural Networks), etc. Compared with lightweight neural networks, a speech recognition model with a more complex network structure can also be used, for example, a heavyweight neural network can be used to construct it, such as Variational Autoencoders (VAE), BERT (Bidirectional Encoder Representation from Transformers, feature encoder of bidirectional Transformers), Transformer, and any heavyweight neural network that can be used for emotion recognition. Furthermore, the first recognition module to be trained can also be a large model of 100 million levels, referring to a deep learning model trained using a large amount of data. The exemplary embodiment of the present disclosure is described by taking the Transformer large model architecture with an attention mechanism as an example of the first recognition module to be trained.
[0058] Specifically, Figure 3 As shown, song features and sample songs (song audio) can be input into the first recognition module to be trained, and the first emotion label of the sample song can be used as the sample label for training. The parameters in the first recognition module to be trained can be adjusted until the training stop condition (such as module convergence) is met, and an objective emotion recognition module is obtained. The objective emotion recognition module can identify the emotion of the song from the objective perspective of the song itself.
[0059] Optionally, to improve the efficiency of model training, the sample song can be split into multiple audio clips for input, and the corresponding song features are also input into the model in a corresponding split manner. For example, the sample song is split into 10s audio clips for input into the model, and the song features are divided into 10s and input into the model. By using the segmented input method, the model's reasoning efficiency can be ensured.
[0060] In step S230, a second recognition module to be trained is determined according to the objective emotion recognition module and the weight correction module.
[0061] In an exemplary embodiment of the present disclosure, the weight correction module is used to adjust the weights of the intermediate layer features of the target intermediate layer of the objective emotion recognition module based on user features, wherein the target intermediate layer can make the objective emotion recognition module located in the middlemost neural network layer or other neural network layers located in the middle, which can be flexibly selected according to task requirements and is not particularly limited.
[0062] like Figure 4 A schematic diagram of training a second recognition module to be trained is shown, Figure 4 As shown, for the objective emotion recognition module that has been trained, the neural network weights before and after the target middle layer can be fixed, and only the middle layer features of the target middle layer can be extracted. The weights of the middle layer features can be adjusted through the weight correction module, and then inserted into the objective emotion recognition module for further processing.
[0063] Among them, the input of the weight correction module is sample user characteristics, including but not limited to age, gender, personality, culture, job type, etc., and the input of the objective emotion recognition module is sample songs and song characteristics.
[0064] In step S240, sample user features corresponding to the sample users and second emotion labels of the sample users for the sample songs are obtained.
[0065] In an exemplary embodiment of the present disclosure, the second emotion label of the sample user for the sample song is a non-expert experience label. The second emotion label can be determined by the real emotions of different types of users for the sample song. Different user groups can be selected as much as possible to label the sample songs with emotions to ensure the comprehensive accuracy of the second emotion label.
[0066] Exemplarily, a sample pair can be determined based on the sample user characteristics and the second emotion label of the sample song based on the sample user characteristics as follows: sample user: {age: 20, gender: male, personality: lively and cheerful, education: undergraduate, job: civil servant, second emotion label: cheerful}.
[0067] In step S250, the second recognition module to be trained is trained according to the sample user characteristics, the sample songs, the song characteristics and the second emotion tag, so as to determine the emotion analysis model according to the obtained recognition module and the pre-trained feature extraction module.
[0068] In an exemplary embodiment of the present disclosure, after obtaining sample user features, sample songs, song features, and second emotion labels, the second recognition module to be trained can be deeply trained to enhance the model's ability to recognize emotions when different users listen to songs. This process uses a weight correction module to determine the sensitivity of different sample users to song features based on different sample user features, thereby individually identifying the exclusive emotions of different sample users to sample songs.
[0069] The technical solution in the exemplary embodiment of the present disclosure, on the one hand, extracts features of sample songs based on a pre-trained feature extraction module to obtain song features, and trains a first recognition module to be trained based on the song features, sample songs and the first emotion labels of the sample songs to obtain an objective emotion recognition module, which can objectively analyze the emotions of songs; on the other hand, a second recognition module to be trained is determined based on the objective emotion recognition module and the weight correction module, and the weight correction module is used to adjust the weights of the intermediate layer features of the target intermediate layer of the objective emotion recognition module based on user features, and then obtains the sample user features corresponding to the sample users and the second emotion labels of the sample users for the sample songs, and finally, the second emotion labels of the sample users for the sample songs are obtained based on the sample user features. The second recognition module to be trained is trained based on the features, sample songs, song features and second emotion labels, so as to determine the emotion analysis model according to the obtained recognition module and the pre-trained feature extraction module. The process adjusts the weights of the intermediate layer features of the objective emotion module based on the user features through the weight correction module, so as to capture the sensitivity of different users to songs, so that the obtained recognition module can analyze the objective emotions of the songs while being able to predict the emotions of different users to the songs in a targeted manner. That is, the trained emotion analysis model increases the user's subjective emotion recognition of the songs when analyzing the emotions of the songs, which can realize the emotion recognition of songs with different faces for different people and improve the accuracy of the emotion recognition model in identifying the emotions of the songs.
[0070] In an exemplary embodiment, a method for implementing training of a second recognition module to be trained is also provided. Figure 5 As shown, training the second recognition module to be trained according to the sample user characteristics, the sample songs, the song characteristics and the second emotion label may include:
[0071] Step S510: inputting song features and sample songs into the objective emotion recognition module, and extracting the intermediate layer features of the target intermediate layer of the objective emotion recognition module.
[0072] You can continue to see Figure 4 As shown, the sample song and the song features of the sample song extracted by the feature extraction module are input into the objective emotion recognition module together, and the intermediate layer features of the target intermediate layer can be extracted so that the weights of the intermediate layer features can be adjusted through the weight correction module.
[0073] Step S520: The intermediate layer features and the sample user features are fused and calculated by the weight correction module to obtain fused features.
[0074] Sample user characteristics include user attribute characteristics and user interaction characteristics. User attribute characteristics refer to characteristics that reflect user attributes such as gender, age, personality, occupation, etc. User interaction characteristics refer to characteristics that reflect interactive behaviors for songs such as likes, reposts, and comments.
[0075] Optionally, the user attribute feature and the user interaction feature are fused and calculated by a weight correction module to obtain a reference feature, and the reference feature and the intermediate layer feature are fused and calculated according to preset weight information to obtain a fused feature.
[0076] Among them, the method of fusing and calculating user attribute features and user interaction features is realized by feature splicing or feature weighting, which can be flexibly selected according to actual needs. The preset weight information refers to the weight used to balance the user factor (reference feature) and the song factor (middle layer feature), which can also be adjusted according to the task requirements of model training, so that the reference feature and the middle layer feature can be fused and calculated based on the preset weight information. The fusion calculation method can also include but is not limited to feature splicing, feature weighting, etc.
[0077] By using user attribute features and user interaction features to adjust the weights of the intermediate layer features, the model's sensitivity to learning different users (user features) for song features can be enhanced, so that the trained model can recognize the personalized emotions of different users corresponding to the same song.
[0078] Optionally, the intermediate layer features and the sample user features are fused and calculated by the weight correction module to obtain the fused features, which may also include:
[0079] The scene features corresponding to the sample users are obtained, and then the intermediate layer features, sample user features and scene features are fused and calculated through the weight correction module to obtain the fused features.
[0080] Among them, the scene feature is used to indicate the current listening scene of the sample user, for example, the user is in a work scene, a study scene, a sports scene, etc., and the scene feature of the user can be obtained in response to the user's touch operation (such as an input operation), or the scene image of the user can be collected and the scene feature can be identified based on the scene image, or the scene feature of the user can be determined by sound recognition through the collected scene sound. Exemplary embodiments of the present disclosure include but are not limited to the above-mentioned methods of obtaining scene features.
[0081] Since the scene in which the user is in will affect his mood when listening to music and the desired emotion of the song, we can obtain the scene features corresponding to the user and use the scene features to adjust the intermediate layer features through the weight correction module, so that the model can learn to recognize the emotions of different users towards music in different scenes, further improving the accuracy of the model in recognizing emotions.
[0082] Step S530: insert the fused features as the output of the target intermediate layer into the objective emotion recognition module so that the objective emotion recognition module outputs the emotion prediction result, and adjusts the parameters in the second recognition module to be trained according to the model loss determined by the emotion prediction result and the second emotion label.
[0083] After obtaining the fused features, the fused features can be used as the output of the middle layer, that is, continue to be used as the input of the next neural network layer of the middle layer for feature processing, and obtain the emotion prediction results output by the objective emotion recognition module, and then determine the model loss based on the emotion prediction results and the second emotion label. The model loss can be a cross entropy loss, etc., and there is no restriction on this.
[0084] The parameters in the second recognition module to be trained are adjusted based on the model loss to obtain a trained recognition module, and finally the sentiment analysis model is determined according to the obtained recognition module and the pre-trained feature extraction module.
[0085] In an exemplary embodiment, the pre-trained feature extraction module can be cascaded with the target objective emotion recognition module in the obtained recognition module; and the target weight correction module in the obtained recognition module can be inserted after the target intermediate layer in the target objective emotion recognition module, so that the target weight correction module adjusts the weight of the intermediate layer features of the target intermediate layer in the target objective emotion recognition module.
[0086] Specifically, Figure 6 The following is a schematic diagram of a sentiment analysis model. Figure 6 ,The cascading of the pre-trained feature extraction module and the target ,objective emotion recognition module means that the song features output by the ,pre-trained feature extraction module are input into the target objective ,emotion recognition module.
[0087] After obtaining the sentiment analysis model, it can be used to predict the user's emotions towards the song based on the input user information and songs, realizing sentiment analysis that combines the dual factors of user subjectivity and song objectivity, thereby improving the accuracy of sentiment analysis.
[0088] In an exemplary embodiment, a method for obtaining a second emotion tag is also provided. Figure 7 As shown, obtaining the sample user features corresponding to the sample user and the second emotion tag of the sample user for the sample song may include:
[0089] Step S710: extracting reference user features of sample users, and dividing the sample users into multiple user category groups according to the reference user features.
[0090] Reference user characteristics refer to the multi-dimensional characteristics of sample users, including but not limited to age, gender, personality description, education level, job type, etc., and there is no restriction on this. User category groups refer to groups with similar characteristics in some aspects, or groups with similar characteristics in multiple aspects, which can be set according to actual task requirements.
[0091] The user category group may be divided according to a dimensional feature in the reference user features (such as age), for example, after division, the elderly group, the middle-aged group, the juvenile group, etc. The user category group may also be divided according to the dimensional features in the reference user features, for example, the user comprehensive features may be determined according to the reference user features of each sample user (such as obtained by feature concatenation), and then the user comprehensive features of all sample users are clustered to obtain multiple clusters, and the user category group to which the sample user belongs is determined according to the cluster to which the user comprehensive features of the sample user belong.
[0092] Step S720: for each user category group, determine the sample user features corresponding to the user category group according to the reference user features in the user category group, so as to determine the sample user features corresponding to the user category group as the sample user features corresponding to the sample users in the user category group.
[0093] After determining the user category groups, for each user category group, the union of reference user features of all sample users in the user category group can be obtained as the sample user features of the user category group, and then the sample user features of the sample users belonging to the user category group are the sample user features of the user category group.
[0094] By dividing the user into category groups, the features of the user groups belonging to each category can be extracted more comprehensively, thereby providing comprehensive feature support for determining the second emotion labels of the user groups in each category for the sample songs.
[0095] Step S730: For each user category group, determine a second emotion label according to reference emotion labels of sample songs by sample users in the user category group.
[0096] After obtaining the user category groups, for each user category group, the reference emotion labels of the sample users in the user category group for the sample songs can be obtained, and these reference emotion labels may be the same or different. Among them, if there are at least two types of reference emotion labels, the reference emotion labels with the largest number can be obtained by statistical means as the second emotion labels of the sample songs for the user category group. Alternatively, the second emotion label can be determined for each user category group according to the reference emotion labels of the sample users in the user category group for the sample songs in the following manner:
[0097] First, the reference emotion labels of the sample songs of the sample users in the user category group are clustered to obtain a plurality of label clusters, and then the second emotion labels of the sample songs of the sample users in the user category group are determined from the plurality of label clusters.
[0098] Among them, each reference emotion label can be feature vectorized (i.e. encoded), and then the reference emotion labels can be clustered based on the Euclidean distance or other distance calculation of the feature vector to obtain a label cluster, and then the central label of the label cluster containing the largest number of reference emotion labels can be obtained as the second emotion label for the sample song of the sample user in the user category group.
[0099] An exemplary embodiment of the present disclosure determines the second emotion label of the user category group for the sample song by comprehensively considering the emotions of each sample user belonging to the same category group towards the sample song, so that the second emotion label can cover the emotions of all or most of the sample users in the user category group towards the song, thereby ensuring the accuracy of the second emotion label.
[0100] The technical solution in the exemplary embodiment of the present disclosure, on the one hand, extracts features of sample songs based on a pre-trained feature extraction module to obtain song features, and trains a first recognition module to be trained based on the song features, sample songs and the first emotion labels of the sample songs to obtain an objective emotion recognition module, which can objectively analyze the emotions of songs; on the other hand, a second recognition module to be trained is determined based on the objective emotion recognition module and the weight correction module, and the weight correction module is used to adjust the weights of the intermediate layer features of the target intermediate layer of the objective emotion recognition module based on the user features, and then obtains the sample user features corresponding to the sample users and the second emotion labels of the sample users for the sample songs, and finally, based on the sample The user features, song features and the second emotion label are used to train the second recognition module to be trained, so as to determine the emotion analysis model according to the obtained recognition module and the pre-trained feature extraction module. The process adjusts the weights of the intermediate layer features of the objective emotion module based on the user features through the weight correction module, so as to capture the sensitivity of different users to the songs, so that the obtained recognition module can analyze the objective emotions of the songs while being able to predict the emotions that different users will have for the songs in a targeted manner. That is, the trained emotion analysis model increases the user's subjective emotion recognition of the songs when analyzing the emotions of the songs, which can realize the emotion recognition of songs with different faces for different people and improve the accuracy of the emotion recognition model in identifying the emotions of the songs.
[0101] Furthermore, the exemplary embodiments of the present disclosure also provide a music recommendation method, such as Figure 8 As shown, the music recommendation method of the embodiment of the present disclosure may include:
[0102] Step S810: Obtain the user information and listening songs of the current user.
[0103] Step S820: Based on the user information and the songs listened to, the current emotion of the current user towards the songs listened to is obtained through a sentiment analysis model; wherein the sentiment analysis model is obtained by model training based on any of the above-mentioned model training methods.
[0104] Step S830: Recommend songs to the current user based on the current mood.
[0105] Among them, in the model application stage, the current user's current emotion towards the songs listened to can be obtained through the sentiment analysis model by inputting the current user's user information and the songs listened to. Since the sentiment analysis model can explore the different emotions of different users towards the same song, different users can get different emotions for listening to songs, so that the sentiment analysis result is a combination of the subjective and objective factors of user factors and song factors, which improves the accuracy of sentiment analysis, meets the needs of personalized analysis of user emotions, and realizes sentiment analysis of thousands of people, so that songs corresponding to emotions can be recommended to users in a more targeted manner.
[0106] It should be noted that the training process of the sentiment analysis model can be found in the above-mentioned specific embodiments and will not be described in detail here.
[0107] In an exemplary embodiment, a song-based information interaction method is also provided, that is, obtaining user information of the current user, including:
[0108] In response to a touch operation for song listening interaction information, user information corresponding to the touch operation is obtained; wherein the song listening interaction information is used to indicate whether the current user actively initiates music recommendation.
[0109] Specifically, the music listening interaction information can be a pre-provided optional function item, or a function item that can be input by the user, and the touch operation can be an input operation in a related function item through a touch medium (such as a finger, a stylus, etc.), or it can be a response to the user's touch operation on the function item to obtain the user information corresponding to the touch operation. For example, if the user likes pure music, has a quiet personality, and does not like noise, he can actively initiate music recommendations by inputting relevant user information, so that songs can be recommended to him more accurately based on the user information provided by the user.
[0110] Of course, if the user does not actively provide user information, you can also read the user's relevant user information with the user's authorization, such as obtaining the user's registration information on the music platform, or obtaining the user's account information associated with the music platform.
[0111] Through interactive operations based on interactive information about listening to songs, user information can be obtained for recommending songs, and music can be recommended to users more efficiently and accurately, thereby improving the user's listening experience.
[0112] In an exemplary embodiment, sample user features corresponding to sample users and second emotion tags for sample songs can also be obtained based on user information to iteratively train the emotion analysis model. That is, as user information is continuously added, the user information can be used to extract sample user features and optimize the second emotion tags, so that the emotion analysis model can be iteratively trained using this information to gradually optimize the emotion analysis model's ability to analyze song emotions.
[0113] Furthermore, in an exemplary embodiment of the present disclosure, a model training device is also provided. Fig. 9 As shown, the model training device 900 may include a song feature extraction module 910, a first training module 920, a weight feature module 930, a user feature acquisition module 940, and a second training module 950. Specifically:
[0114] A song feature extraction module 910 is used to extract features of sample songs based on a pre-trained feature extraction module to obtain song features; a first training module 920 is used to train a first recognition module to be trained based on song features, sample songs and first emotion labels of sample songs to obtain an objective emotion recognition module; a weight feature module 930 is used to determine a second recognition module to be trained based on the objective emotion recognition module and a weight correction module, and the weight correction module is used to adjust the weights of the intermediate layer features of the target intermediate layer of the objective emotion recognition module based on user features; a user feature acquisition module 940 is used to obtain sample user features corresponding to sample users and the second emotion labels of sample users for sample songs; a second training module 950 is used to train the second recognition module to be trained based on sample user features, sample songs, song features and second emotion labels, so as to determine the emotion analysis model based on the obtained recognition module and the pre-trained feature extraction module.
[0115] In an exemplary embodiment of the present disclosure, the first training module 920 is configured to perform: inputting song features and sample songs into the objective emotion recognition module, and extracting the intermediate layer features of the target intermediate layer of the objective emotion recognition module; fusing the intermediate layer features with the sample user features through the weight correction module to obtain fused features; inserting the fused features as the output of the target intermediate layer into the objective emotion recognition module, so that the objective emotion recognition module outputs an emotion prediction result, and adjusting the parameters in the second recognition module to be trained according to the model loss determined by the emotion prediction result and the second emotion label.
[0116] In an exemplary embodiment of the present disclosure, sample user features include user attribute features and user interaction features; the weight feature module 930 is configured to execute: fusing the user attribute features and the user interaction features through the weight correction module to obtain reference features; and fusing the reference features and the intermediate layer features according to preset weight information to obtain fused features.
[0117] In an exemplary embodiment of the present disclosure, the weight feature module 930 is configured to execute: obtaining scene features corresponding to sample users, where the scene features are used to indicate the current listening scene of the sample users; and fusing the intermediate layer features, sample user features, and scene features through a weight correction module to obtain fused features.
[0118] In an exemplary embodiment of the present disclosure, the first emotion label is an expert experience label, and the second emotion label is a non-expert experience label; the user feature acquisition module 940 is configured to perform: extracting reference user features of sample users, and dividing the sample users into multiple user category groups according to the reference user features; for each user category group, determining the sample user features corresponding to the user category group according to the reference user features in the user category group, so as to determine the sample user features corresponding to the user category group as the sample user features corresponding to the sample users in the user category group; for each user category group, determining the second emotion label according to the reference emotion label of the sample song by the sample users in the user category group.
[0119] In an exemplary embodiment of the present disclosure, the user feature acquisition module 940 is configured to perform: clustering the reference emotion labels of the sample songs by the sample users in the user category group to obtain multiple label clusters; and determining the second emotion labels of the sample songs by the sample users in the user category group from the multiple label clusters.
[0120] In an exemplary embodiment of the present disclosure, the second training module 950 is configured to perform: cascading the pre-trained feature extraction module with the target objective emotion recognition module in the obtained recognition module; and inserting the target weight correction module in the obtained recognition module after the target intermediate layer in the target objective emotion recognition module, so that the target weight correction module adjusts the weight of the intermediate layer features of the target intermediate layer in the target objective emotion recognition module.
[0121] Since the details of each functional module of the model training device of the exemplary embodiment of the present disclosure have been recorded in the exemplary embodiment of the above-mentioned model training method, they will not be repeated here.
[0122] Furthermore, the exemplary embodiments of the present disclosure also provide a music recommendation device, such as Fig.10 As shown, the music recommendation device 1000 includes:
[0123] The information acquisition module 1010 is used to obtain the user information and songs listened to by the current user; the emotion recognition module 1020 is used to obtain the current emotion of the current user towards the songs listened to by using an emotion analysis model based on the user information and the songs listened to; wherein the emotion analysis model is obtained by model training based on the model training method described in any one of the embodiments of the present disclosure; the music recommendation module 1030 is used to recommend songs to the current user according to the current emotion.
[0124] In an exemplary embodiment of the present disclosure, the information acquisition module 1010 is configured to perform: in response to a touch operation on song listening interaction information, acquire user information corresponding to the touch operation; wherein the song listening interaction information is used to indicate whether the current user actively initiates music recommendation.
[0125] In an exemplary embodiment of the present disclosure, the device also includes: a model updating module, configured to execute, based on the user information, obtaining sample user features corresponding to the sample user and a second emotion label for the sample song, for iterative training of the emotion analysis model.
[0126] Since the details of the various functional modules of the music recommendation device of the exemplary embodiment of the present disclosure have been described in the exemplary embodiment of the music recommendation method described above, they will not be repeated here.
[0127] It should be noted that although several modules or units of the model training device and the music recommendation device are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0128] The exemplary embodiments of the present disclosure also provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the above method is implemented.
[0129] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.
[0130] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.
[0131] The code of the computer program can be written in one or more programming languages. Programming languages such as C language, Java, C++, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).
[0132] The computer program can be carried or transmitted by electrical, magnetic, optical, electromagnetic, infrared and other signals. The electronic device can convert the signal carrying the computer program into a digital signal, and then run the computer program. When the computer program is running on the electronic device, its code is used to make the electronic device execute (more specifically, the processor of the electronic device can execute) the method steps of various exemplary embodiments of the present disclosure, such as the above method can be executed, which includes the following steps: extracting features of the sample song based on the pre-trained feature extraction module to obtain song features; training the first recognition module to be trained according to the song features, the sample song and the first emotion label of the sample song to obtain an objective emotion recognition module; determining the second recognition module to be trained according to the objective emotion recognition module and the weight correction module, the weight correction module is used to adjust the weight of the intermediate layer features of the target intermediate layer of the objective emotion recognition module based on the user features; obtaining the sample user features corresponding to the sample user and the second emotion label of the sample user for the sample song; training the second recognition module to be trained according to the sample user features, the sample song, the song features and the second emotion label, so as to determine the emotion analysis model according to the obtained recognition module and the pre-trained feature extraction module.
[0133] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided. It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as a system, method, or program product. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which may be collectively referred to herein as a "circuit", "module", or "system".
[0134] Refer to the following Fig.11 1100 according to this embodiment of the present disclosure is described. Fig.11 The electronic device 1100 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0135] like Fig.11 As shown, the electronic device 1100 is in the form of a general computing device. The components of the electronic device 1100 may include, but are not limited to: the at least one processing unit 1110, the at least one storage unit 1120, a bus 1130 connecting different system components (including the storage unit 1120 and the processing unit 1110), and a display unit 1140.
[0136] The storage unit stores program codes, which can be executed by the processing unit 1110, so that the processing unit 1110 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.
[0137] The storage unit 1120 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 1121 and / or a cache memory unit 1122 , and may further include a read-only memory unit (ROM) 1123 .
[0138] The storage unit 1120 may also include a program / utility 1124 having a set (at least one) of program modules 1125, such program modules 1125 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0139] Bus 1130 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0140] The electronic device 1100 may also communicate with one or more external devices 1200 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1100, and / or communicate with any device that enables the electronic device 1100 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1150. Furthermore, the electronic device 1100 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1160. As shown, the network adapter 1160 communicates with other modules of the electronic device 1100 via a bus 1130. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0141] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0142] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0143] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
Claims
1. A model training method, characterized in that: include: Extract features of sample songs based on the pre-trained feature extraction module to obtain song features; According to the song features, the sample songs and the first emotion labels of the sample songs, the first recognition module to be trained is trained to obtain an objective emotion recognition module; Determining a second recognition module to be trained according to the objective emotion recognition module and the weight correction module, wherein the weight correction module is used to adjust the weight of the intermediate layer feature of the target intermediate layer of the objective emotion recognition module based on the user feature; Obtaining a sample user feature corresponding to the sample user and a second emotion label of the sample user for the sample song; The second recognition module to be trained is trained according to the sample user characteristics, the sample songs, the song characteristics and the second emotion tag, so as to determine the emotion analysis model according to the obtained recognition module and the pre-trained feature extraction module.
2. The method according to claim 1, characterized in that The training of the second recognition module to be trained according to the sample user feature, the sample song, the song feature and the second emotion tag comprises: Inputting the song features and the sample songs into the objective emotion recognition module, and extracting the intermediate layer features of the target intermediate layer of the objective emotion recognition module; The weight correction module is used to fuse the intermediate layer features with the sample user features to obtain fused features; The fusion feature is used as the output of the target intermediate layer and inserted into the objective emotion recognition module so that the objective emotion recognition module outputs an emotion prediction result, so as to adjust the parameters in the second recognition module to be trained according to the emotion prediction result and the model loss determined by the second emotion label.
3. The method according to claim 2, characterized in that The sample user characteristics include user attribute characteristics and user interaction characteristics; The step of fusing the intermediate layer features with the sample user features through the weight correction module to obtain fused features includes: The weight correction module performs a fusion calculation on the user attribute feature and the user interaction feature to obtain a reference feature; According to preset weight information, the reference feature and the intermediate layer feature are fused and calculated to obtain the fused feature.
4. The method according to claim 2, characterized in that: The step of fusing the intermediate layer features with the sample user features through the weight correction module to obtain fused features includes: Acquire a scene feature corresponding to the sample user, where the scene feature is used to indicate a current song listening scene of the sample user; The weight correction module performs a fusion calculation on the intermediate layer features, the sample user features and the scene features to obtain the fusion features.
5. The method according to claim 1, characterized in that The first emotion label is an expert experience label, and the second emotion label is a non-expert experience label; The obtaining of the sample user features corresponding to the sample user and the second emotion label of the sample user for the sample song includes: Extracting reference user features of sample users, and dividing the sample users into a plurality of user category groups according to the reference user features; For each user category group, determine a sample user feature corresponding to the user category group according to a reference user feature in the user category group, so as to determine the sample user feature corresponding to the user category group as the sample user feature corresponding to the sample user in the user category group; For each user category group, the second emotion label is determined according to the reference emotion label of the sample song by the sample users in the user category group.
6. The method according to claim 5, characterized in that The step of determining the second emotion label for each user category group according to the reference emotion label of the sample song by the sample users in the user category group includes: Clustering the reference emotion labels of the sample songs by the sample users in the user category group to obtain a plurality of label clusters; A second emotion tag for the sample song by the sample users in the user category group is determined from the multiple tag clusters.
7. A music recommendation method, characterized in that: include: Get the user information and songs played by the current user; Based on the user information and the songs being listened to, the current emotion of the current user towards the songs being listened to is obtained through a sentiment analysis model; wherein the sentiment analysis model is obtained by model training based on the method described in any one of claims 1 to 6; Recommend songs to the current user according to the current mood.
8. A model training device, characterized in that: include: A song feature extraction module is used to extract features of sample songs based on the pre-trained feature extraction module to obtain song features; A first training module is used to train the first recognition module to be trained according to the song features, the sample songs and the first emotion labels of the sample songs to obtain an objective emotion recognition module; A weight feature module, used to determine a second recognition module to be trained according to the objective emotion recognition module and a weight correction module, wherein the weight correction module is used to adjust the weight of the intermediate layer feature of the target intermediate layer of the objective emotion recognition module based on user characteristics; A user feature acquisition module, used to acquire sample user features corresponding to sample users and a second emotion label of the sample users for the sample songs; The second training module is used to train the second recognition module to be trained according to the sample user characteristics, the sample songs, the song characteristics and the second emotion label, so as to determine the emotion analysis model according to the obtained recognition module and the pre-trained feature extraction module.
9. A music recommendation device, characterized in that: include: The information acquisition module is used to obtain the user information of the current user and listen to songs; An emotion recognition module, used for obtaining the current emotion of the current user towards the song through an emotion analysis model based on the user information and the song being listened to; wherein the emotion analysis model is obtained by model training based on the method according to any one of claims 1 to 6; The music recommendation module is used to recommend songs to the current user according to the current mood.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.