Emotional state evaluation and intervention method and system based on user listening behavior
By constructing a multi-source feature and emotional state assessment model and calculating the risk index for tiered intervention, the problem of existing music recommendation systems ignoring users' implicit psychological emotions is solved, and dynamic adjustment of emotional states and improvement of user experience are achieved.
Patent Information
- Application Number
- CN202510677819.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-09-05
AI Technical Summary
Existing music recommendation systems ignore users' implicit psychological and emotional states, which leads to the aggravation of negative emotions. They lack active intervention mechanisms and are unable to make dynamic adjustments based on users' real-time emotional fluctuations.
By acquiring user listening behavior data, constructing multi-source features, training the emotional state assessment model, and calculating the emotional state risk index, we conduct tiered guidance intervention, including reverse emotional state recommendations and psychological assistance.
It achieves dynamic adjustment of recommendation strategies based on the user's emotional state, avoids the aggravation of negative emotions, improves user experience, and protects privacy.
Smart Images

Figure CN120600239A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and system for evaluating and intervening in a user's emotional state based on listening behavior. Background Art
[0002] With the rapid development of information technology, online music platforms have become the primary means for users to access music resources. Personalized song recommendation systems based on collaborative filtering and deep learning technologies analyze user behavior (such as play history, search keywords, and song favorites) to accurately recommend music genres that closely match user preferences.
[0003] However, current recommendation systems, centered around "user explicit preferences," focus excessively on matching musical attributes like style and rhythm, while neglecting the dynamic assessment of users' implicit psychological and emotional states. For example, when a user repeatedly listens to sad songs due to low mood, the system may continue to recommend the same type of music, leading to an "information cocoon" effect, exacerbating negative emotional states and even inducing mental health risks. Furthermore, existing recommendation systems passively respond to user behavior and lack proactive intervention mechanisms. Even though some systems have introduced emotional tags such as "happy" and "healing," their recommendation strategies remain at the static tag matching level and are unable to dynamically adjust based on real-time user emotional fluctuations. Summary of the Invention
[0004] In order to solve the problems existing in the above-mentioned prior art, the purpose of this application is to provide a method and system for evaluating and intervening in the emotional state based on the user's listening behavior. By evaluating the user's emotional state, the system automatically initiates reverse recommendation and intervention strategies to effectively focus on the user's psychological and emotional health.
[0005] To achieve the above objectives, in a first aspect, embodiments of the present application provide a method for assessing and intervening in a user's emotional state based on listening behavior, comprising:
[0006] Obtain user listening behavior data, pre-process the data, and then perform multi-source feature extraction;
[0007] Build a user dynamic portrait library based on multi-source features;
[0008] Build and train an affective state assessment model;
[0009] Evaluate the user's emotional state category C through the emotional state evaluation model;
[0010] Calculate the user's emotional state risk index R, the calculation formula is:
[0011] R = B'(C) × a × t, where B'(C) is the dynamic risk value corresponding to different emotional state categories C, a is the emotional fluctuation index, and t is the duration of emotional immersion;
[0012] The value of the emotional state risk index R is used to determine whether the intervention conditions are met. If so, guided intervention is carried out.
[0013] Preferably, the determination of whether the intervention condition is met based on the value of the emotional state risk index R, and if so, guiding intervention is performed, specifically:
[0014] A hierarchical intervention threshold is set, and hierarchical guidance intervention is carried out according to the risk level of the risk index R. The hierarchical guidance intervention includes generating a recommended playlist of opposite emotional states, actively outputting communication texts of the comfort and emotional counseling categories, and pushing psychological care resources.
[0015] This invention constructs dynamic profiles from multiple sources of features and combines them with machine learning models to assess users' implicit emotional states, addressing the limitations of traditional music recommendation systems that rely on linear preferences. By introducing a risk index R, the dynamic risk value B'(C) of the emotional state category, the emotional volatility index a, and the duration of emotional immersion t are integrated to quantify the user's emotional risk level. Based on the risk index R, different levels of guidance and intervention measures are dynamically triggered. This combines implicit guidance with explicit support. This approach not only subtly influences emotions through playlists that counteract emotional states, but also proactively provides psychological support, preventing the "information cocoon" from exacerbating negative emotions.
[0016] Preferably, the mood swing index a is express, is the average song genre change value during the continuous playback period; The calculation formula is: Where Δg i is the absolute value sequence of the difference between the styles of adjacent songs, g i is the characteristic value of the song style, and n is the number of songs in the continuous playing period.
[0017] Preferably, the emotional immersion duration t is the listening duration of audio of different emotional types further recorded on the basis of the recorded listening duration, and the calculation formula is:
[0018] Among them, T i is the duration of the i-th audio playback, C i is the emotional tone classification of the i-th audio, C target is the target emotional tone classification, and n is the total number of user audio playbacks during the statistical period.
[0019] Preferably, the multi-source features include: one or more of a listening period feature, a listening duration feature, a listening song classification feature, a single song loop count feature, and a listening song keyword feature.
[0020] Preferably, the calculation formula for the listening period feature is: Among them, suppose a day is divided into n time periods, x ij is the proportion of user i’s listening times in the jth time period to the total listening times, N ij is the number of times user i listens in the jth time period;
[0021] The calculation formula of the listening time feature is: Among them, A i is the average listening time, L ik is the time that user i listens to song k, M i is the total number of songs listened to by user i;
[0022] The calculation formula of the listening song classification feature is: Among them, y il N is the ratio of the number of times user i listens to the lth type of songs to the total number of times he listens to them. il is the number of times user i listens to songs in category l, and m is the total number of songs listened to by user i;
[0023] The calculation formula of the single song cycle times feature is: Among them, R i is the average number of single song cycles for user i, R ik is the number of times user i repeats song k, P i The number of songs played on loop for user i;
[0024] The keyword features of the songs are used to extract key lyrics using the TF-IDF algorithm. The calculation formula is: Among them, tf-idf w,k is the TF-IDF value of word w in song k, tf w,k is the frequency of word w in song k, df w is the number of songs containing word w, and M is the total number of songs.
[0025] The present invention realizes evaluation based on senseless data collection, does not require additional input from the user, and avoids increasing the burden on the user.
[0026] Preferably, the emotional state evaluation model is constructed and trained by extracting the listening period feature, listening time feature, listening song classification feature, single song loop count feature and listening song keyword feature to form a feature vector x, and using a machine learning algorithm to transform the feature vector x and the training data of the emotional category C {(x1, C1), (x2, C2), ..., (x N ,C N )} as input, and train the model to evaluate the emotional state category.
[0027] Preferably, it also includes model evaluation and feedback learning, where the evaluation indicators include accuracy, recall rate and F1 value. The feedback learning includes collecting user feedback data on guided intervention behavior, performing incremental learning to optimize the model and verifying the feedback effect.
[0028] This invention uses supervised learning to establish a nonlinear mapping between features and emotion categories, enabling more accurate capture of complex behavioral patterns. Based on user feedback on interventions, model parameters are dynamically adjusted, allowing the system to continuously adapt to individual differences.
[0029] In a second aspect, an embodiment of the present application provides an emotional state assessment and intervention system based on user listening behavior, comprising:
[0030] The acquisition module is used to obtain user listening behavior data, pre-process the data and perform multi-source feature extraction;
[0031] User dynamic portrait library construction module, used to construct a user dynamic portrait library based on multi-source features;
[0032] Affective state assessment model building module, used to build and train the affective state assessment model;
[0033] An evaluation module, configured to evaluate the user's emotional state category C using an emotional state evaluation model;
[0034] The risk index calculation module is used to calculate the user's emotional state risk index R. The calculation formula is:
[0035] R = B'(C) × a × t, where B'(C) is the dynamic risk value corresponding to different emotional state categories C, a is the emotional fluctuation index, and t is the duration of emotional immersion;
[0036] The guidance intervention module is used to determine whether the intervention conditions are met based on the value of the emotional state risk index R, and if so, to conduct guidance intervention.
[0037] In a third aspect, an embodiment of the present application provides an electronic device comprising: a processor, a memory, and an emotional state assessment and intervention program stored on the memory and executable on the processor, wherein the emotional state assessment and intervention program is configured to implement an emotional state assessment and intervention method as described above.
[0038] The present invention has the following beneficial effects:
[0039] (1) The emotional state assessment and intervention method based on user listening behavior provided by the embodiment of the present invention constructs a dynamic portrait through multi-source features and combines a machine learning model to evaluate the user's implicit emotional state, thereby solving the limitation of traditional music recommendation systems that rely on explicit preferences.
[0040] (2) The emotional state assessment and intervention method based on user listening behavior provided by the embodiment of the present invention introduces the risk index R, integrates the dynamic risk value B'(C) of the emotional state category, the emotional fluctuation index a, and the immersion time t, quantifies the risk level of the user's emotional state, and dynamically triggers different levels of guidance intervention measures according to the risk index R, combining implicit guidance with explicit support, which not only subtly influences emotions through the reverse emotional state playlist, but also actively provides psychological assistance to avoid the "information cocoon" exacerbating negative emotions.
[0041] (3) The emotional state assessment and intervention method based on user listening behavior provided by the embodiments of the present invention implements assessment based on non-invasive data collection, without requiring additional user input, thus avoiding adding burden to the user. Through methods such as music-guided intervention, it helps users regulate their emotions in a low-invasive manner, combining practicality with privacy protection, and effectively improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A flowchart of the emotional state assessment and intervention method disclosed in an embodiment of the present invention;
[0043] Figure 2 A schematic diagram of the process of constructing and training an emotional state assessment model disclosed in an embodiment of the present invention;
[0044] Figure 3 A schematic diagram of the process of generating a reverse emotional state recommended playlist disclosed in an embodiment of the present invention;
[0045] Figure 4 A schematic diagram of the process of actively outputting communication texts of the comforting and emotional counseling categories and pushing psychological care resources disclosed in an embodiment of the present invention;
[0046] Figure 5 A schematic diagram of the structure of the emotional state assessment and intervention system disclosed in an embodiment of the present invention;
[0047] Figure 6 This is a schematic structural diagram of an electronic device disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0049] In the present invention, unless otherwise expressly specified or limited, the terms "connection" and "fixed" should be understood in a broad sense. For example, they may refer to fixed connection, detachable connection, or integration; mechanical connection or electrical connection; direct connection or indirect connection through an intermediate medium; internal communication between two elements or interaction between two elements. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.
[0050] The terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. Furthermore, the terms "including," "having," and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device comprising a series of steps or modules need not be limited to the steps or modules explicitly listed, but may include other steps or modules not explicitly listed or inherent to such process, method, product, or device. The naming or numbering of steps in this application does not imply that the steps in the method flow must be executed in the chronological or logical order indicated by the naming or numbering. Named or numbered process steps may be executed in a different order based on the technical objectives to be achieved, as long as the same or similar technical effects are achieved. The module divisions presented in this application are logical divisions; in actual implementation, other divisions may be used, such as combining or integrating multiple modules into another system, or omitting or not implementing certain features. Moreover, the modules or sub-modules described as separate components may or may not be physically separated, may or may not be physical modules, or may be distributed into multiple circuit modules, and some or all of the modules may be selected according to actual needs to achieve the purpose of the present application.
[0051] According to Mood Congruence Theory, individuals tend to choose music that aligns with their current mood, such as slow-paced, minor-key songs when feeling sad. Prolonged immersion in the same type of music can reinforce existing emotions. Existing music recommendation systems focus on "user explicit preferences" and match music based on the user's current preferences, but neglect the dynamic assessment and guidance of users' implicit psychological and emotional states. This invention analyzes listening behavior data to construct a dynamic correlation model between listening behavior and psychological and emotional states. This model assesses the user's emotional state and calculates a risk index for tiered guidance intervention, helping users to escape negative emotions and, through regulatory measures, improving the user experience.
[0052] The specific implementation of the present invention is described below with reference to the accompanying drawings and embodiments.
[0053] On the one hand, the embodiment of the present application provides a method for evaluating and intervening in the emotional state based on the user's listening behavior, such as Figure 1 As shown, the following steps are included:
[0054] Step S101: obtaining user listening behavior data, pre-processing the data, and then performing multi-source feature extraction;
[0055] Specifically, in this embodiment, user listening behavior data can be obtained through the music platform API or local logs, including: user ID, timestamp of each listening session, song ID, listening time, number of single loops, song metadata (genre tag, emotional tone classification), and lyrics text. The data is pre-processed, including: time processing, converting the timestamp into a specific date and time, extracting information such as hours and days of the week for analyzing the listening period; missing value processing, cleaning or filling in data that is missing key information such as listening time or song classification, for example, the average listening time of the user or the song category can be used for filling; lyrics text processing, cleaning the lyrics, removing special characters, stop words, etc., and then performing word segmentation processing to prepare for the subsequent extraction of key lyrics.
[0056] Furthermore, the multi-source features include: one or more of a listening period feature, a listening duration feature, a listening song classification feature, a single song loop count feature, and a listening song keyword feature.
[0057] Specifically, the calculation formula of the listening period feature is: Suppose a day is divided into n time periods, each time period is t hours, and define x ij is the proportion of user i’s listening times in the jth time period to the total listening times, N ij is the number of times user i listens in the jth time period;
[0058] The calculation formula of the listening time feature is: Among them, A i is the average listening time, L ik is the time that user i listens to song k, M i is the total number of songs listened to by user i;
[0059] The calculation formula of the listening song classification feature is: Among them, y il N is the ratio of the number of times user i listens to the lth type of songs to the total number of times he listens to them. ilis the number of times user i listens to songs in category l, and m is the total number of songs listened to by user i;
[0060] The calculation formula of the single song cycle times feature is: Among them, R i is the average number of single song cycles for user i, R ik is the number of times user i repeats song k, P i The number of songs played on loop for user i;
[0061] The keyword features of the songs are used to extract key lyrics using the TF-IDF algorithm. The calculation formula is: Among them, tf-idf w,k is the TF-IDF value of word w in song k, tf w,k is the frequency of word w in song k, df w is the number of songs containing word w, M is the total number of songs, several lyrics with higher TF-IDF values are selected as key lyrics, and the frequency of users listening to songs containing these key lyrics is counted.
[0062] Step S102: construct a user dynamic portrait library based on multi-source features.
[0063] Specifically, in this embodiment, the data structure of the user dynamic portrait library can use the InfluxDB time series database to store the user's daily updated feature vectors. The JSON data definition example is as follows:
[0064]
[0065] Updates to the user dynamic profile library include real-time feature updates and batch updates. Real-time behaviors (such as single song loops) are updated in real time through Kafka+Flink stream processing. Batch processing is set to update the profile library through batch processing every morning and retain the data for the last 30 days.
[0066] The following is a Java example of real-time update of Kafka+Flink stream processing:
[0067]
[0068]
[0069] The Python example of batch feature aggregation is as follows:
[0070]
[0071]
[0072] Step S103: construct and train an emotional state assessment model.
[0073] Furthermore, the extracted listening period features, listening time features, listening song classification features, single song loop times features and listening song keyword features are combined into a feature vector x, and the feature vector x and the training data of the emotional state category C {(x1, C1), (x2, C2), …, (x N ,C N )} as input, and train the model to evaluate the emotional state category.
[0074] Specifically, such as Figure 2 As shown, in this embodiment, the training steps include the following:
[0075] S201, training data preparation, selects active users to track and collect feature data during the marking period, for example, tracking 1,000 active users, including 800 in the training set and 200 in the test set.
[0076] S202, data preprocessing, performs Z-score standardization on numerical features, converts sentiment labels into numerical values, and verifies data range and integrity.
[0077] S203, data labeling, annotate the correspondence between the feature vector x and the emotional state category C, such as "continuously listening to sad songs + high circulation" feature vector x corresponds to the sadness category, "late night time + negative lyrics keywords" feature vector x corresponds to the depression category, and other feature vectors x correspond to the neutral category. The labeling is independently marked by the labeler through the LabelStudio platform, and the Kappa coefficient must be ≥0.75.
[0078] S204, model training. In this embodiment, the SVM model is selected for training, and the RBF kernel function is expressed as: K(x i ,x j )=exp(-γ||x i -x j || 2 ).
[0079] It should be noted that, in addition to the SVM model, common models such as the random forest model can also be used for training, and this application does not impose any restrictions here.
[0080] Step S104: Evaluate the user's emotional state category C using an emotional state evaluation model.
[0081] Specifically, in this embodiment, taking the trained SVM model as an example, when there is listening behavior data of a new user, we extract its listening period features, listening time features, listening song classification features, single song loop times features and listening song keyword features according to the previous feature extraction method to form a feature vector x, and then input x into the trained SVM model. The model determines the emotional state category C to which the feature vector belongs based on the hyperplane after learning the kernel function mapping.
[0082] Step S105: Calculate the user's emotional state risk index R, using the following formula:
[0083] R = B'(C) × a × t, where B'(C) is the dynamic risk value corresponding to different emotional state categories C, a is the mood fluctuation index, and t is the duration of emotional immersion.
[0084] Specifically, in this embodiment, B'(C) is the dynamic risk value corresponding to different emotional state categories C. It is a numerical value set based on the potential impact of the emotional state category on mental health, and is used to reflect the baseline impact level of different emotional categories in risk assessment. Different emotional state categories, such as happiness, calmness, sadness, anxiety, depression, etc., have different impacts on the user's mental health. According to psychological research data, negative emotional state categories (such as sadness and anxiety) may have a more significant negative impact on mental health than positive emotional state categories (such as happiness and joy), and therefore are assigned higher risk values, while positive emotional state categories are assigned relatively lower risk values. In some specific embodiments, we can set B'(happy) = 0.2, B'(calm) = 0.5, B'(sadness) = 0.8, B'(depression) = 0.9... At the same time, B'(C) is a dynamic value that can be dynamically adjusted based on actual application and user feedback to more accurately express the impact weight.
[0085] Furthermore, the mood swing index a is express, is the average song genre change value during the continuous playback period; The calculation formula is: Where Δg i is the absolute value sequence of the difference between the styles of adjacent songs, g i is the characteristic value of the song style, and n is the number of songs in the continuous playing period.
[0086] Specifically, each song has a style feature value g i , g i It can be obtained through music feature extraction algorithms, such as rhythm, harmony complexity, etc., which are quantified into a numerical value, g iThe value range is 0-1, the song playing order is i=1,2,...,n, and the absolute value sequence Δg of the difference between the styles of adjacent songs is calculated. i , Δg i =|g i+1 -g i |, for example, if the number of plays in the continuous play time period is 3, the style feature value g i They are 0.2, 0.4, and 0.3 respectively, Δg1=|0.4-0.2|=0.2, Δg2=|0.3-0.4|=0.1, That is, the mood fluctuation index a is 0.15.
[0087] Furthermore, the emotional immersion duration t is the listening duration of different emotional types of audio recorded on the basis of the recorded listening duration, and the calculation formula is:
[0088] Among them, T i is the duration of the i-th audio playback, C i is the emotional tone classification of the i-th audio, C target is the target emotional tone classification, and n is the total number of user audio playbacks during the statistical period.
[0089] Specifically, when a user plays an audio clip, the emotional tone of the audio (e.g., happy, sad, etc.) is analyzed in real time. Combined with the playback duration, the total time the user is immersed in each emotion is calculated. For each audio clip playback, the following variables are defined:
[0090] S i : The start time of the i-th audio playback, expressed as a timestamp, for example, the number of seconds counted from 0:0:0:0 on the current day;
[0091] E i : The end time of the i-th audio playback (expressed as a timestamp);
[0092] T i : duration of the i-th audio playback, T i =E i -S i ;
[0093] C i : The emotional tone classification of the i-th audio, such as 1 represents cheerfulness, 2 represents sadness, 3 represents optimism, etc.
[0094] C target : Target emotional tone, that is, the classification value corresponding to the specific emotional type for which we want to calculate the duration of emotional immersion.
[0095] During the statistical period, every audio playback record is traversed. If the emotional tone classification of a certain audio playback is the same as the target emotional tone classification, the playback duration is counted into the immersive emotional duration t; if different, it is not counted. In this way, the total time the user is immersed in audio with a specific emotional tone can be accurately accumulated. At the same time, considering that the emotional tone may change during the playback process, the audio can be sliced and analyzed at certain time intervals (such as every 1 minute), the emotional tone of each slice is calculated, and then the calculation is performed according to the above formula.
[0096] Step S106: determine whether the intervention conditions are met based on the value of the emotional state risk index R, and if so, perform guided intervention.
[0097] For example, the behavior data of user User123 in the past 24 hours is as follows:
[0098] Affective state category C: sadness (assessed by the model);
[0099] Dynamic risk value B'(C): 0.8 (range 0-1, the higher the value, the greater the risk);
[0100] Mood swing index a: 1.2;
[0101] Emotional immersion duration t: 175 minutes ≈ 2.92 hours (the duration of continuous listening to sad songs);
[0102] Then R=B'(C)×a×t=0.8×1.2×2.92=2.80.
[0103] Furthermore, the value of the emotional state risk index R is used to determine whether the intervention condition is met, and if so, to guide the intervention, specifically:
[0104] A hierarchical intervention threshold is set, and hierarchical guidance intervention is carried out according to the risk level of the risk index R. The hierarchical guidance intervention includes generating a recommended playlist of opposite emotional states, actively outputting communication texts of the comfort and emotional counseling categories, and pushing psychological care resources.
[0105] For example, Table 1 is a description of the risk level assessment of the risk index R. When the risk index R is at a low risk level, only data is recorded without active intervention; when the risk index R is at a medium risk level, it indicates that the user may face certain emotional fluctuations, but it is still within an acceptable range. By generating a playlist with reverse emotional states and actively prompting the user to change the style of music; when the risk index R is at a high risk level, such as the risk index R of User123 mentioned above, it indicates that the user may face greater pressure and emotional fluctuations and needs attention and intervention. Therefore, in addition to generating a reverse emotional playlist, it also actively outputs communication texts of the comfort and emotional counseling categories and pushes psychological care resources.
[0106] Table 1 Risk Index R Assessment Table
[0107]
[0108] Specifically, such as Figure 3 As shown in the figure, the steps for generating the reverse emotional state recommendation playlist include:
[0109] S301, querying user historical preferences from the knowledge graph;
[0110] S302, reversely screening matching music genres based on the current emotional state category C;
[0111] S303: Use the database to quickly search for similar songs.
[0112] For example, when it is identified that the user's risk index R is at a medium risk level, the user's favorite piano artists are obtained from the knowledge graph, and songs with a valence value greater than 0.7 are screened. At the same time, several popular healing songs in the system are inserted to generate a playlist "Warm Piano Music". The text is pushed: "These gentle piano songs have accompanied *** users through the trough." By actively generating a recommended playlist with the opposite emotional state, users are guided to change their listening style and implicitly help them change their emotional state.
[0113] like Figure 4 As shown, the proactive output of comfort and emotional counseling communication texts and the push of psychological care resources include:
[0114] S401, generating dynamic dialogue text, selecting the text template type based on the R value, generating candidate texts using a large language model, and selecting the optimal version using a CTR prediction model;
[0115] S402, matching psychological care resources, matching associated labeled resources from the resource library according to the R value.
[0116] Furthermore, it also includes model evaluation and feedback learning. The evaluation indicators include accuracy, recall rate and F1 value. The feedback learning includes collecting user feedback data on guided intervention behavior, performing incremental learning to optimize the model and verifying the feedback effect.
[0117] Specifically, in this embodiment, the accuracy calculation formula is: The recall calculation formula is: The formula for calculating the F1 value is: TP represents a true positive, TN represents a true negative, FP represents a false positive, and FN represents a false negative. After processing the feature vectors extracted from the test set samples, the trained SVM model is used to predict the sentiment category. A confusion matrix is generated based on the true and predicted categories, and the model optimization process is triggered based on the judgment criteria.
[0118] Through the above detailed technical scheme, the present invention constructs a dynamic portrait through multi-source features, combines the machine learning model to evaluate the user's implicit emotional state, and introduces the risk index R, comprehensively considers the dynamic risk value B'(C) of the emotional state category, the emotional fluctuation index a, and the immersion time t to quantify the user's emotional risk level. According to the risk index R, different levels of guidance intervention measures are dynamically triggered, combining implicit guidance with explicit support, which not only subtly influences emotions through the reverse emotional state playlist, but also actively provides psychological assistance, avoids the "information cocoon" from exacerbating negative emotions, and solves the limitations of traditional music recommendation systems that rely on explicit preferences.
[0119] Second, as Figure 5 As shown, an embodiment of the present application provides an emotional state assessment and intervention system 10 based on user listening behavior, comprising:
[0120] Acquisition module 11, used to acquire user listening behavior data, pre-process the data and perform multi-source feature extraction;
[0121] A user dynamic portrait library construction module 12 is used to construct a user dynamic portrait library based on multi-source features;
[0122] An emotional state assessment model construction module 13 is used to construct and train an emotional state assessment model;
[0123] An evaluation module 14 is configured to evaluate a user's emotional state category C using an emotional state evaluation model;
[0124] The risk index calculation module 15 is used to calculate the user's emotional state risk index R, and the calculation formula is:
[0125] R = B'(C) × a × t, where B'(C) is the dynamic risk value corresponding to different emotional state categories C, a is the emotional fluctuation index, and t is the duration of emotional immersion;
[0126] The guidance intervention module 16 is used to determine whether the intervention conditions are met according to the value of the emotional state risk index R, and if so, to perform guidance intervention.
[0127] in, Figure 5 The functional implementation of each module in the emotional state assessment and intervention system based on user listening behavior corresponds to the steps in the above-mentioned emotional state assessment and intervention method embodiment based on user listening behavior, and their functions and implementation processes will not be repeated here one by one.
[0128] Thirdly, as Figure 6As shown, an embodiment of the present application provides an electronic device, wherein the electronic device 20 includes: a processor 21, a memory 23, and an emotional state assessment and intervention program stored in the memory 23 and executable on the processor, and the application loader is configured to implement an emotional state assessment and intervention method such as any one of the above.
[0129] The memory 23 is used to store executable instructions of the processor 21;
[0130] The processor 21 is configured to execute the technical solution in any of the aforementioned method embodiments by executing the executable instructions.
[0131] Optionally, the memory 23 may be independent or integrated with the processor 21 .
[0132] Optionally, when the memory 23 is a device independent of the processor 21, the device 20 may further include:
[0133] The bus 24 , the memory 23 and the communication interface 22 are connected to the processor 21 via the bus 24 and communicate with each other. The communication interface 22 is used to communicate with other devices.
[0134] Optionally, the communication interface 22 may be implemented using a transceiver. The communication interface is used to enable communication between the database access device and other devices (e.g., a client, a read-write library, and a read-only library). The memory may include random access memory (RAM) and may also include non-volatile memory (non-volatile memory), such as at least one disk storage device.
[0135] Bus 24 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the figure uses only one thick line, but this does not imply that there is only one bus or only one type of bus.
[0136] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0137] The electronic device is used to execute the technical solution in any of the aforementioned method embodiments, and its implementation principles and technical effects are similar and will not be repeated here.
[0138] Finally, it should be noted that the above embodiments are only preferred specific implementation methods of the present invention, and the protection scope of the present invention is not limited thereto. Any technician familiar with this technical field, within the technical scope disclosed by the present invention, can make equivalent replacements or changes based on the technical solutions and inventive concepts of the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for assessing and intervening in the emotional state of a user based on listening behavior, characterized in that: include: Obtain user listening behavior data, pre-process the data, and then perform multi-source feature extraction; Build a user dynamic portrait library based on multi-source features; Build and train an affective state assessment model; Evaluate the user's emotional state category C through the emotional state evaluation model; Calculate the user's emotional state risk index R, the calculation formula is: R = B'(C) × a × t, where B'(C) is the dynamic risk value corresponding to different emotional state categories C, a is the emotional fluctuation index, and t is the duration of emotional immersion; The value of the emotional state risk index R is used to determine whether the intervention conditions are met. If so, guided intervention is carried out.
2. The emotional state assessment and intervention method according to claim 1, characterized in that: The determination of whether the intervention conditions are met is based on the value of the emotional state risk index R, and if so, guiding intervention is performed, specifically: A hierarchical intervention threshold is set, and hierarchical guidance intervention is carried out according to the risk level of the risk index R. The hierarchical guidance intervention includes generating a recommended playlist of opposite emotional states, actively outputting communication texts of the comfort and emotional counseling categories, and pushing psychological care resources.
3. The emotional state assessment and intervention method according to claim 1, characterized in that: The mood swing index a is express, is the average song genre change value during the continuous playback period; The calculation formula is: Where Δg i is the absolute value sequence of the difference between the styles of adjacent songs, g i is the song genre feature value, and n is the number of songs in the continuous playing period.
4. The emotional state assessment and intervention method according to claim 1, characterized in that: The emotional immersion duration t is the listening duration of audio of different emotional types recorded on the basis of the listening duration. The calculation formula is: Among them, T i is the duration of the i-th audio playback, C i is the emotional tone classification of the i-th audio, C target is the target emotional tone classification, and n is the total number of user audio playbacks within the statistical period.
5. The emotional state assessment and intervention method according to claim 1, characterized in that: The multi-source features include: one or more of a listening period feature, a listening duration feature, a listening song classification feature, a single song loop count feature, and a listening song keyword feature.
6. The emotional state assessment and intervention method according to claim 5, characterized in that: The calculation formula of the listening period feature is: Among them, suppose a day is divided into n time periods, x ij is the proportion of user i’s listening times in the jth time period to the total listening times, N ij is the number of times user i listens in the jth time period; The calculation formula of the listening time feature is: Among them, A i is the average listening time, L ik is the time that user i listens to song k, M i is the total number of songs listened to by user i; The calculation formula of the listening song classification feature is: Among them, y il N is the ratio of the number of times user i listens to the lth type of songs to the total number of times he listens to them. il is the number of times user i listens to songs in category l, and m is the total number of songs listened to by user i; The calculation formula of the single song cycle times feature is: Among them, R i is the average number of single song cycles for user i, R ik is the number of times user i repeats song k, P i The number of songs looped for user i; The keyword features of the songs are used to extract key lyrics using the TF-IDF algorithm. The calculation formula is: Among them, tf-idf w,k is the TF-IDF value of word w in song k, tf w,k is the frequency of word w in song k, df w is the number of songs containing word w, and M is the total number of songs.
7. The emotional state assessment and intervention method according to claim 5, characterized in that: The emotional state evaluation model is constructed and trained by combining the extracted listening period features, listening time features, listening song classification features, single song loop times features and listening song keyword features into a feature vector x, through the machine learning algorithm, the feature vector x, the training data of the emotional state category C {(x1, C1), (x2, C2), ..., (x N ,C N )} as input, and train the model to evaluate the emotional state category.
8. The emotional state assessment and intervention method according to claim 7, characterized in that: It also includes model evaluation and feedback learning. The evaluation indicators include accuracy, recall rate and F1 value. The feedback learning includes collecting user feedback data on guided intervention behavior, performing incremental learning to optimize the model and verifying the feedback effect.
9. A system for assessing and intervening in the user's emotional state based on listening behavior, characterized in that: include: The acquisition module is used to obtain user listening behavior data, pre-process the data and perform multi-source feature extraction; User dynamic portrait library construction module, used to construct a user dynamic portrait library based on multi-source features; Affective state assessment model building module, used to build and train the affective state assessment model; An evaluation module, configured to evaluate the user's emotional state category C using an emotional state evaluation model; The risk index calculation module is used to calculate the user's emotional state risk index R. The calculation formula is: R = B'(C) × a × t, where B'(C) is the dynamic risk value corresponding to different emotional state categories C, a is the emotional fluctuation index, and t is the duration of emotional immersion; The guidance intervention module is used to determine whether the intervention conditions are met based on the value of the emotional state risk index R, and if so, to conduct guidance intervention.
10. An electronic device, characterized in that: The electronic device includes: a processor, a memory, and an emotional state assessment and intervention program stored in the memory and executable on the processor, wherein the emotional state assessment and intervention program is configured to implement any one of the above emotional state assessment and intervention methods.